Saturday, November 29, 2014

Setting the time

To set the time, first determine what is the hardware time:
hwclock -r
To set the time and date:
date -s "2 OCT 2006 18:00:00"
To set the time only:
date +%T -s "10:13:13"
To set the hardware time using the system time:
hwclock -w

Slurm: spread jobs evenly

To configure SLURM to spread the jobs evenly, edit /etc/slurm/slurm.conf:
vi /etc/slurm/slurm.conf
SelectTypeParameters=CR_LLN
Spread the file to all machines and run:
service slurm restart

Wednesday, November 26, 2014

Bash: add time to prompt


To add time stamps inside our bash prompt, add the following to ~/.bash_profile:
export PS1="(\t) $PS1"

Friday, November 14, 2014

Yum: clone a repository

To clone a repository, say .. CentOS's update repository:
rsync -avr rsync://centos.syn.co.il/centos/6.5/updates/x86_64/ --delete --exclude=debug/ /var/www/html/centos/updates/6.5/

Install fwbackups on CentOS 6

1. Install the following dependencies:
yum install automake autoconf gettext python cronie pygtk* libglade2-devel python-crypto python-paramiko notify-python make gcc intltool -y
2. Download the source from SourceForge:
cd /tmp
wget http://downloads.diffingo.com/fwbackups/fwbackups-1.43.4.tar.bz2
3. Extract the archive and compile it:
tar xvf fwbackups-1.43.4.tar.bz2
cd fwbackups-1.43.4
./configure --prefix=/usr/local
make
make install
4. Edit /usr/local/bin/fwbackups and add the following to line 22:
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.6/site-packages/
5. Start the application and start backing up stuff:
fwbackups

CentOS7: missing ifconfig

To bring back the old ifconfig command to CentOS 7, run the following:
yum install net-tools -y

CentOS7: bring back eth interface

In case you've installed CentOS 7, notice that there are no ethX interfaces, to bring them back:

1. Use the following command to add two parameters to the linux kernel line:
sed -i "s/quiet.*/quiet net.ifnames=0 biosdevname=0\"/" /etc/default/grub
2. Recreate the new grub configuration using the following command:
grub2-mkconfig -o /boot/grub2/grub.cfg
3. Reboot the computer.