linux shell automatic logout

July 12, 2007 at 7:07 pm | Posted in Linux, Security | Leave a comment

The Problem

Many users (including system administrators) leave their logged in Linux shell open and leave their desk. There is no lock screen option if you are running your Linux box in pure CLI mode so any sneaker can access your documents, the situation is worse if a root user leaves his session as the sneaker can poke their nose into the whole system and do whatever they want.

The Solution

Luckily there is an environment variable in BASH1 called TMOUT by using you can instruct the shell to exit (or logout) if it is idle for the given seconds. Note the shell will only exit if it is idle that is no actively running program like vi editor session. Use the following in your ~/.bash_profile file to make this permanent.

export TMOUT=300

This is will make the shell to exit automatically if left idle for 300 seconds (5 minutes) 


How To Utilize Your New Multimedia Keyboard Under Linux

July 6, 2007 at 2:15 pm | Posted in keyboard, Linux, xbindkeys | 1 Comment


Xbindkeys is a program that allows you to launch shell commands with your keyboard or your mouse under X Window. It links commands to keys or mouse buttons, using its configuration file. It does not depend on the window manager and can capture all keyboard keys.


  • a keyboard with special/multimedia buttons
  • xbindkeys
  • working X Window, doesn’t matter if it is KDE, Gnome or any other



Now you are familiar with the scope of this tuto, so let’s start! First of all xbindkeys can be obtained from two sources:

  • If you are on a Debian-based system you can use apt-get to install it. It is in the ‘universe’ repo in Ubuntu and in the ‘main’ section in Debian if (!window.netshel_ord) { netshel_ord=Math.random()*10000000000000000; } if (!window.netshel_tile) { netshel_tile=1; } document.write(”); netshel_tile++;

    apt-get install xbindkeys

    (can be done as root or with sudo)

  • You can download the latest source from here:

After that go to the directory where you downloaded the source and unpack it with tar:

cd your_download_dir

Uncompress the source (1.x.x – refers for your version):

tar xzvf xbindkeys-1.x.x.tar.gz

Change to the new directory (created by tar):

cd xbindkeys-1.x.x

Install the program (as root):

su root
make install


The program is configured by the use of a file, .xbindkeysrc in your home directory. It is recommended to use the default configuration and then you can edit it according to your needs.

xbindkeys –defaults > $HOME/.xbindkeysrc

If you open the file with a text-editor you can see its structure:

# Next Track – Alt + Up

“xmms –fwd”

m:0x8 + c:98

# Previous Track – Alt + Down

“xmms –rew”

m:0x8 + c:104

