Showing posts with label Howto. Show all posts
Showing posts with label Howto. Show all posts

Installing Nvdia FX570 drivers on CentOS 5.x

I was trying out an installation on CentOS 5.3 (x86-64) on a workstation which have Nvidia Fx570 card.

The installation of CentOS was very smooth. No hiccups.

  1. I've downloaded the Nvidia Drivers for Linux from Nvidia Site
  2. I did a "# yum install gcc" as Nvidia Drivers need gcc to compile
  3. I run the ./NVIDIA-Linux-x86_64-185.18.29-pkg2.run. But I seems to encounter the "No precompiled kernel interface was found to match your kernel; would you like the installer to attempt to download a kernel interface for your kernel" error
  4. I "yum install kernel-devel" and the error still appear
  5. Finally I run the application with the full kernel source path "./NVIDIA-Linux-x86_64-185.18.29-pkg2.run --kernel-source-path=/usr/src/kernels/2.6.18-128.2.1.el5-x86_64/"
It works.... :)

Using Powertop to save Battery Power (Part 2)

Continuing from the entry Using Powertop to save Battery Power (Part 1)

How do we reinstate the optimised settings for ac-power? I suggest we put the settings that take advantage of AC-Power back into the /etc/acpi/ac.d

# cd /etc/acpi/ac.d # touch 16.optimsation.sh
# chmod 755 16.optimsation.sh
# vim 16-optimisation.sh

#------------------------------------------------------
echo 500 > /proc/sys/vm/dirty_writeback_centisecs
echo 0 > /proc/sys/vm/laptop_mode
hal-disable-polling --device /dev/scd0 --enable-polling
ifconfig eth0 up
iwpriv eth1 set_power 1
#-------------------------------------------------------


For more tips on the settings, do visit the Tip and Tricks session under LessWatts.org

Encrypting VNC Traffic with Putty



Assuming you are using a Windows Clients and you wish to have a Secure Shell Connection to Windows, you have to do the followings:

Step 1: Assuming you have launch the VNC Session at the vncserver Server
$ vncserver

New 'xxx.yourserverdomain.com:2 (root)' desktop is xxx.yourserverdomain.com:2
Starting applications specified in /root/.vnc/xstartupLog file is /root/.vnc/xxx.yourserverdomain.com:2.log

Step 2: Configuration at the SSH Client
  • At Putty Client, Enter the IP of hostname of the VNCServer
  • On the left-hand pane, click Connection > SSH > Tunnels
  • Source Port: 590x (depending on the return port above in step 1)
  • Destination Port: xxx.serverhostname.com:590x (depending on the return port in step 1)
  • Connect to the Server via SSH

Step 3: Use the VNC Client to connect to local VNC Port. On the TightVNC connection,
$ localhost:2

SSH over Nautilus GUI file manager


You can navigate remote file server using Nautilus File Manager via SSH Protocol (sFTP) and FTP Protocol in Gnome

Enter the necessaru information and you will able to see your remote file system on your Nautilus File Manager

Access Windows shares from Linux

To access Windows Shares from your Linux Box, do the following

Step 1: Create a Directory for mounting
# mkdir /mnt/Windows

Step 2: Install smbfs
# yum install smbfs (RH derivatives) OR
# apt-get smbfs

Step 3: Mount the Windows File System
# mount -t cifs //server-ip-addr-or-server-domain-name/share /mnt/Windows -o username=(your windows userid),password=(Your Windows Password),domain=(Your AD Domain)

Step 4: To umount
# umount /mnt/Windows

Using xrandr to change screen resolution and orientation

X RandR is a useful tool to configure display ports, display modes and properties such as orientation, reflection and DPI.

Some simple usage of xrandr
$ xrandr -v (Server reports RandR version 1.3)
$ xrandr -q (query what screens are connected)
$ xrandr -s 1280x800 (screen resolution)
$ xrandr -o inverted (orientation inverted, left, right, normal)

Do note that for xrandr -0 , your screen might freeze after the command, you may want to use xrandr --verbose to check the error.

To extend xrandr to utilise and join 2 monitor together, you may want to look at http://www.thinkwiki.org/wiki/Xorg_RandR_1.2 for more information

Using wget to download entire website

This article is taken from Downloading an Entire Web Site with wget by Linux Journal dated 5th Sept 08. The purpose is for off-line viewing or backup.

