Tuesday, July 27, 2010

Set up Internet Connection Sharing(using LAN ) in Linux (Ubuntu) between any computers

Internet Connection Sharing (ICS) provides the ability for one computer to share its Internet connection with another computer. To do this, a computer with an Internet connection must be configured to function as an Internet gateway. A second computer (or network of computers) connects to the Internet indirectly via the gateway computer.

Situations in which ICS may be necessary include:

  • dial up connection
  • authenticated (PPPoA/E) connection
  • wireless connection
  • When it is impractical (such as with distance) to run multiple network cables to each computer.

GUI Method via Network Manager (Ubuntu 9.10 and up)

In order to share an Internet connection, the computer that will do the sharing must have two network cards or ports. This assumes that you are using at least one Ethernet port and that it is identified as "eth0".

When you are logged in:

  • Go to "System" on your top bar
  • Navigate to "Preferences" and select "Network Connections"
  • When that window opens, select "Auto eth0" and press "Edit"

A new window will open. Navigate to the tab titled "IPv4 Settings" and change the Method to "Shared to other computers". After restarting the computer you should now be able to plug in any computer into your other Ethernet port or share through your wireless card.

Ubuntu Internet Gateway Method (iptables)

You will need two network cards in the gateway computer, or a PPP interface and a network card. One network card (or PPP interface) connects to the internet, we will call this card eth0. The other card connects to your internal network, we will call thiseth1. It is also possible to do ICS with a single network card. In this case, use eth0 for the internet and eth0:0 for the internal network.

  1. Internet <<==>> eth0 <> Ubuntu gateway <> eth1 <<==>> Client PC

  2. Internet <<==>> ppp0 <> Ubuntu gateway <> eth1 <<==>> Client PC

  3. Internet <<==>> eth0 <> Ubuntu gateway <> eth0:0 <<==>> Client PC

Gateway set up

The following example will focus on the most common gateway setup; an Ubuntu computer with two wired network adapters (eth0 and eth1) hosting ICS to a static internal network configured for the 192.168.0.x subnet.

For this example, eth0 is used to represent the network card connected to the internet and eth1 represents the network card connected to a client PC. You can replace eth0 and eth1 as needed for your situation. Also, any private IP subnet can be used for the internal network IP addresses.

In summary:

  • eth0 = the network adapter with internet (external or WAN).
    eth1 = the network adapter to which a second computer is attached (internal or LAN).
    192.168.0.x = IP subnet for eth1

Your setup may be different. If so, make sure to change them accordingly in the following commands.

Configure internal network card

Configure your internal network card (eth1) for static IP like so:

sudo ifconfig eth1 192.168.0.1

(The external and internal network cards cannot be on the same subnet)

Configure NAT

Configure iptables for NAT translation so packets can be correctly routed through the Ubuntu gateway.

sudo iptables -A FORWARD -i eth0 -o eth1 -s 192.168.0.0/24 -m conntrack --ctstate NEW -j ACCEPT sudo iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT sudo iptables -A POSTROUTING -t nat -j MASQUERADE 

(rule1 allows forwarded packets (initial ones), rule2 allows forwarding of established connection packets (and those related to ones that started), rule3 does the NAT.)

IPtables settings need to be set-up at each boot (they are not saved automatically), with the following commands:

  • Save the iptables:

sudo iptables-save | sudo tee /etc/iptables.sav
  • Edit /etc/rc.local and add the following lines before the "exit 0" line:

iptables-restore < /etc/iptables.sav

Enable routing

  • Configure the gateway for routing between two interfaces by enabling IP forwarding:

sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"

  • Edit /etc/sysctl.conf and add these lines:

net.ipv4.conf.default.forwarding=1 net.ipv4.conf.all.forwarding=1

The /etc/sysctl.conf edit is required because of following Bug (Hardy and later releases) Launchpad Bug Report

Client set up

Any OS can connect to the internet as an ICS client as long as networking has been configured correctly. The following example will focus on how to set up an Ubuntu ICS client. For this example, it is assumed that the client is connected to an Ubuntu gateway which has been configured to share ICS on the 192.168.0.x subnet according to the gateway set up outlined above.

For this example, eth0 is the network card on the client which is connected (by crossover cable) to eth1 on the Ubuntu gateway. You can replace eth0 as needed for your situation. Also, any private IP subnet can be used for the internal network IP address, as long as it matches the subnet on the gateway.

Disable networking

