Archive for September, 2011

1] Install a minimal Ubuntu64 11.04 Server for the primary host. Steps 1-9 are also to be repeated for the secondary host. Select "Install a minimal system" in "Modes" when you boot the Ubuntu64 11.04. Please don't tick anything in the "Software selection" dialog when it pops out during install.
2] sudo apt-get install openssh-server wget nfs-common vim
3] Download the latest GlusterFS .deb file. You can download the software . I used "wget"
4] If you've installed GlusterFS before on the machine to be setup, uninstall it from the server using the following command:
sudo dpkg -r glusterfs
5] Install GlusterFS from the .deb file using the dpkg command. For example: "sudo dpkg -i glusterfs_3.2.3-1_amd64.deb"
› Continue reading...

1] sudo adduser glassfish
2] sudo groupadd glassfishadm
3] sudo apt-get install python-software-properties
4] sudo add-apt-repository "deb natty partner"
5] sudo apt-get update
› Continue reading...

1] Install a minimal CentOS 6.0 64-bit setup. I used the text-based installer to give me a minimal installation(but this does not provide for custom partitioning). The GUI can also be used to make a minimal installation, and this can provide for custom partitioning.
2] Edit your /etc/sysconfig/network-scripts/ifcfg-eth0 (or the appropriate network interface for your device). Mine is setup like this in a VirtualBox VM that is set to the default NAT networking. Just substitute values when necessary.


3] Do a "chkconfig network on".
4] Do a "service network restart" as root.

If you want to get a DHCP lease instead of assigning static IPs...
Substitute this for step 2 above. Make your /etc/sysconfig/network-scripts/ifcfg-eth0 look like this:


To disable IPv6...
1] Edit your /etc/sysconfig/network . Append these lines:


2] Add a new file /etc/modprobe.d/ipv6disable.conf containing

alias net-pf-10 off
alias ipv6 off

3] "chkconfig ip6tables off"
4] Reboot.

To use system-config-network-tui...
1] Do a "yum install system-config-network-tui" as root.
2] Do a "system-config-network-tui" as root. And setup your networking as you like. πŸ™‚
3] Don't forget to do a "service network restart". πŸ™‚

To use system-config-firewall-tui...
1] Do a "yum install system-config-firewall-tui" as root.
2] Do a "system-config-firewall-tui" as root. And setup your firewall as you like. πŸ™‚
3] Don't forget to do a "service iptables restart", and "service ip6tables restart" if you have IPv6 enabled. πŸ™‚

I found this Bash shell script somewhere in the internet, and I find it useful for removing duplicate files. πŸ™‚

echo "#!/bin/sh" > $OUTF;
find "$@" -type f -exec md5sum {} \; |
sort --key=1,32 | uniq -w 32 -d --all-repeated=separate |
sed -r 's/^[0-9a-f]*( )*//;s/([^a-zA-Z0-9./_-])/\\\1/g;s/(.+)/#rm \1/' >> $OUTF;
chmod a+x $OUTF; ls -l $OUTF

1] sudo adduser zabbix
2] Make sure /etc/services has these:
zabbix_agent 10050/tcp
zabbix_trap 10051/tcp
3] sudo mkdir /etc/zabbix
4] Copy /etc/zabbix/zabbix_agentd.conf from the Zabbix server (setup in the "Setup Zabbix 1.8 in a minimal Ubuntu 11.04 64-bit" guide found in this blog) to /etc/zabbix/zabbix_agentd.conf in this Zabbix client. Make sure the "Server=" line is correct.
5] cd ~
› Continue reading...

1] "sudo apt-get install apache2 php5 php5-curl php5-gd php5-xmlrpc php-net-socket php5-mysql mysql-server libssh2-1 fping openipmi libcurl4-openssl-dev gcc make libmysqld-dev libsnmp-dev snmpd libiksemel3 libiksemel-dev"
2] "sudo adduser zabbix"
3] Add β€œzabbix” user to /etc/sudoers file (you can remove it from the said file after the install. This is just for convenience in making this guide.). This can be achieved by appending: β€œzabbix ALL=(ALL:ALL) ALL”
4] "sudo su zabbix"
5] cd ~
› Continue reading...

Note: This post was used to be "Recursive replace in GNU/Linux using find and sed"

Recursive replace in GNU/Linux using find and sed

Here's the command I use for recursive replacements. I found it somewhere in the internet. πŸ™‚

find ./ -type f -exec sed -i 's/RegEx search pattern here/Replacement text here/' {} \;

Here's a sample with filename pattern matching:

find ./ -type f -name "*.txt" -exec sed -i 's/RegEx search pattern here/Replacement text here/' {} \;

Find file owned by group

find /home -group ftpusers
find /data/project -group ftpusers -name "*.c"

Find file owned by user

find /var -user vivek
find /var/www -user vivek -name "*.pl"

sed substitution
With a file with filename "file" in the current directory containing "Hello world", executing this command will make a file with filename "output" that contains "world wide":
sed 's/Hello \(world\)/\1 wide/' file > output

« Previous posts Back to top