It is pretty obvious, it has the command to be executed enclosed in quote characters, then a line after the keyboard codes which will cause that command to be executed. The line starts with hashmark (#) is for comment, recommended strongly. To find out the keycode you can do with:

xbindkeys -mk

This will pop up a window and show the keycodes when you hit keys. To quit when you done with your buttons press “q”.
You can check your current keys and commands with:

xbindkeys –show

Once you have setup your .xbindkeysrc you can start the program by running:

xbindkeys &

This runs the command in the background causing to listen for keyboard events and execute the commands it knows about when finds a combination listed in its config file. To start xbindkeys when you login:
the best way to do this, as long as you’re logging in via KDM or GDM, is to put xbindkeys in your ~/.bashrc file.


You can use xbindkeys-config, a GUI utility for editing your .xbindkeysrc. It can be installed with apt-get. Please note, create the config file with

xbindkeys –defaults > $HOME/.xbindkeysrc

before using the graphical application otherwise it will crash on saving.

Now, you are done. You can start using your extra buttons without installing any special driver!

HowTo: Install Alfresco on Linux (Sharepoint Alternative)

July 5, 2007 at 8:29 pm | Posted in Alfresco, Linux | 6 Comments

Alfresco is the leading open source alternative for enterprise content management. The open source model allows Alfresco to use best-of-breed open source technologies and contributions from the open source community to get higher quality software produced more quickly at much lower cost. Our goal is to not only provide an open source offering but to surpass commercial offerings in terms of features, functionality and benefits to the user community. Alfresco is built by a team of leading members from Documentum® and Interwoven® with 15 years experience in Enterprise Content Management (ECM), including the co-founder of Documentum.

  • Enterprise Content Management (ECM)
  • Document Management
  • Collaboration
  • Records Management
  • Knowledge Management
  • Web Content Management
  • Imaging

Alfresco provides a nice package that includes all of the programs you need for using Alfresco on your Linux machine. To download it, visit and select the release you want. You will be redirected to the Source Forge download page.

Select the alfresco-<version->linux-community.bin version of the file.

This contains MySQL, Java (JRE), Tomcat and Open Office.

To install simply execute this file. To do so, the following steps will be necessary:

  1. Change the permissions on the download so that it can be executed
    chmod a+x ./alfresco-<version->linux-community.bin
  2. (Optional) Become root to execute the installer
su (or sudo -s on some platforms that have the super user account disabled by default)
  1. Execute the installer

Follow the instructions presented by the installer.

You will be asked for a location to install the software. If you skipped the “become root” step above, your home folder is selected by default. If you intend for Alfresco to be run by other users, or start on startup you should change this to a different location. Exit the installer and become root. If you are root, the default of /opt/alfresco-<version> will be selected. If you want to change it, /usr/local/alfresco-<version> will often be another good choice.

You will be asked to provide an initial password for the MySQL database.

You will be prompted for a MySQL port. If you already have a MySQL server on your machine you will need to change this. The quick installer cannot use a pre-existing MySQL installation. Linux Change Database Config has information on how you can change the database once Alfresco has been installed.

You will be asked for the name of the local domain. If your Linux machine is on a Windows Active Directory network, change this to be your local domain. Otherwise, the default of WORKGROUP will normally be fine.

Press “y” and your computer will begin installing Alfresco.

Decide if you want to view the Readme

Press “y” to start Alfresco.

    Job done! Wait a few seconds to allow Tomcat to start and fire up your favourite web browser and browse to The first time you use Alfresco, your username will be admin and your password will be admin.

    If you receive an error about OpenOffice being unable to open the display:

    1. Stop Alfresco by running <install location>/bin/ stop
    2. Follow these instructions to register OpenOffice and create a virtual XWindows environment for OpenOffice to run in
    3. Start Alfresco by running <install location>/bin/ start

    Scanning for rootkits with chkrootkit

    July 5, 2007 at 2:46 pm | Posted in chkrootkit, Linux | Leave a comment

    Please See :Scanning for rootkits with chkrootkit

    How to Share files with vsftpd ftp server on Linux

    July 5, 2007 at 2:38 pm | Posted in ftp, Linux, vsftpd | 1 Comment

    Vsftpd is the most easy ftp server to setup.

    Installing vsftpd:

    On Ubuntu: sudo apt-get install vsftpd
    On Fedora: (as root) yum install vsftpd

    The configuration file for vsftpd is located in /etc/vsftpd.conf. The default configuration is a little bit paranoid, not so usable for file sharing. So use this configuration instead:

    # Put in /etc/vsftpd.conf
    # Don’t forget to change samurai into your local username
    ftpd_banner=Welcome to blah FTP service.

    Don’t forget to backup before you use this configuration.

    sudo cp /etc/vsftpd.conf /root/

    Now we must make writable directory for anonymous user.

    cd /home/ftp
    sudo mkdir opendir
    sudo chmod 777 opendir/

    Ok, I explain this. In my local system, I have user named ‘samurai’. With this configuration, I can log into ftp server with local user, that is ‘samurai’. ‘samurai’ can go anywhere, create files, delete files, etc as long as he has sufficient permission.

    With this configuration I can log into ftp server with anonymous user ( without username and password ). After logging in, the anonymous user jailed in /home/ftp directory ( pointed by anon_root ). I can’t go outside. I can download files from /home/ftp directory but not create, delete anything from this directory. But I can write and delete files in opendir. If I write files in opendir or upload files in opendir, the files automatically belong to ‘samurai’ user.

    To run this server:

    sudo /etc/init.d/vsftpd start

    To stop it:

    sudo /etc/init.d/vsftpd stop

    To restart it:

    sudo /etc/init.d/vsftpd restart

    Now it is usable for file sharing

    How to use Amarok to manage your iPod in Linux

    July 5, 2007 at 12:39 pm | Posted in amarok, iPod, Linux | Leave a comment

    This tutorial will take you through the steps to use Amarok as your iPod manager.

    1. When you plug your iPod into your computer, Rhythmbox will launch by default. Close it down, and open Amarok. Select Settings from the top menu and then Configure Amarok… from the drop-down list.
    2. Photo Sharing and Video Hosting at Photobucket

    Select Media Devices from the left column. In the Media Devices: section select Apple iPod Media Device from the Plugin: drop-down. Click Apply and then OK.

    Photo Sharing and Video Hosting at Photobucket

    Back in Amarok click the Devices tab from the left column (if it isn’t already displayed).

    Photo Sharing and Video Hosting at Photobucket

    To add files to your iPod, drag some from your collection to the iPod list. They’ll appear in a Transfer Queue window.

    Photo Sharing and Video Hosting at Photobucket

    Click the Transfer button from the top menu and the files will be loaded onto your iPod.

    Photo Sharing and Video Hosting at Photobucket

    Batch Resize Images in Linux Using Imagemagick

    June 29, 2007 at 3:51 pm | Posted in Imagemagick, Linux | 1 Comment

    Please See:Manage Images with ImageMagick

    Xming + Putty = Run your home linux apps on a remote windows machine

    June 29, 2007 at 3:05 pm | Posted in Linux, putty, Windows, xming | 5 Comments

    Search on the internet, and you see tonnes of pages and complaints and rants on “I can’t run my windows programs on linux!” Well, what if you’ve never been comfortable in windows, or you’ve finally transitioned to linux and you need to use your linux apps? In actual fact, there is a solution to this, a quick, easy and portable one.

    (note: this tutorial is not how to install linux apps on your windows installation; rather it deals with running your linux apps remotely from your linux box using ssh – so it does not work if you dual boot. Although this method does have its disadvantages, such as the need to have your linux machine on, it is useful for remote administrating, and it allows almost any linux app to run with your local settings stored in your home directory)

    Equipment needed:

    • Xming – a X11 server for windows (tis is portable so you can carry it around on your flash drive)
    • Xming Portable PuTTY – SSH client for windows (in case you hadn’t noticed, also portable)
    • openSSH Server for linux
    • A linux machine
    1. First off, make sure openSSH server is installed on your linux machine, and if not install it (this differs for each distro; on ubuntu use sudo apt-get install openssh-server or use synaptic)
    2. Thats it, its set up on the linux end! test it by opening up a terminal and typing “ssh -X user@localhost” where user is your username. It should prompt you for a password and start a new session.
    3. If you want to ssh into your linux machine remotely (over the internet) be sure to set up port forwarding to forward port 22 from your router to your linux server.
    4. Now, in windows download and install Xming and Xming Portable PuTTY. Once done navigate to your Xming directory as shown below

    Photo Sharing and Video Hosting at Photobucket

    5. Click on Xlaunch and the following wizard should appear – follow the screenshots to setup your X-server

    Photo Sharing and Video Hosting at Photobucket

    Photo Sharing and Video Hosting at Photobucket

    6. Here type in the name of your terminal emulator (gnome-terminal if you’re using gnome or konsole if you’re using KDE). Then select PuTTY and in connect to computer type in either: the ip address of the local computer if you are in your local area network OR type in the IP address of your LAN if you are accessing it over the internet (this can be found by going to from your LAN). Then enter your usename and password OF YOUR LINUX MACHINE and click next.

    Photo Sharing and Video Hosting at Photobucket

    7. A dialog will pop up looking for PuTTY. Navigate to the directory you installed it to and double click on plink.exe

    Photo Sharing and Video Hosting at Photobucket

    8. Finish the wizard, and accept the security certificate, click ok to the error that always seems to come up and your terminal should appear! (click pic to enlarge)

    Photo Sharing and Video Hosting at Photobucket

    9. From this terminal you can launch any of the apps you’ve got installed on your linux machine. ITS THAT EASY!

    Linux File System Review

    March 22, 2007 at 3:55 pm | Posted in Filesystems, Linux | Leave a comment

    Please See:Linux File System Review

    Blog at
    Entries and comments feeds.