sudo /etc/init.d/networking stop

Give the client a static IP address

sudo ifconfig eth0 192.168.0.100

This IP address can be anything within the gateway's private IP range.

Configure routing

sudo route add default gw 192.168.0.1

This address should match the IP address on the gateway's internal network card (eth1 in the above example).

Configure DNS servers

Unless your ICS gateway can also perform DNS, you must manually configure the client with your ISP DNS servers. If you do not know your ISP's DNS servers, you can use OpenDNS servers instead.

  • Backup your current /etc/resolve.conf file:

sudo cp /etc/resolv.conf /etc/resolv.conf.backup
  • Open /etc/dhcp3/dhclient.conf with your favorite text editor:

sudo nano /etc/dhcp3/dhclient.conf
  • Search for the line that starts "prepend domain-name-servers", and change it to look like this:

prepend domain-name-servers 208.67.222.222,208.67.220.220;

208.67.222.222 and 208.67.220.220 are OpenDNS DNS servers. If you wish to use your ISP's DNS servers, use them here instead of the OpenDNS servers.

Restart networking

sudo /etc/init.d/networking restart

Once this is finished, your client will now have access to the internet via ICS. Please direct any questions/comments to theInternet Connection Sharing Documentation thread.


A beginner's working example of a Ubuntu Desktop with 2 nic cards, sharing internet connectionhttp://ubuntuforums.org/showthread.php?p=3713684

Advanced Gateway Configuration

The above example outlines how to do basic ICS on a static IP network. Once you have configured your Ubuntu computers for ICS and confirmed that everything works across your static network, there are a few advanced routing configurations which can make it much easier to set up the ICS client.

Advanced configurations include DHCP server, and DNS server. A DHCP server allows the client to get an ip address automatically without having to manually configure a static IP. A DNS server allows the client to resolve internet host names without manually configuring DNS addresses.

DHCP/DNS server

This is deceptively easy, and will be acceptable for most situations. However, it will not allow the ICS client to see computers on different subnets.

  • Install software

sudo aptitude install dnsmasq
  • Stop the server

After dnsmasq has been installed, it is automatically started, so it will need to be stopped before changes can be made.

sudo /etc/init.d/dnsmasq stop
  • Make a backup of the well commented configuration file (we won't use any of this, but it's handy to have a copy of for reference later)

sudo cp /etc/dnsmasq.conf /etc/dnsmasq.conf-backup
  • Edit /etc/dnsmasq.conf with your favorite text editor and add the following two lines:

interface=eth1 dhcp-range=192.168.0.100,192.168.0.250,72h

Note: The "interface" should match the interface that your clients are connected to, and the "dhcp-range" should be within the gateway's private IP subnet you configured according to the "Gateway set up" directions above.

  • Start the DHCP/DNS server

sudo /etc/init.d/dnsmasq start

Now your clients should be able to pull an automatic ip address and resolve host names.

Other approaches

The following section includes a rough outline of some alternative methods for configuring an ICS gateway. They are incomplete and untested. They are included simply for the sake of information.

Alternate server software (CLI)

There are other ways to host ICS, but they are outside the scope of this article.

Alternate NAT

The ipmasq daemon does NAT routing so you don't have to configure iptables. The following directions are incomplete and should not be considered a full description of what needs to be done to configure ipmasq.

sudo aptitude install ipmasq

Configure ipmasq to allow dhcp requests, otherwise you need to stop ipmasq to make a connection. You need to copy a .rul from the documentation directory into the /etc config and edit the interface name. Then reconfigure ipmasq to start after networking has been started

sudo dpkg-reconfigure ipmasq.

Dedicated DHCP server

dhcp3 is an easy to configure and scalable true DHCP server that can be configured for many different aplications. dhcp3 configuration is more complex, but it can be useful in many situations:

https://help.ubuntu.com/community/dhcp3-server

Dedicated DNS server

BIND9 is a popular and well supported local DNS server. It is very versatile, and very powerful, but difficult to configure correctly:

https://help.ubuntu.com/community/BIND9ServerHowto

Alternate gateway software (GUI)

Another approach --- set up Firestarter, to run connection sharing, set up dhcp3-server, and set its configuration to listen to the correct eth*. To change this later, run sudo dpkg-reconfigure dhcp3-server.

Basically, you need to have Firestarter active/turned on/protecting, to have the connection shared.