Remember that downloading entire website that is not yours is unethical and illegal as well.

# wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--restrict-file-names=windows \
--domains website.org \
--no-parent \
www.mywebsite.org/

The options are:

  • --recursive: download the entire Web site.

  • --domains website.org: don't follow links outside website.org.

  • --no-parent: don't follow links outside the directory tutorials/html/.

  • --page-requisites: get all the elements that compose the page (images, CSS and so on).

  • --html-extension: save files with the .html extension.

  • --convert-links: convert links so that they work locally, off-line.

  • --restrict-file-names=windows: modify filenames so that they will work in Windows as well.

  • --no-clobber: don't overwrite any existing files (used in case the download is interrupted and
    resumed).

Using PowerTop to save Battery Power (Part 1)

I was playing with PowerTop. Powertop is a tool to help you identify applications and programs that uses power even when the computer is idle. According to LessWatts.org, Powertop has these four basic goals:

  • Show how well your system is using the various hardware power-saving features
  • Show you the culprit software components that are preventing optimal usage of your hardware power savings
  • Help Linux developers test their application and achieve optimal behavior
  • Provide you with tuning suggestions to achieve low power consumption

So much for the introduction.
To install powertop, just use
# apt-get install powertop
# yum install powertop
It should be found in most distro.

# powertop
I'm pretty new to the powertop, so I follow the recommendation.
To make some of the recommedendation permanent, I've placed the configuration in the /etc/acpi/battery.d diretory and name is 16-optimisation.sh.

# cd /etc/acpi/battery.d # touch 16.optimsation.sh
# chmod 755 16.optimsation.sh
# vim 16-optimisation.sh

#------------------------------------------------------
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
echo 5 > /proc/sys/vm/laptop_mode
iwpriv eth1 set_power 5

hal-disable-polling --device /dev/scd0
#-------------------------------------------------------

To continue Using PowerTop to save Battery Power (Part 2)

How to setup new Harddisk on LINUX

Here's a quick tutorial on how to setup new harddisk on linux taken from "Adding a Hard Disk in LINUX" by Erik Rodriguez

Step 1: First check after the Harddisk is installed, can it found under /dev/sdb or /dev/sdc. If yes. This means that the new HDD device has been detected

Step 2: Set up the Partition
# fdisk /dev/sdb

Step 2a: Go to Fdisk menu
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Command (m for help):

Step 2b: Print Existing Partition
Command (m for help): p

Disk /dev/sdb: 50.0 GB, 50019202560 bytes
255 heads, 63 sectors/track, 6081 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

Command (m for help):


Step 2c: Create New Partition
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-6081, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-6081, default 6081): 6081

Command (m for help)

Step 2d: Check the the print Partition Specification which we have entered.
Command (m for help): p

Disk /dev/sdb: 50.0 GB, 50019202560 bytes
255 heads, 63 sectors/track, 6081 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 6081 48845601 83 Linux

Command (m for help):

Step 2e: Finalise the Partition
Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

Step 3: Format the Disk
# mkfs -t ext3 /dev/sdb1
mke2fs 1.32 (09-Nov-2002)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
6111232 inodes, 12211400 blocks
610570 blocks (5.00%) reserved for the super user
First data block=0
373 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424

Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 38 mounts or

180 days, whichever comes first. Use tune2fs -c or -i to override.

Step 4: Mount the File System
# mount /dev/sdb1 /home1 (assuming /home1 has been created)

Using rdesktop for access to Windows PC via RDP

One of my most frequently used application is rdesktop. It currently runs on most UNIX and of course with X Windows. With just a command line and including a few essential parameter, you can have access to your Windows PC very efficiently

$ rdesktop -g (Size of the screen) -u (your AD userid) -d (AD Domain) -r disk:desktop=/home/(your linux account)/ -a (colour depth) (PC Name according to Active Directory)

Some notes:

  1. Just a little explanation of the -r parameter. It is to do a mapping between the file system from the linux box to the Remote desktop. This will allow you to transfer file to and from the system

  2. It seems rdesktop can go to maximum colour depth of 16 only. It is sufficient for a clear windows-like view.

  3. If you get this error "ERROR: getaddrinfo: Name of Service not known" It is due to the DNS of your PC not being able to resolve properly. To resolve it quickly, you may want to modify the /etc/resolv.conf to include the required DNS.

