How To View CHM Files In Linux?


If you are a book worm then defiantly you will know what is a CHM file?
For those who don't know the CHM files let me explain it.
CHM file is a compiled HTML files/document(s) in to a e-book kind so that we can view and index easily. This formate is the proprietary of Microsoft and by default the application to view CHM files in windows is installed.

So what about viewing the files in Linux?
We have to install
CHM file viewer. There are so many applications to achieve this such as


* gnochm
* CHMsee
* FBReader


* Okular
* kchmviewer
* Kchm
* chmcreator


* xCHM
* Archmage
* DisplayCHM
* CHM Reader Firefox addon

In this post I will show you how to install
gnochm application to view CHM files.

Installing gnochm in Redhat
#rpm -ivh libchm1.0.40-1.i386.rpm
#rpm -ivh python-chm.0.8.4-1.i386.rpm
#rpm -ivh 0.9.11-2.i386.rpm

Installing gnochm in Ubuntu
#apt-get install gnochm

Please comment regarding this post:-)

  • Like the post? Please Subscribe to free RSS feed to get updates
  • Configuration of SQUID Reverse Proxy


    Recently my boss assigned me to work on SQUID reverse proxy. I thought it’s an easy task and started working on it. But when days started going on, I realised that it’s not going to happen in a night. And at last I found the solution some two days back. This post is about How to implement SQUID as a reverse proxy? If you want to know more about for what purpose we require reverse proxy and which reverse proxy is good please refer my other post here.

    Before Installing and configuring SQUID as reverse proxy I just want to add the below point(s).
    1. Don’t install SQUID from package installations such as rpm in Redhat and apt-get/deb in Debain.
    2. Download the source package from squid official site, then compile it and install it according to your needs.
    3. In order to SQUID run perfectly please change the ownership of the installation folder to squid.
    4. By default SQUID will not create cache directory in the installation directory, so we have to create it manually with ownership as squid user and we have to execute squid –z in order to SQUID work properly which will create.

    Don’t worry about all these points. I will explain these points once we start configuring SQUID.

    Prerequired packages:
    1)gcc compiler

    So let’s start how to implement SQUID on RHEL5/CENTOS5

    Step1 : Remove any squid package if it’s installed by default through rpm/deb packages.
    #rpm e squid

    Step2 : Download latest SQUID package from SQUID official site to some temp directory
    #mkdir /temp
    #cd /temp

    Step3 : Uncompress the downloaded tar.gz package.
    #tar xvfz squid-2.6.STABLE23.tar.gz

    Step4 : Prepare the uncompressed package for installation. If you are new to installing source package have a look in to this post.
    #cd squid-2.6.STABLE23
    #./configure --prefix=/opt/squid --enable-ssl --disable-internal-dns --with-openssl

    Let me explain the options used for the compilation.
    a. --prefix=/opt/squid This option tells that install all the squid related files in /opt/squid, if you don’t specify this option by default squid will be installed in /usr.

    b. --enable-ssl this option is used for supporting SSL in squid server.

    c.--disable-internal-dns most confusing option of all, this will tell squid to use its own internal DNS server which will take inputs from /etc/hosts file, it will block squid to use /etc/resovl.conf for name resolution.

    d. --with-openssl will enable openSSL properties on squid

    Step5 : Install the SQIUD package now.
    #make check
    #make install

    Step6: Once compiled properly Create squid user(A normal user) if the squid user is not there

    #useradd squid

    Step7: Specify the effective user entry in squid.conf file with squid as username by editing it.

    #vi /opt/squid/etc/squid.conf
    change the entry from
    # cache_effective_user nouser


    cache_effective_user squid

    Save the file and exit now

    Step8: Now change the owner ship of the cache folder to squid user

    #chown -R squid.squid /opt/squid/var/cache

    Step9 : Once installed successfully we have to create cache folder/swap folder in /opt/squid/var/log/cache/
    #/opt/squid/sbin/squid z

    Step10 : Configuration Squid

    Step(10a) : Open the squid.conf file and specify the http_port entry, just search for http_port in squid.conf and specify as said below.

    Note : It’s a good practice in admin activity to take backup of any file before modifying it, so just copy the squid.conf to a safe location and then edit the squid.conf in /opt/squid/etc/
    #vi /opt/squid/etc/squid.conf
    http_port accel vhost

    Let me explain above line
    http_port is the option where you can specify on which port your squid server will listen for incoming requests. is the ip address of the squid machine. This should be a public ip address.
    :80 is the port where the squid listen.
    accel vhost is accelerator mode using Host header for virtual domain support. Implies accel.

    Step(10b) : Specify backend server details as follows
    cache_peer parent 80 0 no-query originserver name=server_1 login=PASS
    acl sites_server_1 dstdomain
    cache_peer_access server_1 allow sites_server_1
    Let me explain what actually the above three lines meant for.
    First line specifies cache_peer is the option used to specify the backend server ip address(
    back end webserver port(80) then just say to squid server, from where the quiery is originating.(originservername=server_1)
    type of access(login=pass is used to specify how to access squid server from backend)

    Second line specifies acl(access control list for the backend server here in this case it is

    Third line specifies allowing of this backend server(sites_server_1) to squid server(server_1).

    Note : Make a note that above 3 lines for giving access to cache purpose, still we did not give http access for this site.

    Step(10c) : Giving http access to backend site
    acl http_accl_host1 dst
    http_access allow http_accl_host1
    The above two acl’s are used to specify backend server and its self explanatory.

    Step11 : Check any syntax errors are there in the squid config file by using following command
    #/opt/squid/sbin/squid -k check
    #/opt/squid/sbin/squid -k parse

    If your system didn’t throw any error then proceed to next step, otherwise please try to debug or write a comment on this will respond to you people.

    Step12 : Now Create the cache and swap related entries
    #mkdir /opt/squid/var/logs/cache
    #/opt/squid/sbin/squid z
    Just a clipped output for the reference…
    #[root@ser1 ~]# /opt/squid/sbin/squid -z
    2009/12/28 19:27:57| Creating Swap Directories
    [root@ser1 ~]# tail -f /opt/squid/
    bin/ etc/ libexec/ sbin/ share/ var/
    [root@ser1 ~]# tail -f /opt/squid/var/logs/cache.log
    Memory usage for squid via mallinfo():
    Total space in arena : 2516 KB
    Ordinary blocks : 2454 KB 11 blks
    Small blocks : 0 KB 6 blks
    Holding blocks : 236 KB 1 blks
    Free Small blocks : 0 KB
    Free Ordinary blocks : 61 KB
    Total in use : 2690 KB 98%
    Total free : 61 KB 2%
    2009/12/28 15:12:16| Squid Cache (Version 2.6.STABLE23): Exiting normally.

    Step13 : Working on DNS related stuff.

    Step(13a) : Specify the backend servers related info in /etc/hosts file10.88.26.12 web425.

    Step(13b) : Please remove the /etc/resolve.conf file entries if any, to disable dns queries to DNS server.
    The below step is important step in configuring revers proxy.

    Step(13c ) : Please specify the entries for the backend servers in your DNS servers. So that if any one accessing from outside of your network they should be redirected to your reverse proxy server which will serve you the backend web content.
    So in DNS entry should be redirected to your reverse proxy server IP address.

    Step14 : Change the ownership permissions of /opt/squid to squid user
    #chown squid:squid –R /opt/squid

    Step15 : Starting Squid reverse proxy
    #/opt/squid/sbin/squid –D
    -D is the option to disable external DNS server entries.

    Please follow for other related topics such as troubleshooting reverse proxy server in my next posts:-)

  • Like the post? Please Subscribe to free RSS feed to get updates
  • How To View PDF Files/Documents In Linux?


    When i started using Linux. Big question was in my mind is whether i can view PDF(Portable Document Format) files or not? but as Linux prove to be "get your work done in many ways". a classic example is PDF viewers in Linux.

    Its very much easy to install PDF viewer
    You can install either
    For Red-hat flavours

    rpm -ivh xpdf-ver.i386.rpm

    For Ubuntu
    apt-get install xpdf


    For Redhat flavors
    rpm -ivh kpdf.ver.i386.rpm

    For Ubuntu
    apt-get install kpdf


    For Redhat/Ubuntu flavors
    Download Acrobat Reader from the above link and install

    Enjoy reading PDF documents. If you are having any issues in installing the packages please feel free to comment.

  • Like the post? Please Subscribe to free RSS feed to get updates
  • Contribute To With Hacks/Tutorials/Tips Etc.



    Howtos/tips/configurations/hacks/Tutorials etc

    Do you like Have written a tutorial and would you like to share it with others, you can publish it on Register your self by sending a mail to about your interest. We will contact you back.

    Help Us To Serve You Better...!

    Do and don't :

    • Please do not submit copy righted content(You must either be the author of the material or have the original author's consent to publish it).
    • Please don't submit incomplete tutorials - we can publish only finished tutorials and you can take help from us if you struck with some where.
    • You can submit even small topics too, for quantity does not matter. Only quality matters.
    • If you are good at grammer/vocabalory and saw any mistakes in you are always welcome to mail
    Note : Please note that it will take some time for us in-order to publish your Tutorials on our site. For immidiate responce please mail to

    Important : It is possible that we have some other tutorials in the queue, so it will take a few days for us to publish your tutorial, so please be patient. But we will publish it :-)

  • Like the post? Please Subscribe to free RSS feed to get updates
  • Access Linux From Windows Through Virtual Network Computing(VNC)


    VNC(Virtual Network Computing) is an open source utility to access any remote host through GUI. In this post we will see how to login to Linux server from a windows machine.

    Step1 : Install VNCserver on Linux machine
    #rpm –ivh vnc-server-4.1.2-9.el5.i386.rpm

    Step2 : Start VNC server now
    #service vncserver restart

    Note and this is very important :
    Now it will ask for a password to access the Linux server through VNC viewer and this password is for root user to login from any machine through VNC.
    2. If you want to access GUI for a particular user, first login to that user account and execute vncserver command. When you execute this command in the user login it will ask for a password, and this password is for the user to login from remote host through VNC to the Linux server.
    3. For security reasons please give different password for accessing Linux through VNC other than your password to login to the Linux machine. If you remember and understand these points your goal is almost completed.

    Step3 : Make sure that your Linux server is running in run level 5/GUI. Any of the below command will start your GUI service in Linux.
    #init 5

    Step4 : By default Linux will not allow login to GUI. We have to configure VNC server to allow user to login through GUI. For configuration VNC server edit ~/.vnc/xstartup file
    #vi ~/.vnc/xstartup
    Uncomment these below two lines in the file, then save and exit the file.
    exec /etc/X11/xinit/xinitrc

    Step5 : Now once again start the vncserver( just execute vncserver command) in user account, so that it will continuously on. When you execute the command it will provide valuable information how to access the server. The clipped output is as follows, here if you see its saying to access the GUI you have to give hostname as
    [kumar@rp2 ~]$ vncserver
    New ' (kumar)' desktop is
    Starting applications specified in /home/kumar/.vnc/xstartup
    Log file is /home/kumar/.vnc/

    Step6 : Now login to Windows machine where VNC viewer is installed and try to access the Linux server.

    Some FAQ :
    1.What is the port no for VNC server?
    Ans :

    2.Which are the other tools which will work same as VNC?
    Ans :
    VNC, TS, Citrix, Reflection etc.

    3.What is the significance of rdesktop?
    Ans : Rdesktop is an utility to access windows machines from Linux.

    Please comment regarding this post:-)

  • Like the post? Please Subscribe to free RSS feed to get updates
  • Google's Browser For Linux And MAC World Relesed


    Hello every one...! Google released its browser for Linux and MAC world officially. There is an unofficial build which most of the Linux geeks using till this point. Now its officially build from Google with a rotine beta tag. Though Google (many)servers run on linux, Google have showed less intrest to linux based applications(For example there is no gtalk client for linux till this point officially). May be this is because of user base and market too. Google taken nearly 1.2years to develop a Linux based browser after Google chrome browser for windows announced in 2 September 2008.

    There are many featuers in this browser though it is a beta release.

    1.Extentions(Are some kind of add-ons with which we can add our favorite utilites to the browser).
    2.Theams(We can chage the look of the browser).
    3.A task manager(Google chrome considers each tab as an individual application, so if one tab crashes it will not affect other, we can kill that tab by using this task manager).
    4.Efficiently utilization of empty tab by keeping nine most visited sites, so its easy to access that sites when we open a new tab.

    And many more improvements to come. I will update this post with new findings.
    Installing a RPM package

    1.Download it as RPMS (For Redhat, Centos etc)
    a.Install the rpm package
    rpm --ivh packagename.ver.arch.rpm
    Installing DEB package
    Download it as DEB (for Debina, Ubuntu)
    2.Install deb package
    sudo dpkg -i package.deb

    Please Comment your thoughts regarding this post:-)

  • Like the post? Please Subscribe to free RSS feed to get updates
  • IPTables In Linux Explained


    IPtables (Netfilter) :
    is the default firewall for Linux. Its a vast subject which can not be covered in one post. I will try to give as much info as possible at the same time not to make it complex. Lets start with basics.

    What is a firewall?
    Ans :
    A firewall is a part of a computer system or network that is designed to block unauthorized access while permitting authorized communications
    A IPtables firewall contains tables which in tern contains rules to block or unblock a
    perticular communication.

    A table can be a
    1.Filter table -- Used to filter packets.
    2.NAT(Network Adress Translator) table -- Used for NATing of source and destination ip address(Used for sharing internet)
    3.Mangale table -- Its a combination of Filter and NAT tables

    4.RAW table -- Used to for marking packets not to track.

    1.Filter table :
    This is the default table which contaions three chains.
    a.INPUT Chain : To apply a rule on packets which are coming into the system.
    b.FORWARD Chain :
    For packets being routed through the system
    c.OUTPUT Chain :
    For packets locally generated which are going out from the system.

    2.NAT table :
    This table is having three chains.
    a.PREROUTING Chain : For altering the packets as soon as they come in to the system

    b.OUTPUT Chain :
    For packets locally generated which are going out from the system.
    c.POSTROUTING Chain : For altering the packets which are about to go out from the system.

    3.MANGLE Table : This is a combination of forwording, security and translating packets. We can say this one as hybride table of both FILTER and NAT table. This contains five chains.

    4.RAW Table : Contaions two chains.

    So lets go to the configuration of IPTables : In the following examples I will be taking FILTER Table to explain.

    Example1 : To see/list what are the rules configured in the system
    #iptables -L -t filter
    This will list all the rules which are created under FILTER Table
    -L for
    for specifying table type(here table type is FILTER)
    #iptables -L -t nat
    #iptables -L -t mangle
    #iptables -L -t raw
    These three iptables are self explantory.

    Example2 : Inserting a rule in to a table
    #iptables -I INPUT 2 -t filter -s -j DROP

    -I for inserting a rule in to a table, so in this example I am inserting an INPUT rule and position two(2). So depending on number we can insert a rule in any position of a table.
    -s for specifying the source of this packet. This source may be a IP adress/netmaks or a network-adress/netmask. -j for specifying what to do on the target packet. Here we specified to drop any packet which comes from, so there is no reply to the source about the packet status. With -j these are the options we can specify.

    1.DROP -- For droping a packet with out informing the status of this packets to the source/destination. So there is no inforamtion to source/destination about the status of the packet.
    2.REJECT -- Will reject the packets and information is sent to source/destantion about the rejection of packet by the server.
    3.ACCEPT -- Will accpet for the delevery of the packet to designated destination.
    4.QUEUE -- this is used to queue the packets to user space. Let me put in this way.. this is just to forward all the packets to some other utility(such as SNORT) which take care of packet filtering.

    What actually this rule is specifying?
    Ans :
    This rule specifies its an input rule at second position of the filter table to drop all the communication which is originating from

    Example3 : To append a rule in to a table
    #iptables -A INPUT -t filter -d -j REJECT
    for append a rule at the end of a table
    -d for specifying the destination of this packet. This destination may be a
    IP adress/netmaks or a network-adress/netmask.

    What actually this rule is specifing?
    Ans :
    This rule specifies its an input rule which is appended to a filter table to reject all the packets which are destinated to network.

    Example4 : Deleting perticular rule
    #iptables -D INPUT 3 -t filter
    for specifing deletion of a rule

    What actually this rule is specifing?
    Ans :
    This rule specifies delete an input rule which is in third position of the filter table.

    Example5 : Flushing/removeing entire table
    #iptables -F -t filter
    -F for specifing to flush/remove a table from iptables configuration.

    What actually this rule is specifing?
    Ans :
    This rule specifies flush/remove all the rules which are in filter table.

    From here we will see how to block a
    1.Blocking network
    2.Blocking an ip address

    3.Blockign Entire protocal stack
    4.Blocking protocol
    5.Blocking port(source port or Destination port)

    Example6 : Blocking(Rejecting) a perticular network
    #iptables -A INPUT -t filter -s -j REJECT

    What actually this rule do?
    Ans :
    This rule specifies under filter table please block(REJECT) all traffic from to ip addresses, nothing but entire network.

    Example7 : Blocking(Rejecting) a
    perticular ip address
    #iptables -A INPUT -t filter -s -j REJECT

    What acutally this rule do?
    Ans :
    This rule specifies under filter table please block(REJECT) all the traffic originating from ip address.

    Example8 : Blocking(Rejecting) entire protocol stack.
    #iptables -A INPUt -t filter -s -p all -j REJECT

    What acutally this rule do?
    Ans :
    This rule specifies under filter table please block all the traffic with all the protocols(such as TCP,UDP,ICMP etc) which are origenating from ip address.

    Example9 : Blocking a
    perticular protocol
    #iptables -A INPUT -t filter -s -p tcp -j REJECT

    What acutally this rule do?
    Ans :
    This rule specifies under filter table please block all the traffic which uses tcp protocol to communicate from ip address.

    Example10 :
    Blocking perticular
    destination port
    #iptables -A INPUT -t filter -s -p tcp -dport 21 -s -j REJECT

    What acutally this rule do?
    Ans :
    This rule specifies under filter table please block all the FTP(port no:21) traffic orignating from ip address.

    Example11 : Blocking perticular
    source port
    #iptables -A OUTPUT -t filter -d -p udp -sport 1929 -j REJECT

    What acutally this rule do?
    Ans :
    This rule specifies under filter table please block all the traffic which is origanting from server through port 1929 destinated to to be blocked.

    Saving iptable :
    #service iptables save

    Why we actually require to save iptables?
    Ans :
    Most of the services in linux have their own configuration files so same will be applicable for the iptables. So when ever we do iptables save the configuration by default will be saved to

    6.Satrting iptables :
    #service iptables start

    Restarting iptables :
    #service iptables restart

    Checking wether iptables is running or not
    #service iptables status

    Please comment your thoughts regarding this post:-)

  • Like the post? Please Subscribe to free RSS feed to get updates
  • Job Portal On --


    Some days back I faced a strange situation.. which i felt depressed and bad. I have a word with one of the Orkut user who is in search of the jobs.. He scraped me "if any openings please inform me.." I got little bit angry and with out second though I given him a bad reply.. Then he replied me saying that i have said in some Orkut forums that "please ping me if you are in need of a job". So today I decided to start a Small Linux job portal kind of thing.. I will be just pasting the details of Linux admin jobs which ever come to me.. Lets see how much it will be helpful to others.. Please support me in this by informing me any job openings on Linux, unix,network administration, tech-support,penetration testing,security and scripting what ever you think its related to Administration/security, so that I can post it on I know this is big task, But every journey will start with a single step.. So this is my first step towards helping others who have same interests like me.

    Please mail to this, if you have any recruitment in your company or if you come across any jobs on Linux administration. You can even participate in this to help others.

    Contribute to the site by mailing to us about the new openings:


    Login to the site for updated jobs details:

    To get job details on to your feed reader

    Want SMS alerts on new jobs?
    just register here in this link, you will get SMS alerts on your mobiles..

    Surendra & Meghana.

    Please comment your thoughts regarding this initiative.

  • Like the post? Please Subscribe to free RSS feed to get updates
  • BASH_History_Capabalities


    Though this is a basic topic known to many of you, But I want to share so that some one will get new things.
    BASH(Broune Again Shell) is the default shell in Linux, which will act as a communicator between Kernel and user. Its having so many capabilities such as

    a.Short cuts
    b.Command chaining


    As I mention we will see all about BASH shell history capabilities here. And I have divided this BASH capabilities in to three parts like basics, medium and advanced.

    Basic capabilities of BASH History:
    To see all the commands what we executed previously

    2.To check the history size of your system
    #echo $HISTSIZE

    3.To check where is your history file, which stores all your previous commands
    #echo $HISTFILE

    4.To browse history.
    Just press up/down arrow to browse history

    5.To see all the commands which have particular word
    #history  | grep string

    #history | grep cd

    Medium capabilities of Bash history:
    Some times browsing history is very tedious job and some times we are executing some big big commands so there is a capability in Bash to over come this ie search-i-reverse. For doing this press ctrl+r and type a string in previous command which you want to execute.

    Lets see it with an example
    root@krishna-laptop:~#(reverse-i-search)`se': service winbind restart
    if you see above I just pressed ctrl+r and then started to type se, it is showing service winbind restart command, so I no need to type entire command and I have to justent press enter

    root@krishna-laptop:~# service winbind restart
    * Stopping the Winbind daemon winbind [ OK ]
    * Starting the Winbind daemon winbind [ OK ]

    7.Changing the size of history. Most of the Linux machines by default it can store up to 500 previously executed commands. Some people likes to change it to some value, here i want to keep my previously executed 3000 commands.
    #HISTSIZE=3000 execute previous command

    9.To execute 25 command in bash history

    10.To execute a recent command which start with a string

    11.To clear all the history

    #history –c

    12.In Linux when we execute some command there will be no output of the command, for example useradd or mount -a commands will not give you output saying that command is executed successfully or not at that time we can used the below command to see whether the previous command is executed successfully or not
    #echo $?
    If the out put of the above command is "0", that indicates previous command executed successfully, for any other values the command is not executed successfully(total there are 256 values, 0-255).

    Advanced capabilities of Bash history:
    History Modifiersreferences:

    Please comment your thoughts regarding this post:-)

  • Like the post? Please Subscribe to free RSS feed to get updates
  • Archive

    Translate this page


    The Linux Juggernaut | Copyright 2006-2009 Surendra Kumar Anne | Surendra's Home Page | Give us feedback how we are doing, Click here