When you install dhcp3-server, it will place a sample config file in your /etc/dhcp3 folder, called dhcpd.conf. I suggest you install dhcp3-server first, and then firestarter, cause if you are lucky, firestarter will set up a new config file for dhcp3 for you.

At any time that changes are made to your dhcpd.conf file, restart the server - sudo /etc/init.d/dhcp3-server restart will do it.Alternatively, every time you run the sudo dpkg-reconfigure dhcp3-server, at the end, your server will restart.

There are several issues that I had...first of all, the Firestarter firewall won't even start if you don't have it configured to listen to the right interface...You can change which one it listens to in Preferences --> Network Settings. The Local network connected device must be the same as you have dhcp3-server listening to, of course, both checkboxes under that need to be checked. The Internet connected network device will be the one that is configured for Internet. Now, I have two NICs, but I have pppoe configured on eth0, and I have Internet connection sharing configured on the same one, cause eth0 is also configured for a static 192.168 internal IP for my internal network.

simple iptables example

simple example wlan0 has the internet connection eth0 is being used to share the connection it could be directly with a single pc via a crossover cable or switch or you could have a router with a cable from eth0 to the wan port and a whole lan setup behind this. Interestingly the internet connection could be ppp0 a 3g or mobile Internet modem.

  • #!/bin/sh 
    # 
    # internet connection sharing wlan0 is the gate way 
    # eth0 is the lan port this might use a straight ethernet cable to a router wan port or a switch or a single PC
    # 192.168.2.2 is the port that is being used by the lan for access I changed it to 192.168.2.254 and set fixed addresses for the wan and router
    #
    # change wlan0 to ppp0 and you can use this for mobile broadband connection sharing
    #
    ifconfig eth0 up"
    ifconfig eth0 192.168.2.1
    echo “1” > /proc/sys/net/ipv4/ip_forward
    iptables -t nat -A POSTROUTING -o wlan0 -s 192.168.2.0/24 -j MASQUERADE
    iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 3074 -j DNAT --to-destination 192.168.2.2
    iptables -t nat -A PREROUTING -i wlan0 -p udp -m multiport --dports 88,3074 -j DNAT --to-destination 192.168.2.2
    iptables -A FORWARD -i wlan0 -d 192.168.2.2 -p tcp --dport 3074 -j ACCEPT
    iptables -A FORWARD -i wlan0 -d 192.168.2.2 -p udp -m multiport --dports 88,3074 -j ACCEPT

You could use the above as a bash script changing things to suit 

  • If things go wrong The Following script should save you if things get badly messed up.


  • #!/bin/sh
    # 
    # rc.flush-iptables - Resets iptables to default values. 
    # 
    # Copyright (C) 2001 Oskar Andreasson <bluefluxATkoffeinDOTnet>
    #
    # This program is free software; you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation; version 2 of the License.
    #
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    # GNU General Public License for more details.
    #
    # You should have received a copy of the GNU General Public License
    # along with this program or from the site that you downloaded it
    # from; if not, write to the Free Software Foundation, Inc., 59 Temple
    # Place, Suite 330, Boston, MA 02111-1307 USA
    #
    # Configurations
    #
    IPTABLES="/usr/sbin/iptables"
    #
    # reset the default policies in the filter table.
    #
    $IPTABLES -P INPUT ACCEPT
    $IPTABLES -P FORWARD ACCEPT
    $IPTABLES -P OUTPUT ACCEPT
    #
    # reset the default policies in the nat table.
    #
    $IPTABLES -t nat -P PREROUTING ACCEPT
    $IPTABLES -t nat -P POSTROUTING ACCEPT
    $IPTABLES -t nat -P OUTPUT ACCEPT
    #
    # reset the default policies in the mangle table.
    #
    $IPTABLES -t mangle -P PREROUTING ACCEPT
    $IPTABLES -t mangle -P POSTROUTING ACCEPT
    $IPTABLES -t mangle -P INPUT ACCEPT
    $IPTABLES -t mangle -P OUTPUT ACCEPT
    $IPTABLES -t mangle -P FORWARD ACCEPT
    #
    # flush all the rules in the filter and nat tables.
    #
    $IPTABLES -F
    $IPTABLES -t nat -F
    $IPTABLES -t mangle -F
    #
    # erase all chains that's not default in filter and nat table.
    #
    $IPTABLES -X
    $IPTABLES -t nat -X
    $IPTABLES -t mangle -X

Further reading https://help.ubuntu.com/community/IptablesHowTo

