use rdesktop to access windows desktop from CentOS

CentOS comes with rdesktop installed:
run the following command to access your windows desktop:
rdesktop -u user_name -f ip_address
To toggle full screen mode, use
ctrl+alt+enter

Problems and solution


1. While suing this program you may encounter WARNING: Remote desktop does not support colour depth 24; falling back to 16 if your windows system is Windows XP.
To fix the problem go to windows machine:

# go to Start -> Run -> gpedit.msc
# In the Group Policy Editor, navigate to Local Computer Policy -> Computer Configuration -> Administrative Templates -> Windows Components -> Terminal Services, and double-click on the 'Limit maximum Color Depth' object. Set the item to "Enabled" and set "Color Depth" to "24 bit"
2. One other problem you may encounter is: Idle time over and rdesktop closed the connection. To fix this problem:
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\terminal services\MaxIdleTime
It was set to 900,000 mSec. or 15-minutes. I increased the value to 10,800,000 or 3-hours.

Dual Head display on CentOS using ATI Radeon HD 3450

Go to official AMD site to download the official linux driver for this video adapter:
1. install the driver:
$ sudo sh ./ati-driver-installer-x86.x86_64.run 
#Here I choose custom installation and opt out Catalyst Control Center.
2. Configure the driver after installation and enable dual head display
$ sudo aticonfig –initial
# if your second display is at the right of your main display
$ sudo aticonfig --initial=dual-head --screen-layout=right

Disbale SELinux on CentOS

Sometimes you want to disbale SELinux on your CentOS machine, here is how:
[sourcecode language="text"]
Edit /etc/sysconfig/selinux  and change SELINUX=disabled
[/sourcecode]

After you disable SELinux, you need reboot your system to make it take effect.

Diff results explanation

$diff from_file to_file

The results of the command look like:

change-command
< from-file-line
< from-file-line...
---
> to-file-line
> to-file-line…

change-command means if you modify from_file according to this command you will get the same file as to_file.

$ diff /tmp/1.txt /tmp/2.txt
1d0: delete 1.txt line 1
< aaa: content in line 1 of 1.txt
3c2: change line 3 in 1.txt to line 2 in 2.txt
< ccc: content in line 3 of 1.txt
---
> c c: content in line 2 of 2.txt
7a7: add line 7 to 1.txt from line 7 in 2.txt
> hhh

Lines like "1d0" and "3c2" are the coordinates and types of the differences between the two compared files, while lines like "< aaa" and "> hhh" are the differences themselves.

Diff change notation includes 2 numbers and a character between them. Characters tell you what kind of change was discovered:

d – a line was deleted
c – a line was changed
a – a line was added

Install VSFTPD on CentOS Enable local user to log in to their home directory

Install VSFTPD on CentOS, enable L

$ yum install vsftpd

Make necessary configurations for vsftpd

$ vim /etc/vsftpd/vsftpd.conf

There are many configuration options, configure according to your needs.

Disable anonymous FTP

anonymous_enable=NO

Allow local user to log in

local_enable=YES

trap FTP users in their own /home/username directory

chroot_local_user=YES

 

Start the vsftpd service

$ /etc/init.d/vsftpd start

 Turn on vsftpd service on boot

$chkconfig vsftpd on

 

If you can not get access to the FTP server, check the iptables at /etc/sysconfig/iptables to allow whichever port you used for your vsftpd

and restart the iptables /etc/init.d/iptables restart

 

Find and replcae across multiple files in linux

I have been looking a better way to replace certain string in a file accross many folders under one directory and come up with two sultions.

$ find . -name "*.html" -print | xargs sed -i 's/base_site.html/base.html/g'
$ grep -lir "base.html" * | xargs sed -i 's/base.html/base_site.html/g'

The differences are find-- looking for files based on the file names, means it only modifies certain type of file

                                grep-- looking for files based on the content of the file, any files contains "base.html" string will be replaced.

 

Installing HTSeq on CentOS 5.4

Installing lapack, blas and atlas on CentOS 5

1. Installing lapack and atlas on CentOS 5.4 is very simple if you have enabled EPEL and RPMForge on CentOS.

For how to enable this repositories, go to http://wiki.centos.org/AdditionalResources/Repositories

$ sudo yum install atlas.x86_64 lapack.x86_64

2. Install numpy and scipy make sure you use the correct pip tool

$ sudo pip2.7 install numpy

Before installing Scipy do the followings to prevent the failure:

sudo ln -s /usr/lib64/liblapack.so.3.0.3 /usr/lib64/liblapack.so

$ sudo ln –s /usr/lib64/liblapack.so.3.0.3 /usr/lib64/liblapack.so
$ sudo ln –s /usr/lib64/libblas.so.3.0.3 /usr/lib64/libblas.so

then do the installation

$ sudo pip2.7 install scipy

3. Install HTSeq

$ sudo pip2.7 install HTSeq

 Test installation:

$ python2.7
>>>import HTSeq
 

Datatable static image not found on the server

When you use ```datatables.min.css``` and ```datatables.min.js``` locally, instead of datatables CDN, you may have encountered that ```sort...