Agedu - Combing Files with Agedu

Agedu is a toolkits that help system administrators or users to help identify old files, and hence to delete them. Although like most administrator, we often use
# du -s. But du only tells you what is big and not what's too big

Step 1: To begin with, start getting the source packager from Agedu
# tar -zxvf agedu-rversion.tar.gz
#./configure
#make
#make install

Step 2: Scan the directory you want agedu to catalogue
# ./agedu --scan /directory
#./agedu --web
(A URL: 127.164.xxx.xxx:xxxxx). You can copy and paste the links on the LINUX Web Browser and you have it.

For more information, you can also see Agedu Man Page

Open Source Tools to integrate with MS Active Directory

MS Active Directory is very widely deployed in many industries. To take the pain out of integration with MS Active Directory with your Linux Box, take a look at Likewise Open. Some of the key features are

  1. Joins non-Windows systems to Active Directory domains in a single step from the command line or from a GUI
  2. Authenticates users with a single user name and password on both Windows and non-Windows
  3. Enforces the same password policies for non-Windows users and Windows users
  4. Caches credentials in case your domain controller goes down
  5. Provides single sign-on for SSH and Putty
  6. No schema changes to Active Directory required

Auto SSH Login without Password

The SSH daemon validates SSH client access by Linux system verification via /etc/passwd, or by public/private key cryptography approach.

By using the public/private cryptography approach, we can do a SSH without password.

In my write-up it is for root-to-root connection. You can use it for user connections


Steps 1: At the Host Machine

  1. Logon to the root home directory.
  2. Make sure the hidden .ssh directory has the permission 700. If not execute the command
    chmod 700 .ssh
  3. Change Directory to .ssh directory by executing the command
    cd .ssh
  4. Generate the public-private keys using the ssh-keygen command.
    # ssh-keygen -t rsa 
  5. The resulting file id_rsa and id_rsa.pub rsa type public key
  6. # ssh-copy-id -i ~/.ssh/id_rsa.pub remote-host
    (ssh-copy-id appends the keys to the remote-host’s .ssh/authorized_key)


Step 2: At the Remote Machine, test it out

  1. # ssh remote-host 
    (It should automatically login)
Reading Articles:

Simple Sudo on CentOS Linux (Part 1)

Sudo is generally considered a more secure way of controlling accessing to system commands. By default CentOS does not implement sudo by default


Note 1: To enable your userid to run any commands on CentOS,
# vim /etc/sudoers
youruserid ALL=(ALL) ALL (at /etc/sudoers)
(Youruserid can run any command)
#sudo -s (will prompt you for password before allowing you to have full admin rights)


Note 2: To enable users to use selected commands (at /etc/sudoers)
%users ALL=/sbin/mount/cdrecorder,/sbin/umount/cdrecorder


Note 3: Using the Cmnd_Alias at sudoers file
(Cmnd Alias helps to group a list of related commands)
youruserid ALL=(ALL) PROCESSES
$ sudo -l (Will list all the commands that youruserid have access to)


Note 4: Using User_Alias
User_Alias ADMIN = user1, user2, user3
ADMIN ALL=ALL

How to resolve unpingable host down status in Nagios

After installing nagios, you may face some issues

Some hosts are not able to be ping due to firewall. By default, Nagios use the check_host_alive by default at /etc/nagios/objects/template.cfg. check_host_alive uses ping to check whether the host is alive. So your nagios web admin will see a host down status.

To use another commands to replace the check_host_alive with check_http which is more useful as a "check-alive-status", change it at the /etc/nagios/objects/hosts.cfg file. This will override the default at /etc/nagios/objects/templates.cfg

We assume that check_http is already define in the /etc/nagios/objects/command.cfg

define host{
use windows-server
host_name xxxx
alias xxxx web server
check_command check_http
address xxx.com.sg
contact_groups admin
}

Notes to remembers when Installing Nagios 3.x on CentOS 5

This summary is not available. Please click here to view the post.

How to set mouse to single click in windows 7

Simplify using your mouse by changing double-click to single-click.
How to set mouse to single click in windows 7.

* Open Computer icon on your destops
* Click Tools, and then click Folder Options.
* Click on the General tab, Select "Single-click to open an Item (point to select)" and "Underline icon titles only when i point at them".
* Click on OK.