Internet Connection Sharing Documentation thread http://ubuntuforums.org/showthread.php?s=88b74f79f0ab07638e6b361c09040b45&t=503287

See also

Set up Wireless Internet Connection Sharing(using Wifi) in Linux (Ubuntu) between any computers

Okay, imagine you only have a network cable plugged in your desktop PC (which we'll call "eth0") and a wireless card too (which we'll call "wireless0"). Now suppose you have your laptop (or any other computer) and you have no way to connect it to the internet - but wait! you have a wireless in your desktop PC and your laptop does too, so what we're gonna do is to share your internet connection for your laptop through your wireless card. Come aboard!

Remember, your machine may vary so be sure to use the commands shown in the "The basics" section right below.

Note: this guide has been tested for sharing connection between :

Ubuntu Feisty Fawn (7.04)

and

Windows XP Professional

Please add successfull configurations

ICS2.jpeg

Note: This diagram was created with inkscape. If you want to edit it download the full file ics.svg from: More Actions->Attachments

The Basics

For getting your wireless card info, open a terminal and use these commands:

lsusb     (lists all the connected USB devices) iwconfig  (lists all the detected wireless hardware) iwlist    (allows you to scan the wireless networks around you) ifconfig  (lists all the detected network hardware. You can get some info for your wireless here too)

Packages

  • You also need Firestarter, which is just a GTK frontend for the iptables and will allow your internet connection to be shared. You can use Add/Remove Applications or the Synaptic package manager to get it (search for firestarter) or just issue a command in any open terminal window:

sudo apt-get install firestarter

Configuring the SERVER

Here we'll configure who is going to share the Internet connection (our desktop PC with the two cards installed). First, we need to have some concepts and rules in mind:

  1. Computers must be in the same subnet (see below for explanations)
  2. You might not be able to use the Gnome Network Manager (and/or maybe KDE WiFi Manager) using this method.

  3. The Server's wireless0 has to be in a range of 192.168.x.2 and 192.168.x.24. Why? our computer is usually using 192.168.0.1 unless you're on a big network, 192.168.0.0 can't be used for it and ranges higher than 24 in the last number are only allowed for Wireless networking,(1.reference please) or so I've read.

  4. Your wireless card must have the lowest IP possible,(2.reference please) that's why we're using 192.168.0.2 because it's closest to 1 and 0 which are in use and we can't use it, so 2 is free. Client computers ALWAYS MUST have greater IP addresses than the chosen one for the wireless adapter (3.reference please)(or the one sharing the internet).

If you haven't yet, it's time to stop the Network Manager:

sudo /etc/dbus-1/event.d/25NetworkManager stop

Once stopped, we shall proceed to edit our /etc/network/interfaces file.

sudo gedit /etc/network/interfaces

Network Interfaces configuration -IMPORTANT-

Your network configuration file will look similar to this one:

auto lo iface lo inet loopback  auto eth0 iface eth0 inet dhcp  auto eth1 iface eth1 inet dhcp  auto eth2 iface eth2 inet dhcp  auto ath0 iface ath0 inet dhcp  auto wlan0 iface wlan0 inet dhcp

For the sake of this example, we only have two network cards, so I'm gonna simplify the example by removing the interfaces we won't use from the file. You can happily do your modifications without deleting them.

We need to think how we'll set up our network. We'll do it this way:

  • IP Address for wireless0: 192.168.0.2 (its own IP address we can define manually).
  • Gateway for wireless0: 192.168.0.1 (where does the internet come from? us, of course. 192.168.0.1 will always be your own computer in most of the cases).
  • Network Mask for wireless0: 255.255.255.0 (Always needed and standard value 99.9% of the time).

Note: You might need to think up another IP address for it if you're on a large network. Else, just leave it like that.

For sharing internet through the wireless with those settings, our interfaces file will end up like this:

auto lo iface lo inet loopback  auto eth0 iface eth0 inet dhcp  auto wireless0 iface wireless0 inet static          wireless-key 1234567890          wireless-channel 6          wireless-mode ad-hoc          wireless-essid 'Wireless Connection'          address 192.168.0.2          gateway 192.168.0.1          netmask 255.255.255.0

Note: Remember to replace wireless0 with your network adapter's name, which you can get by typing in a terminal:

iwconfig

