linux poison RSS
linux poison Email

Quick and dirty configuration of NFS

NFS Consists of the following:

/etc/exports –> /etc/exports contains all the NFS shares

/usr/sbin/exportfs -r
#exportfs -r is used to synchronize nfsd in memory with the /etc/exports file
#Use exportfs -v to see which shares nfsd is currently exporting

/etc/rc.d/init.d/nfslock - which has 2 parts

/etc/rc.d/init.d/nfs - which has 3 parts

At bare minimum you need to have portmap (or portmapper), mountd (or rpc.mountd), and nfsd (or rpc.nfsd) running; otherwise NFS isn’t running.

#Sample nfs /etc/exports file:
/home/ftp/pub (ro,insecure,all_squash)
/home/ftp/pub adminsvr(rw,insecure,all_squash)

#Above we have two entries, one for everyone, and one
for the adminsvr machine.
Read more

What is Segmentation fault

One of the most common problems when making software is errors like “Segmentation fault“, also called SegFault. Here is what a SegFault is.

Virtual memory in a computer can be created in 2 ways: pages or segments. Paging means that the memory is divided in pages of equal size, containing words of memory in it. Segmentation means that every process has a segment of memory of needed size, with gaps of empty memory blocks between the segments.

The operating system knows the upper limit of every segment, and every segment begins at a virtual address. When a program accesses a memory block, it calls a virtual address that the Memory Management Unit (MMU) maps to a real address. If the operating system sees that the requested address doesn’t match any valid address in the segment, it will send a signal to the process terminating it. SegFaults are the direct result of a memory error. The program has a bad pointer, a memory leak or any kind of error that makes it access the wrong memory address.
Read more

Allow normal users to mount drives

By default, Linux does not allow users to mount drives. Only root can do this

With a special command in the /etc/fstab file, you can change that. This is a typical line for the /dev/hda2 drive in /etc/fstab:

/dev/hda2 /mnt ext3 noauto,user 1 1

The keyword user allows any user to mount the drive into /mnt.
Read more

USB Modem Configuration

Follow the steps mentioned below to configure internet connection using USB modem

1) Insert your usb modem and observe your /var/log/messages log file, you should see something like

Dec 11 16:44:56 poison kernel: ohci_hcd 0000:00:13.0: wakeup
Dec 11 16:44:56 poison kernel: usb 1-3: new full speed USB device using ohci_hcd and address 2
Dec 11 16:44:56 poison kernel: usb 1-3: new device found, idVendor=1004, idProduct=6000
Dec 11 16:44:56 poison kernel: usb 1-3: new device strings: Mfr=1, Product=2, SerialNumber=3
Dec 11 16:44:56 poison kernel: usb 1-3: Product: Qualcomm CDMA Technologies MSM
Dec 11 16:44:56 poison kernel: usb 1-3: Manufacturer: LG CDMA USB Modem
Dec 11 16:44:56 poison kernel: usb 1-3: SerialNumber: Serial Number
Dec 11 16:44:56 poison kernel: usb 1-3: configuration #1 chosen from 1 choice
Dec 11 16:44:57 poison kernel: cdc_acm 1-3:1.0: ttyACM0: USB ACM device
Dec 11 16:44:57 poison kernel: usbcore: registered new driver cdc_acm
Dec 11 16:44:57 poison kernel: drivers/usb/class/cdc-acm.c: v0.25:USB Abstract Control Model driver for USB modems and ISDN adapters

Here we are interested in knowing the port on which modem is connected, which is ttyACM0

2) Copy and past the following lines into your /etc/wvdial.conf

[Dialer Defaults]
Modem = /dev/ttyACM0
Baud = 57600
Init1 = AT+CRM=1
Phone = 777
Username = internet
Password = internet
Stupid Mode = 1
Compuserve = 0
Idle Seconds = 30

3) Run the following command to update any missing parameter in /etc/wvdial.conf file

poison:/etc # wvdialconf update

4) Run the following command to start the internet connection

poison:/etc # wvdial

I have tested this on Ferdora and Suse Linux and I believe that it should also work for you all.
Read more

HowTO- Round Robin DNS

In this case we will take an example of a webservers

To use round robin, each web server must have its own public IP address. A common scenario is to use network address translation and port forwarding at the firewall to assign each web server a public IP address while internally using a private address.

This example from the DNS zone definition for assigns the same name to each of the three web servers, but uses different IP addresses for each:

