linux poison RSS
linux poison Email
0

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
/sbin/rpc.lockd
/sbin/rpc.statd

/etc/rc.d/init.d/nfs - which has 3 parts
/usr/sbin/rpc.rquotad
/usr/sbin/rpc.mountd
/usr/sbin/rpc.nfsd

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
0

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
0

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
0

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
2

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 foo.com assigns the same name to each of the three web servers, but uses different IP addresses for each:

;
; Domain database for foo.com
;
foo.com. IN SOA ns1.foo.com. hostmaster.foo.com. (
2006032801 ; serial
10800 ; refresh
3600 ; retry
86400 ; expire
86400 ; default_ttl
)
;
; Name servers
;
foo.com. IN NS ns1.foo.com.
foo.com. IN NS ns2.foo.com.
;
; Web servers
; (private IPs shown, but public IPs are required)
;
www IN A 10.1.1.11
www IN A 10.1.1.12
www IN A 10.1.1.13

When DNS gets a request to resolve the name www.foo.com, 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
Related Posts with Thumbnails