Okay. Now, we're doing the following things:

  • Setting wireless0 to load automatically.
  • Specify a static configuration instead of being assigned by DHCP (which we won't be able to do).
  • We'll set an hexadecimal WEP key for safety (WPA is not supported at this stage).
  • Also, a channel where to send the information through. Remember Wireless is very similar to radio/tv communications.
  • Specify that we're going be in an ad-hoc network (peer-to-peer or mesh).
  • We'll put a name for it, which we'll use to identify it in Windows, and to identify ourselves in our location.
  • We'll set it's address, gateway and netmask as we decided earlier.

That done, we can restart networking to get the device ready:

sudo /etc/init.d/networking restart

After that, we'll fire up Firestarter:

gksudo firestarter

A wizard should appear. Follow through these steps:

  1. Press Next.
  2. Choose eth0 (or your Ethernet device's name) as the Internet device. If your IP configuration is assigned by DHCP, check/uncheck the corresponding box according to your situation.
  3. Choose wireless0 (or your wireless device's name) as the device which will share Internet. Check the box that says to share Internet.
  4. Do NOT activate the option to enable DHCP in the Local Network.

  5. Press Save.

If everything went good, it should say Firewall Started. If not, please refer to the Troubleshooting section, else, we're done here.

Configuring the CLIENTS

This is relatively easy. When you have your wireless card working (it should blink its led lights, or at least turn on) and you've set up the server correctly, all you have to do is this:

  1. Make sure your other computer has wireless enabled and working.

  2. Go to the Wireless Connections panel and scan for nearby networks. Yours should appear soon. If not, then something's wrong with your server computer or the connection itself. Refer to the Troubleshooting section for details.

  3. Double-click your connection and type your password in. Wait for it to connect.

  4. Go to Control Panel -> Network Connections and right-click your wireless connection, then click Properties.

  5. Click TCP/IP Internet Protocol (or similar) and click the Properties button.

  6. Click the Assign an IP Address Manually radio button (or similar).

  7. We'll need to put the following data:
    • IP Address: 192.168.0.10
    • Gateway: 192.168.0.1
    • Network Mask: 255.255.255.0
  8. Set the DNS addresses to the same ones that your desktop PC has. You can check that by typing on the terminal on the Server/Desktop computer (use the IP addresses after "nameserver"):

cat /etc/resolv.conf
  1. Click Ok, then Ok again to apply changes.

  2. Right-click the small icon on the bottom-right corner of the screen (system tray) which looks like a small monitor with some green curves next to it representing radio signals. Then click Repair.

  3. Pat yourself on the back for your hard work and make yourself a sandwich :)

Your laptop should have Internet now. If anything went wrong, check the Troubleshooting section, as always.


For more details lease refer the original content at https://help.ubuntu.com/community/WifiDocs/ShareEthernetConnectionThroughWireless


CD Slide-in trick to increase the speed of BSNL EVDO.

First, let me start with the CD slide-in trick:

1. Take an old CD or DVD.

[Image: th_06.jpg]

2. Connect the device:

[Image: th_03.jpg]

3. Swivel-Open the antenna of the device to about 90 degree: 

[Image: th_11-1.jpg]

4. Slide-In an Old CD or a DVD into the antenna, such that the CD’s hole will enter into the antenna.

[Image: th_04.jpg] [Image: th_05.jpg]

This completes the first method. And this will be useful to get much better signal reception for people who use a laptop and also for people who keeps thedevice static on their desktop.

Now the second method requires a USB extension cable or a USB HUB. Here you go:

1. Take an old CD or DVD and a USB extension cable/hub and slide-in the CD/DVD as I mentioned in the first method.

[Image: th_02.jpg]

2. Connect one end of the extension cable or the HUB to the EVDO data cable….

[Image: th_07.jpg]

3. ….and plug-in the device to the other end or to one of the hub’s port.

[Image: th_08.jpg]

This completes the second method and this is really useful to people who are using desktop. By doing this, one can place the device far from their desktop and can place it where they feel that the device is getting much better signal reception.

I tested by placing the device beside my room’s window, but I didn’t get good speeds, So instead, I’ve placed it on CRT monitor and it works absolutely good.

[Image: th_09.jpg] [Image: th_10.jpg]

Here ends the tutorial..

Tuning Ubuntu 9.10 Karmic for speed and better internet connectivity


After installing Ubuntu Karmic 9.10, I changed the following tunables

swappiness and vfs_cache_pressure

swappiness --> If we have large RAM, there is probably no use for a swap file and we can decrease the swappiness to a very low value without fear. If the RAM capacity is 512 MB or less than 1 GB RAM, then Ubuntu or any linux uses swap as a swapfile. The default swappiness is normally 60 (but I have seen 40 in case of Fedora 11 after updates). Do not touch the swappiness and cache pressure unless you have atleast 1 GB of RAM

If we decrease swappiness, speed of opening programs feels faster

to get current swappiness of system

sudo sysctl -q vm.swappiness

to change swappiness to value 20, which is low


sudo sysctl -w vm.swappiness=20

to increase the speed of browsing files and folders again and again, we should decrease vfs_cache_pressure. Default vfs_cache_pressure is 100, if we decrease it, kernel virtual machine (vm) caches files more and more

to get current vfs_cache_pressure

sudo sysctl -q vm.vfs_cache_pressure

to set vfs_cache_pressure

sudo sysctl -w vm.vfs_cache_pressure = 50

You can read original tuxradar article about improving speed by clicking this http://tuxradar.com/content/make-linux-faster-and-lighter 

Sometime today morning when browsing irctc and opening some news sites, youtube, Ubuntu took a very very long time. Then I remembered that old debian lenny errata page and followed it and tweaked tcp window scaling settings. If you ever feel that you are not able to visit some sites or browse properly, follow this debian errata

Debian Errata, see buggy routers may cause problem

or

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=401435

or

http://kerneltrap.org/node/6723

If you are bored to read the above and continue reading here, what I did, here is what I did after following the above errata page

 Hit the site you are having trouble viewing, if you feel there is problem open terminal and change the system param as follows

sudo sysctl -w net.ipv4.tcp_rmem="4096 65536 65536"

and 


sudo sysctl -w net.ipv4.tcp_wmem="4096 65536 65536"

 If you don't feel the same browsing/network issue you faced before setting these two tunables, then proceed below to make the changes permanent

To make above changes permanent upon reboot(speed increase and net improvements)  

Add these lines to end of /etc/sysctl.conf by editing it (sudo vi etc/sysctl.conf)


#decrease swappiness
vm.swappiness=20
#improve file/folder browsing speed
vm.vfs_cache_pressure=50
#debian tcp window scaling errata fix
net.ipv4.tcp_rmem=4096 65536 65536
net.ipv4.tcp_wmem=4096 65536 65536


Note: sudo sysctl -p reapplies all the settings from /etc/sysctl.conf and can be used

Sunday, July 25, 2010

How To mount Hard Drive Partitions Everytime when Login to Ubuntu Linux automatically

One of the biggest problem of using Linux is the fact that many times things just get screwed up. Most of the times it isn't your fault at all, it could be an hardware problem or an software glitch. However it doesn't change the fact that your PC is screwed up!
One of those things which happens with my Ubuntu is that it doesn't mount all my hard drives (except C:// drive, on which it is installed) during startup. I have to manually open up Places and click on each and every hard drive to open them up. This might seem to be a trivial problem, but it isn't. The major headaches due to this are:

1. I cannot keep any image from other hard drive as Wallpaper.
2. Amarok cannot start playing songs. It gives me an error saying 'File not located'. This is the most important problem.

So if you have been hounded by this problem too, then rejoice cause I have finally found a solution to this problem.
There is an amazing software called Pysdm which allows you to decide which drives to mount or unmount during startup. Pysdm is an GUI application and is extremely easy to use.


here are some methods.


Mounting Fakeraid

Its assumed you have formated you raid set using dmraid command with instructions found at FakeRaidHowto

You need to know the name of your raid set

sudo dmraid -ay

RAID set "sil_aiaedhaeafaa" already active RAID set "sil_aiaedhaeafaa1" already active

Edit fstab as per instructions above :

nano -w /etc/fstab

An example line to add

/dev/mapper/sil_aiaedhaeafaa1  /media/raid  reiserfs  user,nosuid,exec,nodev  0  0

Make sure you create the directory /media/raid

mkdir /media/raid

Reboot

Mounting and checking the partitions

In the terminal, type the following command.

sudo mount -a

To verify that the partitions were mounted properly, open Gnome's file browser and direct it to the locations at which the partitions were mounted. Click the 'File System' button to access '/', and navigate from there. If the partition being examined contains files, the modifications were successful, and the partitions will be automatically mounted every time the system is restarted.

If no files are found, please see XChatHowto and join #ubuntu on irc.freenode.net.

Using pysdm

Pysdm is a program to automatically setup partitions every time Ubuntu starts. This is verified to work in 9.04.

Installation

sudo apt-get install pysdm

Usage

Select each partition you want to change in the list. Note the type. Often it is ext3 (Linus) or NTFS (Windows). Use assistant and press OK. By default the partition is mounted at boottime. You can also mount the partition now. Press Apply. Done.

Using GNOME-Mount

Gnome-mount is a program which mounts disks using the same facilities as when mounting a disk as a normal user through Nautilus. There is no need to setup mountpoints or filesystems. This is particularly interesting if you want to use the automatically created mountpoints instead of manually specifying them for each disk.

Installation

sudo apt-get install gnome-mount

Usage

You can mount a disk as a normal user via

gnome-mount -p myDiskLabel

where myDiskLabel is your disk name (e.g Data). To have the disk mounted each time you startup (thus removing the password prompt on first usage of the disk), simply add above line to your list of startup applications (System->Preferences->Startup Applications). Note that while mounting through gnome-mount will not need a password, unmounting or remounting via Nautilus will still invoke the password prompt.
Please refer https://help.ubuntu.com/community/AutomaticallyMountPartitions for details

Saturday, July 24, 2010

How to install Ubuntu themes

This tutorial will guide you through installing new Desktop Themes in Ubuntu Linux – and provide a couple of resources to find themes.

  1. First you'll need to find some themes to download and try out. Techie Souls has a list of 50 of the best looking Ubuntu (Gnome) themes that you can peruse, complete with download links. And gnome-look.org is a great place to find even more themes.
  2. When you download themes, don't uncompress them. Leave them as tar.gz files – just remember where you saved them. From the Ubuntu menu, select System -> Preferences -> Appearance.

  3. click to enlarge

  4. On the Appearance Preferences page, make sure that the Theme tab is selected. Then click the Install… button.

  5. click to enlarge

  6. Navigate to the theme file that you downloaded, select it, and click Open.

  7. click to enlarge

  8. The theme should now install. Click OK.
  9. Click the Apply New Theme button.
  10. And Ubuntu will now apply that theme, changing the look and style of Ubuntu.

  11. click to enlarge

  12. Repeat the above steps to try out other themes. That's it!

HOWTO: Parental control. Now with GUI too!

HOWTO: Parental control. Now with GUI too! (updated version)
Description:
WebContentControl is a parental control GUI (more specifically a GUI for
DansGuardian+TinyProxy+FireHol).

Official website: https://launchpad.net/webcontentcontrol

Feedback is very welcome. And help too!

Please report bugs at https://bugs.launchpad.net/webcontentcontrol

Pre-Installation:
Please make sure you have the "universe" repository enabled.

Go to System->Administration->Software sources and check the "universe"
repository.
More info: https://help.ubuntu.com/community/Repositories/Ubuntu

Installation:
There are three ways to install WebContentControl:
1)Through the PPA repositories
2)From the Debian package
3)From source

