Wednesday, July 15, 2015

Entropy in Linux CentOS 6.5 / RHEL 6.5 @ Virtualization TYPE1 and TYPE2 (Performance considerations)

In computing, entropy is the randomness collected by an operating system or application for use in cryptography or other uses that require random data. This randomness is often collected from hardware sources, either pre-existing ones such as mouse movements or specially provided randomness generators. (source wikipedia)

Current Available Entropy in Linux Kernel
# cat /proc/sys/kernel/random/entropy_avail
58

Having a very low entropy generally affects cryptography operations (SSL, HTTPS etc).

Generally entropy is linked to device errors from the hardware. In perfectly virtualized setup (like xen, KVM, virtual box) error stream from hardware is masked by the hypervisor layer. It is recommended to generate entropy by utility programs.

# yum install rng-tools.x86_64

[root@perf04 init.d]# cat /etc/sysconfig/rngd
# Add extra options here
EXTRAOPTIONS="-r /dev/urandom -o /dev/random -t 5"
[root@perf04 init.d]# /etc/init.d/rngd status
rngd is stopped
[root@perf04 init.d]# /etc/init.d/rngd stop
Stopping rngd:                                             [FAILED]
[root@perf04 init.d]# /etc/init.d/rngd start
Starting rngd:                                             [  OK  ]

# cat /proc/sys/kernel/random/entropy_avail
2780

Friday, July 10, 2015

NFS Setup and Performance Tunning on RHEL 6.5 / CentOS 6.5

Install nfs in Server and Client

# yum install nfs-utils nfs-utils-lib nfs-common
# yum install portmap

At Server(192.168.1.1)

Edit /etc/exports file for which directory to export
# cat /etc/exports
/nfsfs 192.168.1.2(rw,sync,no_root_squash)

# chkconfig nfs on
# service rpcbind stop
# service nfs stop

# chkconfig nfs on
# service rpcbind start
# service nfs start

# exportfs -a


At Client(192.168.1.2)

# chkconfig nfs on
# service rpcbind stop
# service nfs stop

# chkconfig nfs on
# service rpcbind start
# service nfs start

# mkdir -p /nfsfs

# cat /etc/fstab
192.168.1.1:/nfsfs  /nfsfs   nfs      auto,soft,noatime,nolock,bg,intr,tcp,actimeo=1800 0 0
# mount -a

# df -kh
192.168.1.1:/nfsfs   44G  5.7G   36G  14% /nfsfs

VIM Editor Tips and Tricks (Linux and UNIX)

To replace ctrl M charter from a file.

:%s/^M//g

To make the above ^M to appear inside VIM command press ctrl +v then ctrl + m.

To Make the file format to UNIX.

When you open the file VIM reports file format as — DOS or Unix:

To modify the file format to UNIX use the below commands inside VIM

:set filetype=unix

:set fileformat=unix

The file will be written back without carriage return (CR, ^M) characters.

Remember to save.

:wq

In case you have to overwrite by force

:wq!

X11 GUI via SSH in CentOS 6 / RHEL 6

Enable X11 forward in Putty in local machine.


Install Cygwin in local machine and Open Xlaunch. use the following settings. Click all Next and close.



Launch the Putty session and connect to remote linux machine.

[root@test ~]# echo $DISPLAY
localhost:10.0
[root@test ~]#  xclock

Now gui Open a XWindow in your local machine.






CPU Clock Speed Monitoring in Linux

Shell command to Monitor CPU Clock speed in Linux

bash#  watch grep \"cpu MHz\" /proc/cpuinfo

Every 2.0s: grep "cpu MHz" /proc/cpuinfo                                                                                          
cpu MHz         : 2792.990
cpu MHz         : 2792.990

Sunday, January 11, 2015

DIY Table LAMP with LED Lightings

Materials Needed

LED LIGHT fixture + LED Driver
1/4 inch thick wood
Small 3/4 inch Plywood rectangular piece
3/4 inch screws
Small nails
Fevicol
Screws and Nuts
120MM diameter PVC pipe.
Driller + Multiple drill bits

The Basic Frames. Front side.

Back Side.



 Finished Product at Work. Lot of LUMENs.





DIY Power UPS/Inverter Cabinet

Materials Needed

3/4 inch Hard Plywood
2.5 inch Plywood sharp nails
Hammer
Hack saw
Circular saw
Glass + Handle + Hinges
Door Hinges
Primer Paint + Glossy Paint
Fevicol

This cabinet has two compartments. Upper one has a glass door containing POWER unit. Lower one has a Plywood door containing 60Kg Tubular Battery.

First we need a sturdy frame. Be generous on Fevicol + Nails on the wood joints.




 Door with the Hinges (120 degree one)
 More Bushes to take the load of the heavy battery.
 Plywood doors are fixed.

Glass doors are fixed. 
The finished product after the primer coat + Glossy coat of Paint.