In Linux console, run the following command to show the public IP address of the machine. curl echoip.net ; echo
Tag: Bash
Apache mod_rewrite URL redirect script
I wrote a bash script to automate the Apache (mod_rewrite) URL redirection. It supports 3 types of redirection: - One to One: eg. From http://jackiechen.local/mylab To http://jackiechen.org./mylab - Any to One: eg. From http://jackiechen.local/* To http://jackiechen.org - Any to Any: eg. From http://jackiechen.local/$1 to http://jackiechen.org/$1 The script can be downloaded from here Note: I tested … Continue reading Apache mod_rewrite URL redirect script
Use sed to append a file to another
To append file2 to a specific line in file1, here is command: sed -i "<line>r file2" file1 Example:
Update puppet tags
This script allow you to apply the specified puppet tags to the listed hosts. It will do a dry run against the first host, if you are happy with the results then you can kick off the changes to all hosts. The script can be downloaded from here.
Push public key to remote hosts in a batch
Sometimes it is easy to use the passwordless SSH authentication against the remotes hosts. I wrote a script that can push your public key to remote hosts in a batch. The script can be downloaded from here