1)Through the PPA repositories
Code:

deb http://ppa.launchpad.net/webcontentcontrol/webcontentcontrol/ubuntu
lucid main
deb-src
http://ppa.launchpad.net/webcontentcontrol/webcontentcontrol/ubuntu
lucid main

See here for how to add repositories:
https://help.ubuntu.com/community/Repositories/Ubuntu

Add the repos by command-line:
Code:

sudo add-apt-repository ppa:webcontentcontrol/webcontentcontrol
sudo apt-get update

Once you've added those repositories, just:
Code:

sudo apt-get install webcontentcontrol

(Or use Synaptic package manager if you prefer a GUI.)

2)From the Debian package
Download the latest .deb from the site and double-click on it or by
command-line:
Code:

sudo gdebi <package>.deb

3)From source
Code:

sudo apt-get install gambas2-runtime gambas2-gb-qt gambas2-gb-form
gambas2-gb-form-dialog gambas2-gb-qt-kde gambas2-gb-qt-kde-html
sudo apt-get install dansguardian tinyproxy firehol

Then download the latest version on
https://launchpad.net/webcontentcontrol/+download and:
Code:

tar -xzvf webcontentcontrol-1.0.tar.gz
cd webcontentcontrol-1.0
./configure && make && sudo make install

The shortcut should be created in Applications->System tools.
If it isn't, the command-line to launch it is:
Code:

/usr/bin/webcontentcontrol

How to uninstall it:
Code:

sudo make uninstall