Category: Work related
Openvpn client start return failed but still working
linux version 2.1 – 2.3.2 Openvpn client start failed (shown), but interestingly it is still working. Workaround: Seems something is racing. add ; sleep 1 after $openvpn –daemon –writepid $piddir/$bn.pid –config $c –cd $work $script_security resolves this. This is to allow one more seconds for the daemon to return success signal.
SCSI commands
SCSI scan for single device: echo “c t l” > /sys/class/scsi_host/hosth/scan The older form of this command, echo “scsi add-single-device 0 0 0 0” > /proc/scsi/scsi, is deprecated. SCSI delete single device: echo 1 > /sys/class/scsi_device/h:c:t:l/device/delete The old method echo “scsi remove-single-device h c t l” > /proc/scsi/scsi is depreciated.
Converting RHEL6 to CentOS6
yum clean all mkdir CentOS_downloads cd CentOS_downloads wget http://www.gtlib.gatech.edu/pub/centos/6.4/os/x86_64/Packages/centos-release-6-4.el6.centos.10.x86_64.rpm wget http://www.gtlib.gatech.edu/pub/centos/6.4/os/x86_64/RPM-GPG-KEY-CentOS-6 wget http://www.gtlib.gatech.edu/pub/centos/6.4/os/x86_64/Packages/yum-3.2.29-40.el6.centos.noarch.rpm wget http://www.gtlib.gatech.edu/pub/centos/6.4/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm wget http://www.gtlib.gatech.edu/pub/centos/6.4/os/x86_64/Packages/yum-utils-1.1.30-14.el6.noarch.rpm rpm –root /yourroot/ –import RPM-GPG-KEY-CentOS-6 rpm –root /yourroot/ -e –nodeps redhat-release-server rpm –root /yourroot/ -e yum-rhn-plugin rhn-check rhnsd rhn-setup rhn-setup-gnome rpm –root /yourroot/ -Uvh –force *.rpm yum –installroot=/yourroot/ upgrade
NFS traffic sniff
tshark -R nfs -i eth?
Install Nvidia display driver on Kernel 3.10
When you upgrade your linux kernel to 3.10.x, and try to install the latest Nvidia driver, say 319.17 for Linux-x86_64, it will fail in building the kernel driver with error message in the built log like this: /tmp/selfgz8190/NVIDIA-Linux-x86_64-304.88/kernel/nv-i2c.c: In function ‘nv_i2c_del_adapter’: /tmp/selfgz8190/NVIDIA-Linux-x86_64-304.88/kernel/nv-i2c.c:327:14: error: void value not ignored as it ought to be make[4]: *** [/tmp/selfgz8190/NVIDIA-Linux-x86_64-304.88/kernel/nv-i2c.o] […]
Fedora 19 get back eth0
1) yum remove biosdevname 2) add net.ifnames=0 to GRUB_CMDLINE_LINUX in /etc/default/grub 3) grub2-mkconfig -o /boot/grub2/grub.cfg 4) rename /etc/sysconfig/network-scripts/ifcfg-whatever to ifcfg-eth0 5) change to NAME=eth0 inside ifcfg-eth0 Thanks to Jann5s
Using SSH tunnel to connect VNC server securely
VNC communication is insecure by default. So it is better not open VNC ports directly to internet. Here is a way to put the VNC service behind an SSH tunnel. 1. Suppose you have your VNC service started on a server with terminal number 7. If you open port 5907 to the world, you will […]
Force hard reboot without physically accessing the computer
Sometimes a zombie process might prevent “reboot” “shutdown -r now” from working properly since such soft reboot methods will try to close the zombie processes “normally” and stall on permanent waiting. In this case, instead of approaching the computer and press the power button, there is a way to do so remotely if you still […]
Running Mathematica through cygwin
Mathematica will crash cygwin/X, if certain fonts were not properly installed. Wolfram released a font package that could help this issue out. Here is the download. $ wget http://support.wolfram.com/technotes/MathematicaV7FontsLinux.tar.gz Once you get this file, you may $ tar xvfz MathematicaV7FontsLinux.tar.gz to extract the font files, then $ rsync -av Fonts/ /usr/share/fonts/ to install them. After […]
Using ssh tunnel to port NFS through firewall and private network
network structure: machine1 >> firewall >>>- Internet -> machine2 nfs_server Step 1: on nfs_server, add line in /etc/exports: nfs_dir 127.0.0.1(rw,async,insecur) Also, add line in /etc/sysconfig/nfs MOUNTD_PORT <port_number3 The port_number3 is a large number, for example, 32334, Then do "service nfs restart" This allows the nfs mount point is accessible from the box itself; Step 2: […]