Friday, October 31, 2014

Install Realtek RTL8188CE on CentOS 6

Since CentOS doesn't have suitable firmware and drivers for Realtek wireless cards, one needs to be installed.
1. Install ELRepo:
yum install http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm -y
2. Install kmod realtek firmware:
yum install *8192ce* -y
3. reboot the machine.

Wednesday, October 29, 2014

Adding directories to man path

To add a custom path to man(say you compiled an application in /usr/local/), all you have to do is edit the following file:
/etc/man.config
And edit the following:
MANPATH /usr/local/ha/share/man
To update the database immediately:
makewhatis -v  /usr/local/ha/share/man

No module named crmsh

If you encounter the following error while trying to compile crmsh:
crmFatal error:No module named crmshNo module named modules 
Failed to start the crm shell! This is likely due toa broken installation or a missing dependency. 
If you are using a packaged version of the crm shell,please try reinstalling the package. Also check yourPYTHONPATH and make sure that the crmsh module isreachable.
Please make sure that:
1. In case you've compiled crms in /usr/local, make sure to link the folders inside:
/usr/local/ha/lib64/python2.6/site-packages/
to
/usr/lib64/python2.6/site-packages/
by using the command:
ln -s /usr/local/ha/lib64/python2.6/site-packages/* /usr/lib64/python2.6/site-packages/
2. Make sure to install the following dependencies:
yum install *lxml* *PyYAML* -y

Yum: removing packages with dependencies

When removing a package using:
yum erase
The dependencies aren't removed automatically and stay in the system even if they are not being used, to fix it add the following to /etc/yum.conf:
clean_requirements_on_remove = 1

Thursday, October 9, 2014

Install OpenBox on FreeBSD 10

1. Check if there are any updates to the OS:
freebsd-update fetch

freebsd-update install
2. Install Xorg and OpenBox:
pkg install xorg openbox tint2
3. Create the following directory inside your home directory:
mkdir ~/.configmkdir ~/.config/openbox 
mkdir ~/.config/tint2
2. Copy OpenBox provided configuration files to the directory:
cp /usr/local/etc/xdg/openbox/menu.xml ~/.config/openbox/menu.xmlcp /usr/local/etc/xdg/openbox/rc.xml ~/.config/openbox/rc.xml
3. Copy Tint2 provided configuration file to the directory:
cp /usr/local/share/examples/tint2/tint2rc ~/.config/tint2
4. Create the following file and give it executable permissions:
touch ~/.config/openbox/autostart.shchmod +x ~/.config/openbox/autostart.sh
5. Echo the following content inside the file:
echo "#!/bin/sh" >> ~/.config/openbox/autostart.sh
6. Configure hal and dbus to start on boot:
echo 'hald_enable="YES"' >> /etc/rc.conf
7. Instruct X to load OpenBox:
echo "exec openbox-session" >> ~/.xinitrc
8. Reboot the computer:
reboot
9. Launch OpenBox and edit Tint2:
startxtint2conf

Wednesday, October 8, 2014

Install Intel compiler on CentOS

To install any Intel compiler, follow these steps:

1. Download the latest version from Intel's Development site(you need to register for an evaluation and then get a link in the mail).

2. Extract the archive:
tar xvf parallel_studio_xe_2015.tgz
3. Install 32Bit libraries:
yum install libstdc*i686 -y
4. Change directory the extracted archive:
cd parallel_studio_xe_2015
5. Launch the GUI installer:
./install_GUI.sh
6. Nothing special to choose from, just the evaluation check box when asked about a serial number(or enter a serial number if you have one).

7. Create the following files in /etc/profile.d/:
vi /etc/profile.d/intel.sh
#!/bin/bashsource /opt/intel/composerxe/bin/compilervars.sh intel64source /opt/intel/impi/5.0.1.035/bin64/mpivars.sh
8. Copy the file and make a c shell version:
cp /etc/profile.d/intel.sh /etc/profile.d/intel.csh
9. Edit it:
vi /etc/profile.d/intel.csh
#!/bin/cshsource /opt/intel/composerxe/bin/compilervars.csh intel64source /opt/intel/impi/5.0.1.035/bin64/mpivars.csh
10. Make both file executable:
chmod +x /etc/profile.d/intel* 
11. Test it using icc -v mpicc -v

Shrink an XFS partition

To shrink an XFS partition, follow these steps:

1. First, backup the data using xfsdump (-f stands for where to save the dump file and the /home stands for which mount to backup):
xfsdump -f /tmp/home.dump /home
2. Unmount the partition:
cd / 
umount /home
3. Delete the partition:
lvremove /dev/vg00/home
4. Recreate it with a smaller size:
lvcreate --name home -L 2GB vg00
5. Mount the /home partition:
mount /dev/vg00/home /home
6. Restore the data using xfsrestore:
xfsrestore -f /tmp/home.dump /home

Configure Quota on CentOS

To configure disk quota on CentOS, follow these steps:

1. install the following packages:
yum install quota* -y
1. Enable user quota and/or group quota on a file system:
vi /etc/fstab 
UUID="93ee7df7-4f3c-4127-be2b-5229b219f644" /home ext4 defaults,usrquota,grpquota 0 0
2. Create the quota database:
quotacheck -cug /home
OR create the databases for all partition that have quota enabled
quotacheck -acug
3. Configure a quota for a user/group(modify the block limits in kb, that means 1024K*500=512MB):
edquota ramesh
Disk quotas for user dennis (uid 500):
  Filesystem                   blocks       soft       hard     inodes     soft     hard
  /dev/mapper/vg0-home         512000          512000          512000         11        0        0
4. Check if quota is enabled or not:
quotaon -ap
group quota on /home (/dev/mapper/vg0-home) is off
user quota on /home (/dev/mapper/vg0-home) is off
5. To enable the quota on all partitions have quota configured:
quotaon -av
6. To see the report of the quota:
repquota -sa
*** Report for user quotas on device /dev/mapper/vg0-home
Block grace time: 7days; Inode grace time: 7days
                        Block limits                File limits
User            used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
root      --       4       0       0              1     0     0    
dennis    --    501M    500M    500M             11     0     0  
 
 
    

Friday, October 3, 2014

Install SLURM on CentOS 6

Force a resolution on VirtualBox and CentOS

To force a certain resolution on VirtualBox and CentOS, use the following commands:

1. Create the Modeline using cvt tool:
cvt 1280 720 
Modeline "1280x720_60.00"   74.50  1280 1344 1472 1664  720 723 728 748 -hsync +vsync
2. Add it to the supported resolutions:
xrandr --addmode "1280x720_60.00"   74.50  1280 1344 1472 1664  720 723 728 748 -hsync +vsync
3. Add it to ta certain screen:
xrandr --addmode VBOX0 "1280x720_60.00"
4. Finally change the resolution using the GUI System / Preferences / Display or using:
xrandr --output VBOX0 --mode "1280x720_60.00"

Thursday, October 2, 2014

Slurm's logs are too big

To fix the issue where Slurm's logs are getting to large, create the following file:
vi /etc/logrotate.d/slurm
### SLURM Logrotate Configuration##
/var/log/slurm/*log { 
compress
missingok 
nocopytruncate 
nocreate 
nodelaycompress 
nomail  
notifempty 
noolddir 
rotate 5 
sharedscripts 
size=5M 
create 640 slurm root 
postrotate /etc/init.d/slurm reconfig 
endscript
}

Cannot find auth plugin for auth/authd

When encountring with the following error:
sinfo: error: Couldn't find the specified plugin name for auth/authd looking at all filessinfo: error: cannot find auth plugin for auth/authd
Please make sure slurm.conf has the following parameter:
AuthType=auth/munge

Wednesday, October 1, 2014

Error: too many arguments to function 'H5Dcreate'

When trying to build Slurm on a system that has HDF5 prior to version 1.8, the compilation will fail with errors such as:
hdf5_api.c:2021: error: too many arguments to function 'H5Dcreate'
To fix it, please make the following modification to the slurm.spec file:

1. Un-tar the source file:
tar xvf XXXX.tar.bz2
2. Edit slurm.spec file:
vi slurm.spec
3. Locate %build and add the following at the end of the parameters:
--with-hdf5=no



Segmentation fault with the latest SLURM

When trying to build rpms with the latest Slurm on CentOS 5.X, you will get the following error when trying to use all slurm commands:
Segmentation fault.
OR
sinfo: Resetting MaxJobCnt from 4294967294 to 4294687295 (MaxJobId - FirstJobId + 1)sinfo: error: is_valid_path: path is NULL!sinfo: error: Bad value "(null)" for PluginDir sinfo: fatal: Unable to process configuration file 
To fix it please disable the optimization during building the rpms:
rpmbuild -tb -D 'with_cflags CFLAGS="-O0 -g3"' slurm-14.03.6.tar.bz2