In some cases, we need to test a configuration in a server that is managed by Puppet. Besides excluding the server in the manifest file, there are two more ways to do it: 1) Use "chattr +i <file>" to set the file to immunable to prevent even root from changing the file. Use "chattr -i" … Continue reading Exclude configuration from puppet central management
Show public IP in Linux command
In Linux console, run the following command to show the public IP address of the machine. curl echoip.net ; echo
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
Clear Linux memory cache
There was a alert showing that the swap free space is low in a RHEL 5.6 box. I logged in and checked, the box has 13G RAM, but only 1G swap. First, this is not a good practice, as RedHat recommends 4G swap for RHEL5 with 4-16G RAM. free -m total used free shared buffers … Continue reading Clear Linux memory cache
Configure Synergy as systemd service
Synergy is a mouse and keyboard sharing software (not free anymore). I use it for sharing my Fedora 20 K&M with my Windows box. As Fedora 20 replaces init with systemd, there is no rc.local where I can add my own startup script. Systemd provides a easy way to allow you create your own system service. … Continue reading Configure Synergy as systemd service