; Domain database for
; IN SOA (
2006032801 ; serial
10800 ; refresh
3600 ; retry
86400 ; expire
86400 ; default_ttl
; Name servers
; Web servers
; (private IPs shown, but public IPs are required)
www IN A
www IN A
www IN A

When DNS gets a request to resolve the name, it will return one IP address, then a different address for the next request and so on. Theoretically, each web server will get one third of the web traffic. Due to DNS caching and because some requests may use more resources that others, the load will not be shared equally. However, over time it will come close.

This is a very good example of Load balancing using DNS server (Round Robin)
Read more

UNIX history in form of picture

Read more

HowTo Identify your Modem chipset

# Download

# gunzip -c scanModem.gz > scanModem
# chmod +x scanModem
# cp scanModem /usr/bin/To identify Modem chipset
# scanModem# gedit Modem/ModemData.txt

Read more

Quick Log server configuration

On remote server: edit /etc/sysconfig/syslog on the server and set

The -r option allows remote machine to log to syslog.
On the client machine, edit /etc/syslog.conf and add the line(s)

*.* @server

Don’t forget to restart the syslog on both machines after the above editing.

Read more

They are Computer GODS

1) Dennis Ritchie and Ken Thompson - Dennis was the original developer of C and one of the core developers on UNIX while Ken was the man responsible for UNIX

2) Bjarne Stroustrup - This guy brought us C++! I couldn't talk trash about a guy who made C++.

3) Alan Kay - This is one of the fathers of object oriented programming.

4) John McCarthy - The original designer of the Lisp programming language.

5) Richard Stallman - Like him or hate him, he is a seriously influential person in the computer world, The man is the founder of GNU.

6) Larry Wall - This guy brought us Perl.

7) Alan Cox - Alan Cox and Richard Stallman must have been long lost brothers. This guy was one of the earliest developers on the linux kernel and apparently has not shaved since he started.

8) James Gosling - This guy brought us Java and is wearing a shirt with the java mascot playing an electric guitar.

9) Guido Van Rossum - This guy brought us Python

10) Linus Benedict Torvalds: Best known for initiating the development of the Linux kernel.

11) Dr. Andrew Stuart "Andy" Tanenbaum : He is best known as the author of MINIX, a free Unix-like operating system for teaching purposes, and for his computer science textbooks, regarded as standard texts in the field. He regards his teaching job as his most important work.

Am I missing anyone here?
Read more

All 235 low-cost webcams supported in Linux thanks to... this man

LONE HOBBYIST programmer sitting at his home in France is responsible for adding 235 USB webcams to the list of those supported by Linux.

His name is
Michel Xhaard

Check his site : here
List of supported webcams : here

Read more

HowTo Convert CHM files to PDF in Linux

1. Download chm2pdf by clicking [Here].

3. Now extract the downloaded file.

4. Open your Terminal and browse to the folder you extracted and run:

5. sudo python install

Now to use it is very simple:

In Terminal, type: chm2pdf filename.chm


You need these packages installed and working:

* chmlib
* pychm
* htmldoc

Read more

HowTo do Transparent proxy with Squid

Modify or add following to squid configuration file (/etc/squid/squid.conf):

httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
acl lan src
http_access allow localhost
http_access allow lan

Added following rules to forward all http requests (coming to port 80) to the Squid server port 3128 :

[eth0 connected to internet and eth1 connected to local lan]

iptables -t nat -A PREROUTING -i eth1 -p tcp –-dport 80 -j DNAT –to
iptables -t nat -A PREROUTING -i eth0 -p tcp –-dport 80 -j REDIRECT –-to-port 3128

Read more

How To Apply Patch to Kernel Source

Go to directory which holds the kernel source code

# cd /usr/src/linux
# bzip2 -dc /usr/src/patch-x.y.z.bz2 patch -p1 –dry-run

–dry-run option to check that the patch applies cleanly. It can be a real pain to pull out a partially-applied patch. The -p1 option strips off part of the diff file’s pathnames for each changed file (see the patch(1) manpage for more details).

Now you’ve checked that it should apply cleanly, run the following to actually apply it. Then you’re done!

# bzip2 -dc /usr/src/patch-x.y.z.bz2 patch -p1
Read more

Make fetchmail deliver via procmail

Just add the following line:

mda “/usr/bin/procmail -d %T”

to your “options” in ~/.fetchmailrc For instance .fetchmailrc may look something like:

poll protocol pop3 username myusername password mysecretpassword options ssl mda “/usr/bin/procmail -d %T”
Read more

Filter attachments (.bat, .exe, etc..) in postfix

Postfix attempts to be fast, easy to administer, and secure. The outside has a definite Sendmail-ish flavor, but the inside is completely different. Postfix has several hundred configuration parameters that are controlled via the file. Fortunately, all parameters have sensible default values

Simple, In /etc/postfix/ enable the body checks with this line:
body_checks = pcre:/etc/postfix/body_checks
Now put something in this file (/etc/postfix/body_checks):
/^(.*)name=\”(.*).(hta|vb[esx]|ws[fh]|js[e]|bat|cmd)\”$/ REJECT
This will filter attachments of various types.
Remove from the above line, whatever you want to allow.Of course you can add some more lines to make postfix a simple spam filter:

/special offer email/ REJECT
/mortgage rates/ REJECT
/other spam mail subjects/ REJECT

Read more
Related Posts with Thumbnails