tag:blogger.com,1999:blog-42058256145989387242024-02-20T00:10:33.958-08:00ARV in LINUXARVhttp://www.blogger.com/profile/13867592943489571397noreply@blogger.comBlogger19125tag:blogger.com,1999:blog-4205825614598938724.post-13546272595409224092010-09-16T23:36:00.000-07:002010-09-16T23:37:03.470-07:00ufw - Uncomplicated Firewall<h3 class="title"><br> </h3> <p> The default firewall configuration tool for Ubuntu is <span class="application"><strong>ufw</strong></span>. Developed to ease iptables firewall configuration, <span class="application"><strong>ufw</strong></span> provides a user friendly way to create an IPv4 or IPv6 host-based firewall. </p> <p> <span class="application"><strong>ufw</strong></span> by default is initially disabled. From the <span class="application"><strong>ufw</strong></span> man page: </p> <p><span class="quote">“<span class="quote"> ufw is not intended to provide complete firewall functionality via its command interface, but instead provides an easy way to add or remove simple rules. It is currently mainly used for host-based firewalls. </span>”</span> </p> <p> The following are some examples of how to use <span class="application"><strong>ufw</strong></span>: </p> <div class="itemizedlist"> <ul class="itemizedlist" type="disc"> <li class="listitem"> <p> First, <span class="application"><strong>ufw</strong></span> needs to be enabled. From a terminal prompt enter: </p> <pre class="screen"><span class="command"><strong>sudo ufw enable</strong></span> </pre> </li> <li class="listitem"> <p> To open a port (ssh in this example): </p> <pre class="screen"><span class="command"><strong>sudo ufw allow 22</strong></span> </pre> </li> <li class="listitem"> <p> Rules can also be added using a <span class="emphasis"><em>numbered</em></span> format: </p> <pre class="screen"><span class="command"><strong>sudo ufw insert 1 allow 80</strong></span> </pre> </li> <li class="listitem"> <p> Similarly, to close an opened port: </p> <pre class="screen"><span class="command"><strong>sudo ufw deny 22</strong></span> </pre> </li> <li class="listitem"> <p> To remove a rule, use delete followed by the rule: </p> <pre class="screen"><span class="command"><strong>sudo ufw delete deny 22</strong></span> </pre> </li> <li class="listitem"> <p> It is also possible to allow access from specific hosts or networks to a port. The following example allows ssh access from host 192.168.0.2 to any ip address on this host: </p> <pre class="screen"><span class="command"><strong>sudo ufw allow proto tcp from 192.168.0.2 to any port 22</strong></span> </pre> <p> Replace 192.168.0.2 with 192.168.0.0/24 to allow ssh access from the entire subnet. </p> </li> <li class="listitem"> <p> Adding the <span class="emphasis"><em>--dry-run</em></span> option to a <span class="emphasis"><em>ufw</em></span> command will output the resulting rules, but not apply them. For example, the following is what would be applied if opening the HTTP port: </p> <pre class="screen"><span class="command"><strong> sudo ufw --dry-run allow http</strong></span> </pre> <pre class="screen"><code class="computeroutput">*filter :ufw-user-input - [0:0] :ufw-user-output - [0:0] :ufw-user-forward - [0:0] :ufw-user-limit - [0:0] :ufw-user-limit-accept - [0:0] ### RULES ### ### tuple ### allow tcp 80 0.0.0.0/0 any 0.0.0.0/0 -A ufw-user-input -p tcp --dport 80 -j ACCEPT ### END RULES ### -A ufw-user-input -j RETURN -A ufw-user-output -j RETURN -A ufw-user-forward -j RETURN -A ufw-user-limit -m limit --limit 3/minute -j LOG --log-prefix "[UFW LIMIT]: " -A ufw-user-limit -j REJECT -A ufw-user-limit-accept -j ACCEPT COMMIT Rules updated</code> </pre> </li> <li class="listitem"> <p> <span class="application"><strong>ufw</strong></span> can be disabled by: </p> <pre class="screen"><span class="command"><strong>sudo ufw disable</strong></span> </pre> </li> <li class="listitem"> <p> To see the firewall status, enter: </p> <pre class="screen"><span class="command"><strong>sudo ufw status</strong></span> </pre> </li> <li class="listitem"> <p> And for more verbose status information use: </p> <pre class="screen"><span class="command"><strong>sudo ufw status verbose</strong></span> </pre> </li> <li class="listitem"> <p> To view the <span class="emphasis"><em>numbered</em></span> format: </p> <pre class="screen"><span class="command"><strong>sudo ufw status numbered</strong></span> </pre> </li> </ul> </div> <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"> <table summary="Note" border="0"> <tbody> <tr> <td rowspan="2" valign="top" width="25" align="center"> <img alt="[Note]" src="cid:part1.00000109.09060904@gmail.com"> </td> <th align="left"><br> </th> </tr> <tr> <td valign="top" align="left"> <p> If the port you want to open or close is defined in <code class="filename">/etc/services</code>, you can use the port name instead of the number. In the above examples, replace <span class="emphasis"><em>22</em></span> with <span class="emphasis"><em>ssh</em></span>. </p> </td> </tr> </tbody> </table> </div> <p> This is a quick introduction to using <span class="application"><strong>ufw</strong></span>. Please refer to the <span class="application"><strong>ufw</strong></span> man page for more information. </p> <div class="sect3" title="ufw Application Integration"> <div class="titlepage"> <div> <div> <h4 class="title">ufw Application Integration</h4> </div> </div> </div> <p> Applications that open ports can include an <span class="application"><strong>ufw</strong></span> profile, which details the ports needed for the application to function properly. The profiles are kept in <code class="filename">/etc/ufw/applications.d</code>, and can be edited if the default ports have been changed. </p> <div class="itemizedlist"> <ul class="itemizedlist" type="disc"> <li class="listitem"> <p> To view which applications have installed a profile, enter the following in a terminal: </p> <pre class="screen"><span class="command"><strong>sudo ufw app list</strong></span> </pre> </li> <li class="listitem"> <p> Similar to allowing traffic to a port, using an application profile is accomplished by entering: </p> <pre class="screen"><span class="command"><strong>sudo ufw allow Samba</strong></span> </pre> </li> <li class="listitem"> <p> An extended syntax is available as well: </p> <pre class="screen"><span class="command"><strong>ufw allow from 192.168.0.0/24 to any app Samba</strong></span> </pre> <p> Replace <span class="emphasis"><em>Samba</em></span> and <span class="emphasis"><em>192.168.0.0/24</em></span> with the application profile you are using and the IP range for your network. </p> <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"> <table summary="Note" border="0"> <tbody> <tr> <td rowspan="2" valign="top" width="25" align="center"> <img alt="[Note]" src="cid:part1.00000109.09060904@gmail.com"> </td> <th align="left"><br> </th> </tr> <tr> <td valign="top" align="left"> <p> There is no need to specify the <span class="emphasis"><em>protocol</em></span> for the application, because that information is detailed in the profile. Also, note that the <span class="emphasis"><em>app</em></span> name replaces the <span class="emphasis"><em>port</em></span> number. </p> </td> </tr> </tbody> </table> </div> </li> <li class="listitem"> <p> To view details about which ports, protocols, etc are defined for an application, enter: </p> <pre class="screen"><span class="command"><strong>sudo ufw app info Samba</strong></span> </pre> </li> </ul> </div> <p> Not all applications that require opening a network port come with <span class="application"><strong>ufw</strong></span> profiles, but if you have profiled an application and want the file to be included with the package, please file a bug against the package in <a class="ulink" href="https://launchpad.net/" target="_top">Launchpad</a>. </p> </div> ARVhttp://www.blogger.com/profile/13867592943489571397noreply@blogger.com0tag:blogger.com,1999:blog-4205825614598938724.post-28593238637547041152010-08-18T05:19:00.000-07:002010-08-18T05:20:20.233-07:00Make Linux faster<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span class="Apple-style-span" style="font-family: sans-serif;"> <p style="padding-top: 0px; margin-top: 0px;">With just a few tweaks, your Linux box can be lighter, sprightlier and quicker than ever before. Read on for the best ways to speed up your boot sequence, optimise KDE and Gnome, and get better performance from your favourite apps. We've also got some top tips from our favourite free software gurus...</p> <p style="padding-top: 0px; margin-top: 0px; text-align: center;"></p> <div style="margin: 20px; float: right;"><iframe marginwidth="0" marginheight="0" border="0" src="http://tag.admeld.com/ad/iframe/191/futurerow/300x250/429631_tuxradar?t=1282132255077&tz=-330&hu=&ht=js&hp=0&url=http%3A%2F%2Ftuxradar.com%2Fcontent%2Fmake-linux-faster-and-lighter&refer=" frameborder="0" height="250" scrolling="no" width="300"></iframe></div> <p style="padding-top: 0px; margin-top: 0px;"></p> <p style="padding-top: 0px; margin-top: 0px;">Gone are the days when you could make a cup of tea and drink it in the time it takes your computer's operating system to boot (with one notable exception). On that basis, you might think that your Linux machines are already performing at the fastest possible speed, right?</p> <p style="padding-top: 0px; margin-top: 0px;">Sadly, this is not always the case. Communities developing mainstream Linux distributions have to appeal to the widest possible audience and ensure compatibility with the widest range of hardware. This means that someone running a mainstream distro on a netbook or a low-end PC may well be using many of the same settings as someone with a high-end gaming machine. But it doesn't have to be this way!</p> <p style="padding-top: 0px; margin-top: 0px;">With just a few tweaks and some experimentation, your Linux system can realise your machine's untapped potential. Do you have a dual-core processor? Take advantage of this by running boot processes in parallel. Do you have more memory than you know what to do with? You could try caching data in memory rather than swapping space for faster access.</p> <p style="padding-top: 0px; margin-top: 0px;">The great strength of everyone's favourite free OS is that it can be customised from the ground up, so Linux is the ideal tool to tailor to your needs. But once you have an ultrafast system, how can you become more productive? We've consulted prominent members of the free software community for their favourite tips that make their systems more productive - and they could do the same for you.</p> <br> <h2 style="margin-top: 40px; margin-bottom: 0px; padding-bottom: 0px;">Make Linux boot faster</h2> <p style="padding-top: 0px; margin-top: 0px;">Any productive machine needs to be up and running as soon as possible, and a sluggish boot can hinder your efforts – which is why boot times were the first thing we thought about improving. One word of warning before you begin: we recommend that you make a backup before you make these alterations, as a bug in your bootloader can render your Linux box unbootable!</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Remove the timeout</h3> <p style="padding-top: 0px; margin-top: 0px;">You may notice that each time you boot there's a small count-down from three to zero, which is great if you regularly select a different OS or Linux kernel at boot time, but useless if you always boot into the same distro. Fortunately, it's easy to remove by opening<span class="Apple-converted-space"> </span><strong>/boot/grub/menu.lst</strong><span class="Apple-converted-space"> </span>in a text editor with root permissions and finding the line showing:</p> <pre class="command" style="border: 1px dashed rgb(187, 136, 136); margin: 10px; padding: 10px; background-color: rgb(255, 245, 245);">timeout=3</pre> <p style="padding-top: 0px; margin-top: 0px;">Once you've found it, change the value to zero. Save and exit then reboot and you should notice you have just knocked three seconds off your boot time.</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Improve disk performance</h3> <p style="padding-top: 0px; margin-top: 0px;">If you have a DMA-compatible (Direct Memory Access) hard drive, you can increase data throughput threefold with a simple tweak. This will improve boot times because read times will be reduced, and overall performance will increase whenever the hard disk is accessed.</p> <p style="padding-top: 0px; margin-top: 0px;">Start by installing<span class="Apple-converted-space"> </span><strong>hdparm</strong><span class="Apple-converted-space"> </span>through your package manager, then fire up a root terminal and type:<span class="Apple-converted-space"> </span><strong>hdparm -d1 /dev/hda1</strong>replacing<span class="Apple-converted-space"> </span><strong>/dev/hda1</strong><span class="Apple-converted-space"> </span>with the location of your boot partition to increase startup times or the root partition to increase general performance. Gnome users can have this run automatically each startup by heading to<span class="Apple-converted-space"> </span><strong>System > Administration > Services</strong>. You can then add this line as an entry with<span class="Apple-converted-space"> </span><strong>gksudo</strong><span class="Apple-converted-space"> </span>at the start to ensure it runs with root permissions without requiring additional authentication.</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Run boot processes in parallel</h3> <p style="padding-top: 0px; margin-top: 0px;">Parallelism can lead to big performance boosts, because running two processes at once will take half the time of running them sequentially (at least in theory). You can take advantage of this technique in Grub by firing up<span class="Apple-converted-space"> </span><strong>/etc/init.d/rc</strong><span class="Apple-converted-space"> </span>in a text editor with root permissions and finding the following line:</p> <pre class="command" style="border: 1px dashed rgb(187, 136, 136); margin: 10px; padding: 10px; background-color: rgb(255, 245, 245);">CONCURRENCY=none</pre> <p style="padding-top: 0px; margin-top: 0px;">You would then replace<span class="Apple-converted-space"> </span><strong>none</strong><span class="Apple-converted-space"> </span>with<span class="Apple-converted-space"> </span><strong>shell</strong><span class="Apple-converted-space"> </span>before saving and closing your text editor. When you reboot you should see a noticeable decrease in your boot times (around one or two seconds in most cases). If you don't see an increase, this is because this tweak is aimed primarily at systems with multi-core processors. If you have a solo-core processor you could actually increase your boot time if you use this tweak, which was the case with our test system where we saw a 2.4-second increase.<br> </p> <div class="image" style="margin: 30px; text-align: center;"> <p style="margin: 10px auto auto; padding-top: 0px; font-weight: bold; font-size: 13px; width: 550px; text-align: left;">You could edit a text file and restart your machine to profile your system, or just click a few buttons in Grub.</p> </div> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Optimise memory</h3> <p style="padding-top: 0px; margin-top: 0px;">One great way to improve performance is to define how swap space is used. A swap partition is where the Linux kernel caches data in virtual memory to quickly swap into RAM as and when it's needed. A dedicated partition isn't compulsory, but the space is also used to store your machine state if you choose to hibernate. The effects of this tip depend on your system and whether you have a swap partition, but if you have plenty of RAM you'll find that reducing swappiness will give you a noticeable performance boost.</p> <p style="padding-top: 0px; margin-top: 0px;">This will allow the kernel to cache data in memory for faster access and reduces the amount of data being swapped in and out of swap space at any given time. Simply open<span class="Apple-converted-space"> </span><strong>/etc/sysctl.conf</strong><span class="Apple-converted-space"> </span>in a text editor with root permissions, then append the following line to the bottom of the file:</p> <pre class="command" style="border: 1px dashed rgb(187, 136, 136); margin: 10px; padding: 10px; background-color: rgb(255, 245, 245);">vm.swappiness=10</pre> <p style="padding-top: 0px; margin-top: 0px;">(You will need to restart the session in order for your changes to take effect.) You can tweak this value to see how performance improves. The lower the value, the less you use swap space and the more data is cached to memory. This was the value that seemed to work best with our test system using 512MB RAM. However, this tip isn't just restricted to systems with large amounts of memory - systems with 256MB of RAM or less may see a performance boost if swappiness is increased, as this will cache more data to swap space and free up more memory for day-to-day applications.</p> <p style="padding-top: 0px; margin-top: 0px;">The precise values vary from system to system so this will require some trial and error, especially as reading data from swap space still takes longer than reading it from memory, but the end results are usually worth the effort.</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Speed up ext3</h3> <p style="padding-top: 0px; margin-top: 0px;">You can gain some significant performance benefits by enabling write-back operation in ext3. This tweak isn't restricted to systems running KDE, but it is disabled by default in almost every distro. This is primarily because older hard drives don't support this feature, though newer hard drives can achieve a minor speed boost. This won't affect your day-to-day disk operations, so it is not recommended you try this tweak on a typical home system, but you will see an improvement for the high intensity disk operations that are typically the preserve of servers.</p> <p style="padding-top: 0px; margin-top: 0px;">After making a back up of the file, open<span class="Apple-converted-space"> </span><strong>/etc/fstab</strong><span class="Apple-converted-space"> </span>in a text editor with root permissions and look for a line with the following section of text:</p> <pre class="command" style="border: 1px dashed rgb(187, 136, 136); margin: 10px; padding: 10px; background-color: rgb(255, 245, 245);">relatime,errors=remount-ro</pre> <p style="padding-top: 0px; margin-top: 0px;">and replace it with this:</p> <pre class="command" style="border: 1px dashed rgb(187, 136, 136); margin: 10px; padding: 10px; background-color: rgb(255, 245, 245);">noatime,nodiratime,errors=remount-ro,data=writeback</pre> <p style="padding-top: 0px; margin-top: 0px;">If there is no text either side of this snippet, you have done it wrong! Save and exit this file then open<span class="Apple-converted-space"> </span><strong>/boot/grub/menu.lst</strong>and find the following two lines:</p> <pre class="command" style="border: 1px dashed rgb(187, 136, 136); margin: 10px; padding: 10px; background-color: rgb(255, 245, 245);"># defoptions quiet splash #altoptions=(recoverymode) single</pre> <p style="padding-top: 0px; margin-top: 0px;">They won't be next to each other, but once you find them append the following at the end of both those lines:</p> <pre class="command" style="border: 1px dashed rgb(187, 136, 136); margin: 10px; padding: 10px; background-color: rgb(255, 245, 245);">rootflags=data=writeback</pre> <p style="padding-top: 0px; margin-top: 0px;">then save and exit. Open up a root terminal and run<span class="Apple-converted-space"> </span><strong>update grub</strong>. You then have the option of simply restarting to apply these changes to your file system, or you can apply them on the fly by installing tune2fs from your package manager. If you choose the latter option you would then type the following into a root terminal:</p> <pre class="command" style="border: 1px dashed rgb(187, 136, 136); margin: 10px; padding: 10px; background-color: rgb(255, 245, 245);">tune2fs -o journal_data_writeback /dev/hda1</pre> <p style="padding-top: 0px; margin-top: 0px;">substituting<span class="Apple-converted-space"> </span><strong>/dev/hda1</strong><span class="Apple-converted-space"> </span>with your root partition. Be warned: write-back mode puts you at a little risk of losing data if you machine suddenly powers off, ie if you kick the power cord out, if there's a major system crash or if you get a general power outage</p> <br> <h2 style="margin-top: 40px; margin-bottom: 0px; padding-bottom: 0px;">Optimise Gnome</h2> <p style="padding-top: 0px; margin-top: 0px;">Along with KDE, Gnome is one of the two most widely used desktop environments in the Linux ecosystem, but it's quickly being overtaken by Xfce and other more lightweight alternatives when it comes to performance and speed. However, with just a few of our tweaks, Gnome can keep up with the rest of the pack...</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Install preload</h3> <p style="padding-top: 0px; margin-top: 0px;">Preload is a daemon that analyses what you do on a day-to-day basis and fetches the binaries and files you're most likely to need to boost startup times and general performance. In Ubuntu you just need to search for 'preload' in the package manager, but on other distros it's worth checking that the service is running. To activate the service, type:</p> <pre class="command" style="border: 1px dashed rgb(187, 136, 136); margin: 10px; padding: 10px; background-color: rgb(255, 245, 245);">service preload on</pre> <p style="padding-top: 0px; margin-top: 0px;">After enabling automatic login and installing preload we initiated two restarts on our test machine to give the daemon a chance to monitor the startups. After comparing the two times, we found that preload had trimmed a second off the time it took to get a usable desktop. This doesn't sound a lot, but if it's used in conjunction with your new fast boot time then it's well worth the effort.</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Enable automatic login</h3> <p style="padding-top: 0px; margin-top: 0px;">Yes, we know we're always telling you how important security is, but if you live on your own in a castle that doesn't have internet access then you're probably safe to enable automatic logins. The time saved is the time it would otherwise take you to type your password.</p> <p style="padding-top: 0px; margin-top: 0px;">The GUI method is by far the easiest. Simply head to<span class="Apple-converted-space"> </span><strong>System > Administration > Login Window</strong>. After authenticating yourself, head to the Security tab and check the box next to Automatic Login. You can then choose from the list of users in the drop-down menu who gets logged in automatically.</p> <p style="padding-top: 0px; margin-top: 0px;">Unfortunately for users of Fedora, this option isn't available, so you need to make the necessary changes manually. To enable automatic login you need to open<span class="Apple-converted-space"> </span><strong>/etc/gdm/custom.conf</strong><span class="Apple-converted-space"> </span>in a text editor with root permissions and then append the following to the bottom of the file:</p> <re>[daemon] TimedLoginEnable=True TimedLogin=UserName TimedLoginDelay=0 <p style="padding-top: 0px; margin-top: 0px;">replacing<span class="Apple-converted-space"> </span><strong>UserName</strong><span class="Apple-converted-space"> </span>with the user you would like to log in.</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Use wire frames</h3> <p style="padding-top: 0px; margin-top: 0px;">A common problem with low-powered systems is the lag generated when you click and drag a window. Gnome renders the window as it moves, which can slow performance down, but it has a built-in method to reduce the demand on system resources this causes, which you can activate by typing the following into a terminal:</p> <pre class="command" style="border: 1px dashed rgb(187, 136, 136); margin: 10px; padding: 10px; background-color: rgb(255, 245, 245);">gconftool-2 --type bool --set /apps/metacity/general/ reduced_resources true</pre> <p style="padding-top: 0px; margin-top: 0px;">Now when you click and drag windows you will see wire frames instead of the window contents, which drastically improves performance on under-powered systems (but has little or no effect on others). Note that this trick won't work if you are using Compiz or an alternative window decorator.</p> <div class="image" style="margin: 30px; text-align: center;"><br> <p style="margin: 10px auto auto; padding-top: 0px; font-weight: bold; font-size: 13px; width: 550px; text-align: left;">Gnome's wireframe mode eliminates the overhead of showing window contents whilst resizing or moving them.</p> </div> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Make menus faster</h3> <p style="padding-top: 0px; margin-top: 0px;">If your menus are starting to feel sluggish, the most likely cause is the icon delay. Every time you open the Gnome menu for the first time the icons have to be loaded from their source files. On slower systems this can look a little messy, so there is a timeout deliberately set to ensure the icons are loaded in time for you to see them. However, with modern hardware this is not generally necessary, so the option can safely be adjusted. Create a new file in your home directory named<span class="Apple-converted-space"> </span><strong>.gtkrc-2.0</strong>then open this file in your favourite text editor to type:</p> <pre class="command" style="border: 1px dashed rgb(187, 136, 136); margin: 10px; padding: 10px; background-color: rgb(255, 245, 245);">gtk-menu-popup-delay=0</pre> <p style="padding-top: 0px; margin-top: 0px;">After saving the file, press<span class="Apple-converted-space"> </span><strong>Ctrl+Alt+Backspace</strong><span class="Apple-converted-space"> </span>to reinitialise xserver and your menus should open considerably faster.</p> <br> <h2 style="margin-top: 40px; margin-bottom: 0px; padding-bottom: 0px;">Optimise KDE</h2> <p style="padding-top: 0px; margin-top: 0px;">KDE has received a mixed press lately. Though there's no doubting that its good looks and the new plasmoids set it apart from the competition, KDE 4 still can't match KDE 3 (or even Gnome) for speed and performance. Though this area is in heavy development, a few tweaks can trim valuable seconds off your startup time and make the desktop as a whole much more responsive.</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Disable IPv6</h3> <p style="padding-top: 0px; margin-top: 0px;">Until IPv6 is more implemented, Konqueror has to translate between IPv4 and IPv6 - so if you can get a speed boost by turning off IPv6. The methods are slightly different between distros. For instance, in Kubuntu you need to edit<strong>/etc/environment</strong><span class="Apple-converted-space"> </span>as root and add the following line to the file:</p> <pre class="command" style="border: 1px dashed rgb(187, 136, 136); margin: 10px; padding: 10px; background-color: rgb(255, 245, 245);">KDE_NO_IPV6=True</pre> <p style="padding-top: 0px; margin-top: 0px;">In openSUSE, edit<span class="Apple-converted-space"> </span><strong>/etc/sysconfig/windowmanager</strong><span class="Apple-converted-space"> </span>with root permissions and find this line:</p> <pre class="command" style="border: 1px dashed rgb(187, 136, 136); margin: 10px; padding: 10px; background-color: rgb(255, 245, 245);">KDE_USE_IPV6="yes"</pre> <p style="padding-top: 0px; margin-top: 0px;">then change the answer to<span class="Apple-converted-space"> </span><strong>no</strong>. In both cases you will need to save the file and exit before restarting the session for the changes to take effect.</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Enable automatic login</h3> <p style="padding-top: 0px; margin-top: 0px;">Gnome isn't the only desktop that can benefit from you setting up an automatic login: KDE 4 users can do much the same thing by heading to System Settings and clicking on the Advanced tab. Here you can run the login manager and enable automatic login from the Convenience tab. You'll also need to choose the user you want to log in automatically from the drop-down menu below the checkbox. When you reboot you should miss the login screen altogether and launch straight into the KDE 4 splash screen.</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Start with an empty session</h3> <p style="padding-top: 0px; margin-top: 0px;">By default KDE 4 saves volumes of data about your current session, such as which windows are open and which processes were running so that next time you log in your session is exactly as you left it. This is very convenient, but it also slows your boot time down as this data has to be reloaded on each boot. We can avoid this problem by ensuring that we start with a fresh session. Select System Settings (or Configure Desktop in OpenSUSE) from the KDE menu and in the Advanced tab start the session manager. Towards the bottom of the form select the radio button next to Start With An Empty Session then click Apply.</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Start Konqueror faster</h3> <p style="padding-top: 0px; margin-top: 0px;">We can make Konqueror run much faster by enabling preloading. This uses some memory, but means that the next time you fire up Konqueror it will open in around half the time and in the same place you left it. If you used the previous tweak to start KDE with an empty session then there's no need to panic, as we will configure preloading to run automatically when KDE starts.</p> <p style="padding-top: 0px; margin-top: 0px;">To enable Konqueror preloading, open up the browser and head to<span class="Apple-converted-space"> </span><strong>Settings > Configure Konqueror</strong>. In the Performance section check the box next to<span class="Apple-converted-space"> </span><strong>Preload An Instance After KDE Startup</strong>. You can also set how many instances of Konqueror are preloaded at startup depending on how many Konqueror windows you tend to run at any one given time.</p> <br> <h2 style="margin-top: 40px; margin-bottom: 0px; padding-bottom: 0px;">Boost your network</h2> <p style="padding-top: 0px; margin-top: 0px;">You've tweaked your router, optimised your server and replaced all your broadband filters in your house - and you still have a slow connection. Before you make an angry phone call to your ISP, there's a possibility that the client machine may be the bottleneck. With just a few of these tweaks you can improve your connections, or at the very least eliminate your client machine as the single point of failure.</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Use hostname 'localhost'</h3> <p style="padding-top: 0px; margin-top: 0px;">This doesn't cause a drastic improvement on its own, but in conjunction with the other network tricks here can improve your local machine's network performance. Simply open<span class="Apple-converted-space"> </span><strong>/etc/hosts</strong><span class="Apple-converted-space"> </span>in a text editor with root permissions and change the top two lines to:</p> <pre class="command" style="border: 1px dashed rgb(187, 136, 136); margin: 10px; padding: 10px; background-color: rgb(255, 245, 245);">127.0.0.1 localhost yourhost 127.0.1.1 yourhost</pre> <p style="padding-top: 0px; margin-top: 0px;">where yourhost is the name of the machine (ie bobdesktop). Ensure you keep a backup of your<span class="Apple-converted-space"> </span><strong>/etc/hosts</strong><span class="Apple-converted-space"> </span>file, as not all distros are compatible with this!</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Optimise TCP settings</h3> <p style="padding-top: 0px; margin-top: 0px;">Distros come preconfigured for "average" internet users, but in a world of 3G, dial-up and ADSL there is no such thing as an average user. Now edit<span class="Apple-converted-space"> </span><strong>/etc/sysctl.conf</strong><span class="Apple-converted-space"> </span>as root and append the following:</p> <pre class="command" style="border: 1px dashed rgb(187, 136, 136); margin: 10px; padding: 10px; background-color: rgb(255, 245, 245);">net.ipv4.tcp_timestamps = 0 net.ipv4.tcp_sack = 1</pre> <p style="padding-top: 0px; margin-top: 0px;">(This may take some trial and error, so keep a backup of the files you edit.) The top line removes timestamps and so relieves all incoming and outgoing packets of a 12k overhead. The bottom line enables selective acknowledgements, which means fewer checks are initiated on each packet so they are delivered quicker. We don't recommend the latter tweak for dial-up connections as this increases the number of packets which need to be resent.</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Metrics and backlogs</h3> <p style="padding-top: 0px; margin-top: 0px;">You can further optimise your TCP settings by appending the following lines to the same text file:</p> <pre class="command" style="border: 1px dashed rgb(187, 136, 136); margin: 10px; padding: 10px; background-color: rgb(255, 245, 245);">net.ipv4.tcp_no_metrics_save = 1 net.core.netdev_max_backlog = 2500</pre> <p style="padding-top: 0px; margin-top: 0px;">The top line speeds up connections by ensuring that TCP metrics are not saved for each individual packet. The second line dictates the backlog of packets allowed. To give an idea of the scale of the figure you should use for your backlog, around 2,000 is recommended for wireless or older Ethernet connections, and around 5,000 for a 1GB Ethernet cable to broadband connection. On the other hand, this figure can rise up to 30,000 for an expensive 10GB Ethernet cable. The slower the connection, the lower your backlog should be, as the aim of this tweak is to clear outstanding packets as soon as possible in order to boost connection speeds.</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">TCP window scaling</h3> <p style="padding-top: 0px; margin-top: 0px;">The TCP window settings define the minimum and maximum size of packets we can send and recieve. Dial-up users will see a speed boost with smaller packet sizes while broadband users will see a speed boost with larger packet sizes. Edit<strong>/etc/sysctl.conf</strong><span class="Apple-converted-space"> </span>as root, and append this:</p> <pre class="command" style="border: 1px dashed rgb(187, 136, 136); margin: 10px; padding: 10px; background-color: rgb(255, 245, 245);">net.ipv4.tcp_window_scaling = 1 net.ipv4.tcp_wmem = 10240 87380 16777216 net.ipv4.tcp_rmem = 10240 87380 16777216 net.ipv4.tcp_mem = 16777216 16777216 16777216 net.core.rmem_max = 16777216 net.core wmem_max = 16777216</pre> <p style="padding-top: 0px; margin-top: 0px;">Those figures are optimised for a 2Mbps connection on Sky broadband over a wireless connection, but the packet size recommendation for any given connection is usually maximum bandwidth divided by latency. You can find these figures by heading to<span class="Apple-converted-space"> </span><a href="http://www.speedtest.net/" style="color: rgb(0, 136, 187);">www.speedtest.net</a>, and you can also analyse how your changes are affecting your connection via<a href="http://www.speedguide.net:8080" style="color: rgb(0, 136, 187);">www.speedguide.net:8080</a>.</p> <div class="image" style="margin: 30px; text-align: center;"><img src="cid:part1.01080302.03050607@gmail.com" alt="www.speedguide.net can give you an indication of which values and tweaks will improve your network connection." style="border: 1px solid rgb(51, 51, 51);"> <p style="margin: 10px auto auto; padding-top: 0px; font-weight: bold; font-size: 13px; width: 550px; text-align: left;"><a href="http://www.speedguide.net" style="color: rgb(0, 136, 187);">www.speedguide.net</a><span class="Apple-converted-space"> </span>can give you an indication of which values and tweaks will improve your network connection.</p> </div> <br> <h2 style="margin-top: 40px; margin-bottom: 0px; padding-bottom: 0px;">Faster Firefox</h2> <p style="padding-top: 0px; margin-top: 0px;">Continuing with the networking theme, you can optimise much more than just your TCP settings. Mozilla Firefox has a raft of options cunningly hidden from users that can untap the browser's potential...</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Disable IPv6 (again!)</h3> <p style="padding-top: 0px; margin-top: 0px;">With this tweak we will simply amend an existing value. Type the following into the search bar:<span class="Apple-converted-space"> </span><strong>network.dns.disableIPv6</strong></p> <p style="padding-top: 0px; margin-top: 0px;">You shouldn't have to type out the whole thing, as the listings change dynamically as you're typing. Simply double-click on the entry to change the default value of "False" to "True".</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Render pages faster</h3> <p style="padding-top: 0px; margin-top: 0px;">Create a new integer value in<span class="Apple-converted-space"> </span><strong><a class="moz-txt-link-freetext" href="about:config">about:config</a></strong><span class="Apple-converted-space"> </span>named<span class="Apple-converted-space"> </span><strong>content.notify.backoffcount</strong><span class="Apple-converted-space"> </span>and set the value to<span class="Apple-converted-space"> </span><strong>5</strong><span class="Apple-converted-space"> </span>so that Firefox won't wait for the entire page to download before rendering. You can also create a value with the name<strong>nglayout.initialpaint.delay</strong><span class="Apple-converted-space"> </span>and set the value to<span class="Apple-converted-space"> </span><strong>zero</strong>. This ensures that Firefox doesn't wait for the page layout information to be fully downloaded before rendering.</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Optimise your history</h3> <p style="padding-top: 0px; margin-top: 0px;">If you reduce the amount of web history that Firefox stores, it will load faster and also save you some disk space. Type the following in the search bar:<span class="Apple-converted-space"> </span><strong>browser.history</strong><span class="Apple-converted-space"> </span>and change<span class="Apple-converted-space"> </span><strong>browser.history_expires_days</strong><span class="Apple-converted-space"> </span>and<strong>browser.history_expires_min</strong><span class="Apple-converted-space"> </span>to<span class="Apple-converted-space"> </span><strong>zero</strong>. You can also use low numbers if you want to keep some browser history.</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">More TCP tweaks</h3> <p style="padding-top: 0px; margin-top: 0px;">Change the<span class="Apple-converted-space"> </span><strong>network.http.pipelining</strong><span class="Apple-converted-space"> </span>and<span class="Apple-converted-space"> </span><strong>network.http.proxy.pipelining</strong><span class="Apple-converted-space"> </span>values to "True" and then set<strong>network.http.pipelining.maxrequests</strong><span class="Apple-converted-space"> </span>to<span class="Apple-converted-space"> </span><strong>8</strong><span class="Apple-converted-space"> </span>instead of<span class="Apple-converted-space"> </span><strong>4</strong>. These tweaks boost performance for broadband users as we use a TCP technique known as pipelining, which allows Firefox to make multiple requests on a single connection.</p> <div class="image" style="margin: 30px; text-align: center;"><br> <p style="margin: 10px auto auto; padding-top: 0px; font-weight: bold; font-size: 13px; width: 550px; text-align: left;">Any mistakes here could break Firefox, so once you've made a backup and a vow of honour you can unleash the power hidden in your browser.</p> </div> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Speed up menus</h3> <p style="padding-top: 0px; margin-top: 0px;">Start by typing<span class="Apple-converted-space"> </span><strong><a class="moz-txt-link-freetext" href="about:config">about:config</a></strong><span class="Apple-converted-space"> </span>and accepting the warning that comes up (you will need to do this for all these Firefox tips). The listing you see is much like the Firefox equivalent of the Windows registry, which means that though this is a very powerful way to tweak your browser you can cause serious stability problems if you get it wrong.</p> <p style="padding-top: 0px; margin-top: 0px;">We can make our Firefox menus load faster by adding our own value to the listing. Right-click anywhere in the listing and then click<span class="Apple-converted-space"> </span><strong>New > Integer</strong>. Use<span class="Apple-converted-space"> </span><strong>ui.submenuDelay</strong><span class="Apple-converted-space"> </span>as the name and then set the value to<span class="Apple-converted-space"> </span><strong>zero</strong>. When you restart Firefox you should notice that your menus load noticeably faster, as you have removed the delay for the menu popups.</p> <br> <h2 style="margin-top: 40px; margin-bottom: 0px; padding-bottom: 0px;">Speed up your software</h2> <p style="padding-top: 0px; margin-top: 0px;">Almost all mature applications have options hidden away in the GUI that can boost their performance on your system, so if we've given you the tweaking bug there's plenty of scope for further experimentation. Whether you're shaving a few seconds of boot time off OpenOffice.org or improving the backbone of your system, the applications that make up your Linux system are what it's all about.</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">The fastest mirror</h3> <p style="padding-top: 0px; margin-top: 0px;">Open a root terminal and type:<span class="Apple-converted-space"> </span><strong>yum install yum-fastestmirror</strong>. This well-known Yum plugin ensures that you always download packages from the fastest mirror, which could save minutes on large distro downloads.</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Avoid rechecking</h3> <p style="padding-top: 0px; margin-top: 0px;">Every time you update or install a package Yum has a tendancy to re-download all the metadata packages from each server, which isn't ideal for users with slow connections. You can resolve this by downloading the entire cache in one go and allowing Yum to then refer to this rather than the online sources. Fire up a root terminal and type:</p> <pre class="command" style="border: 1px dashed rgb(187, 136, 136); margin: 10px; padding: 10px; background-color: rgb(255, 245, 245);">yum checkcache</pre> <p style="padding-top: 0px; margin-top: 0px;">We recommend you run this command at least once a week to keep the list up to date.</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Faster OpenOffice.org</h3> <p style="padding-top: 0px; margin-top: 0px;">We often harp on about how slow OpenOffice.org is, but it doesn't have to be like that. With just one tweak you can remedy the problem, and with further alterations the latest OpenOffice.org can run on much older hardware. So, before you ditch this office suite forever and use AbiWord and Gnumeric instead, try monkeying with the settings under<span class="Apple-converted-space"> </span><strong>Tools > Options > Memory</strong><span class="Apple-converted-space"> </span>to reduce the amount of RAM that OOo chews up.</p> <p style="padding-top: 0px; margin-top: 0px;">One easy tweak here that we recommend is to reduce the number of undo steps from the default value of 100 to somewhere between 20 and 30. That way you use less memory than before but still gain the benefits of having an undo function. Another thing you can do is to enable the Systray quick starter (in the bottom of the window). This enables you to keep an instance of OOo in the cache, so you can restart more quickly.</p> <div class="image" style="margin: 30px; text-align: center;"><br> <p style="margin: 10px auto auto; padding-top: 0px; font-weight: bold; font-size: 13px; width: 550px; text-align: left;">Make OOo more efficient in Tools > Options > Memory.</p> </div> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Increase graphics cache</h3> <p style="padding-top: 0px; margin-top: 0px;">On systems with under 512MB RAM, use a graphics cache of between 32MB and 64MB, but for systems with 512MB or over we recommend a cache size of at least 128MB, as the additional memory will help large apps such as OOo run that little bit faster.</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Remove items from memory</h3> <p style="padding-top: 0px; margin-top: 0px;">Also in the OpenOffice.org Memory dialog we can define how long OOo leaves things before refreshing its cache. On a system with 256MB RAM or less we recommend setting the refresh to 0:30 (every 30 minutes) as more frequent reloads will cause OOo to lock up or become sluggish. For users of higher-end systems, the 10-minute default is usually fine.</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Clean out Yum</h3> <p style="padding-top: 0px; margin-top: 0px;">For peace of mind and more disk space it makes sense to ensure that Yum's cache doesn't contain any redundant packages. To do so, open a root terminal and type:<span class="Apple-converted-space"> </span><strong>yum clean all</strong>. Ensure you run this before you do any other optimisations for Yum, as this operation will reset them.</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Try Opera</h3> <p style="padding-top: 0px; margin-top: 0px;">It may only be free as in beer and not as in speech, but Opera is a lightweight and very capable alternative to Firefox that's fast enough already even without any optimisation tweaks. It integrates additional tools to handle mail, file sharing and even IRC chats. The Opera community has developed thousands of skins and plugins, and with recent releases personal web space and even a personal web server have been included free of charge.</p> <div class="image" style="margin: 30px; text-align: center;"><br> <p style="margin: 10px auto auto; padding-top: 0px; font-weight: bold; font-size: 13px; width: 550px; text-align: left;">Opera - not free as in freedom, but still a great, memory-friendly web browser.</p> </div> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Install apt-fast</h3> <p style="padding-top: 0px; margin-top: 0px;">The apt-fast script can provide a huge speed boost to package management, as we use Axel as a drop-in replacement download manager for Aptitude rather than the traditional wget. You will need to install Axel through Aptitude and then open a text-editor with root permissions and paste the shell code from<span class="Apple-converted-space"> </span><a href="http://www.mattparnell.com/projects/apt-fast-and-axel-roughly-26x-faster-apt-get-installations-and-upgrades.html" style="color: rgb(0, 136, 187);">here</a><span class="Apple-converted-space"> </span>directly into the file. Then we recommend you save it as<span class="Apple-converted-space"> </span><strong>/usr/local/bin/apt-fast</strong><span class="Apple-converted-space"> </span>(no extension) and close the text editor before opening a root terminal and typing:</p> <pre class="command" style="border: 1px dashed rgb(187, 136, 136); margin: 10px; padding: 10px; background-color: rgb(255, 245, 245);">chmod +x /usr/local/bin/apt-fast</pre> <p style="padding-top: 0px; margin-top: 0px;">To use the script, try this as root:<span class="Apple-converted-space"> </span><strong>apt-fast install packagename</strong><span class="Apple-converted-space"> </span>or simply use apt-fast update and apt-fast upgrade to update all your packages. The script may be slow in some cases, as the tweaks you made to Aptitude will not apply to the script, and Axel does not use Aptitude's cache.</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Get a better download mirror</h3> <p style="padding-top: 0px; margin-top: 0px;">Head to<span class="Apple-converted-space"> </span><strong>System > Administration > Software Sources</strong><span class="Apple-converted-space"> </span>in Gnome and select<span class="Apple-converted-space"> </span><strong>Other</strong><span class="Apple-converted-space"> </span>from the drop-down menu next to Server Location. Then click<span class="Apple-converted-space"> </span><strong>Select Best Server</strong><span class="Apple-converted-space"> </span>and wait for the checks to finish. When this is finished, close the window and let your distro update its sources.</p> <p style="padding-top: 0px; margin-top: 0px;">A common problem with this method is that the update window can freeze and go grey. (This is a known issue with older versions of Ubuntu.) This can be resolved by closing the window (using the Force Quit Gnome applet if necessary by right-clicking the panel and selecting Add to Panel) and then running Add/Remove Software to update the sources.</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Halt Java</h3> <p style="padding-top: 0px; margin-top: 0px;">The JRE in OpenOffice.org is the main culprit for the slow startups. You don't need the JRE to run in a day to day environment, so you can safely disable it, and in the event you do need the JRE you can quickly re-enable it. Simply head to<span class="Apple-converted-space"> </span><strong>Tools > Options</strong><span class="Apple-converted-space"> </span>and select Java in the left-hand box. To disable the JRE simply uncheck the box next to Use A Java Runtime Environment.</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Remove old packages</h3> <p style="padding-top: 0px; margin-top: 0px;">Run this to remove orphaned dependancies with APT:</p> <pre class="command" style="border: 1px dashed rgb(187, 136, 136); margin: 10px; padding: 10px; background-color: rgb(255, 245, 245);">apt-get autoremove</pre> <p style="padding-top: 0px; margin-top: 0px;">and to remove all package files from the cache:</p> <pre class="command" style="border: 1px dashed rgb(187, 136, 136); margin: 10px; padding: 10px; background-color: rgb(255, 245, 245);">apt-get clean</pre> <p style="padding-top: 0px; margin-top: 0px;">Use autoclean rather than clean to remove old versions of packages. Make sure you're root!</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Reduce history</h3> <p style="padding-top: 0px; margin-top: 0px;">By reducing the amount of history that Opera keeps we can reduce the time it takes to initialise it and also curtail Opera reloading its history every five hours. This is achieved by heading to<span class="Apple-converted-space"> </span><strong>Tools > Preferences</strong><span class="Apple-converted-space"> </span>and clicking on the<span class="Apple-converted-space"> </span><strong>Advanced</strong>tab. Select<span class="Apple-converted-space"> </span><strong>History</strong><span class="Apple-converted-space"> </span>from the left-hand side and then click<span class="Apple-converted-space"> </span><strong>Clear</strong><span class="Apple-converted-space"> </span>in the Addresses section. Then set the value as anything from 0 to 1,000, which will be considerably less than the default. You can also uncheck<span class="Apple-converted-space"> </span><strong>Remember Content On Visited Pages</strong><span class="Apple-converted-space"> </span>to save further disk space.</p> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Hey Presto</h3> <p style="padding-top: 0px; margin-top: 0px;">Sometimes updates vary very little from their previous download, especially if it's just a bug fix. If you want to download only the changes, run this as root to install the Presto plugin for Yum:</p> <pre class="command" style="border: 1px dashed rgb(187, 136, 136); margin: 10px; padding: 10px; background-color: rgb(255, 245, 245);">yum install yum-presto</pre> <h3 style="margin-top: 30px; margin-bottom: 0px; padding-bottom: 0px;">Disable name completion</h3> <p style="padding-top: 0px; margin-top: 0px;">Users with low-end systems may find that pictures and the auto-completing navigation bar in Opera can be a little sluggish at times. We can remedy the first issue by disabling Turbo, which pre-draws images before they are loaded. Look in<strong><a class="moz-txt-link-freetext" href="about:config">about:config</a></strong><span class="Apple-converted-space"> </span>for the<span class="Apple-converted-space"> </span><strong>Turbo Mode</strong><span class="Apple-converted-space"> </span>option in<span class="Apple-converted-space"> </span><strong>User Prefs</strong>, then uncheck it. To disable name completion, choose<span class="Apple-converted-space"> </span><strong>Tools > Preferences > Advanced > Network > Server name completion</strong>, then uncheck<span class="Apple-converted-space"> </span><strong>Look For Local Network Machine<br> </strong></p> <p style="padding-top: 0px; margin-top: 0px;">source: tuxradar.com/content/make-linux-faster-and-lighter<br> </p> </re></span></span> ARVhttp://www.blogger.com/profile/13867592943489571397noreply@blogger.com0tag:blogger.com,1999:blog-4205825614598938724.post-82034056936564159862010-08-18T04:39:00.001-07:002010-08-18T04:39:49.141-07:00increase internet speed in ubuntu<p>Internet speeds in Ubuntu can be increased. Simply follow the steps.</p> <ul> <li>Open a Terminal via <em>Applications->Accessories->Terminal</em> and type the following</li> </ul> <p> <em>sudo vim /etc/sysctl.conf</em> (press i for edit mode)</p> <ul> <li>Then Paste the Following at the end of the file:</li> </ul> <pre> ## increase TCP max buffer size setable using setsockopt() net.core.rmem_max = 16777216 net.core.wmem_max = 16777216 ## increase Linux autotuning TCP buffer limits ## min, default, and max number of bytes to use ## set max to at least 4MB, or higher if you use very high BDP paths net.ipv4.tcp_rmem = 4096 87380 16777216 net.ipv4.tcp_wmem = 4096 65536 16777216 ## don't cache ssthresh from previous connection net.ipv4.tcp_no_metrics_save = 1 net.ipv4.tcp_moderate_rcvbuf = 1 ## recommended to increase this for 1000 BT or higher net.core.netdev_max_backlog = 2500 ## for 10 GigE, use this, uncomment below ## net.core.netdev_max_backlog = 30000 ## Turn off timestamps if you're on a gigabit or very busy network ## Having it off is one less thing the IP stack needs to work on ## net.ipv4.tcp_timestamps = 0 ## disable tcp selective acknowledgements. net.ipv4.tcp_sack = 0 ##enable window scaling net.ipv4.tcp_window_scaling = 1 </pre> <p> </p> <ul> <li>Then type the follwing to exit and save what you have just done. Press ESC to quit the edit mode and type the following.</li> </ul> <p> <em>:wq</em></p> <ul> <li>Then type the following to to apply the settings.</li> </ul> <pre> <em>sudo sysctl -p </em> </pre> <ul> <li>You can disable all these settings by removing these lines you added via:</li> </ul> <pre> <em>sudo gedit /etc/sysctl.conf</em> Courtesy: ubuntumanual.org</pre> ARVhttp://www.blogger.com/profile/13867592943489571397noreply@blogger.com0tag:blogger.com,1999:blog-4205825614598938724.post-44664237661781543932010-08-18T04:33:00.001-07:002010-08-18T04:33:13.572-07:00Local DNS Cache for Faster Browsing<p>A DNS server resolves domain names into IP addresses. So when you request “google.com” for example, the DNS server finds out the address for the domain, and sends your request the right way. </p> <p>You can run a DNS cache on your computer. This will speed up the process of looking up domain names when browsing. The difference is about 30-60 ms for me. Multiply that difference by the number of websites you visit a day for an approximate estimate of the speed improvement. Of course, all this would be worth it if it weren’t for the fact that setting this up is way too easy.</p> <p>The following instructions are for someone with a cable (broadband) internet connection, where the computer gets it’s local IP address using DHCP from the router in your house/office:</p> <p>The package we will be using for caching nameserver lookups is called <a href="http://packages.ubuntu.com/dnsmasq">dnsmasq</a>. So first, install it using:<br> <code>$sudo apt-get install dnsmasq</code><br> (If you can’t find then, then you probably haven’t added the Universe repository to your list of repositories.)</p> <p>No uncomment the following line (that is edit the line to NOT have a “#” in the beginning) in the file <code>/etc/dnsmasq.conf</code>:<br> <code>listen-address=127.0.0.1</code></p> <p>Now edit <code>/etc/dhcp3/dhclient.conf</code> and make sure the section below exactly like this, especially the line that says “prepend domain-name-servers 127.0.0.1;”<br> <code><br> #supersede domain-name "fugue.com home.vix.com";<br> prepend domain-name-servers 127.0.0.1;<br> request subnet-mask, broadcast-address, time-offset, routers,<br> domain-name, domain-name-servers, host-name,<br> netbios-name-servers, netbios-scope;<br> </code></p> <p>Explanation for the above change: In the normal case, when you get a new dhcp lease, the dhcp3 client (tool) on your computer gets a new lease, and updates the <code>/etc/resolv.conf</code> file on your computer with the right values for the DNS servers to use (usually some machine in the network of your hosting provider). Adding the “prepend” option as we did above ensures that “127.0.0.1″ will appear on the top of the list of DNS servers. That magic number refers to your own computer. So in the future, whenever your computer needs to resolve a domain name, it will forward that request to dnsmasq (which is running at 127.0.0.1 – your computer). If the details for the domain name are already in you cache, well and good, dnsmasq will serve it up and make the process real fast. If it is not in the cache, then dnsmasq will look at the /etc/resolv.conf file and use the nameservers listed below the “127.0.0.1″. I hope that explains things.</p> <p>Now open the file <code>/etc/resolv.conf</code> in your text editor. It probably looks like:<br> <code><br> search yourisp.com<br> nameserver 217.54.170.023<br> nameserver 217.54.170.024<br> nameserver 217.54.170.026<br> </code></p> <p>The 127.0.0.1 is missing right now since you haven’t renewed your lease after you edited the /etc/dhcp3/dhclient.conf file. So, let us add that in manually this one time. After you do, your /etc/resolv.conf file will look like the following:<br> <code><br> search yourisp.com<br> nameserver 127.0.0.1<br> nameserver 217.54.170.023<br> nameserver 217.54.170.024<br> nameserver 217.54.170.026<br> </code><br> Don’t worry if the numbers are different – if they are not, then hey – we must be neighbours <img src="cid:part1.02070106.05070201@gmail.com" alt=";)" class="wp-smiley"> </p> <p>Okay. We are almost done here. All we have to do now is to restart dnsmasq so that the changes we made to the configuration file take effect. You can do that using the command:<br> <code>$sudo /etc/init.d/dnsmasq restart</code>.</p> <p>Now you are running a local DNS cache. If you want to measure your speed improvement, type the command:<br> <code>$dig google.com</code><br> You will see something like “;; Query time: 38 msec” there.<br> Now type the command again, and you should see something like:”;; Query time: 2 msec”</p> <p>See, the first time, since google.com’s details were not in your cache (you are using it for the first time), the query took 38 ms. The second time, the cache speeds up the lookup. I have been using this for over a month now, and haven’t had a problem.<br> source : embraceubuntu.com<br> </p> ARVhttp://www.blogger.com/profile/13867592943489571397noreply@blogger.com0tag:blogger.com,1999:blog-4205825614598938724.post-1834441319579729332010-08-15T19:21:00.001-07:002010-08-15T19:21:40.497-07:00HOW TO FIX BROKEN PACKAGES<div>How to fix broken packages</div><div> 'Broken packages' are packages that have unsatisfied dependencies. If broken packages are detected, Synaptic will not allow any further changes to the system until all broken packages have been fixed.</div> <div><br></div><div>To fix broken packages</div><div>Choose Edit > Fix Broken Packages from the menu.</div><div>Choose Apply Marked Changes from the Edit menu or press Ctrl + P.</div><div>Confirm the summary of changes and click Apply.</div> <div>If that does not help, then please follow this procedure:</div><div><br></div><div><a href="https://help.ubuntu.com/community/PackageManagerTroubleshootingProcedure">https://help.ubuntu.com/community/PackageManagerTroubleshootingProcedure</a></div> <div><br></div><div>How to free disk space</div><div>Settings -> Preferences -> Files -> Delete downloaded packages after installation then click Delete Cached Package Files.</div><div><br></div><div>Broken Upgrade or Installation</div> <div>What to do if an installation process fails and you find it is no longer possible to install or remove packages:</div><div>Open a Terminal and type the following commands, pressing the Return or Enter key after each (you may have to type in your password):</div> <div>sudo dpkg --configure -a</div><div>sudo apt-get install -f</div><div>Browser works, Synaptic will not</div><div>(note: probably inaccurate or outdated)</div><div><br></div><div>If the router is set to auto discover DNS then Synaptic will fail. Resolve this by setting up a static ip address and manually set DNS ip in router. Now Ubuntu (system-administration-networking) config static ip and enter your ISP dns ip and delete router DNS ip which will look something like 192.168.1.1</div> ARVhttp://www.blogger.com/profile/13867592943489571397noreply@blogger.com0tag:blogger.com,1999:blog-4205825614598938724.post-15456863293650003392010-07-31T09:38:00.000-07:002010-07-31T09:39:10.507-07:00Remove Docky icon from docky<br> <ul> <li>Press ALT + F2 </li> <li>Type command “<i>gconf-editor</i>" and hit enter/return </li> <li>Navigate to<span><span> "<i>apps/docky-2/docky/items/DockyItem</i>" </span></span>in the gconf-editor </li> <li>Uncheck "<i>ShowDockyItem</i>" </li> <li>Restart Docky </li> </ul> <div><br> </div> <div></div> <div><b>Terminal way</b></div> <div>If you're lazy and want to do this via the terminal you can do so using the following commands.</div> <span><span><b>this command will turn the icon off:</b> <ul> <li>gconftool-2 --type Boolean --set /apps/docky-2/Docky/Items/DockyItem/ShowDockyItem False</li> </ul> <b>this will turn it back on:</b> <ul> <li>gconftool-2 --type Boolean --set /apps/docky-2/Docky/Items/DockyItem/ShowDockyItem True</li> </ul> <div>Remember that you will need to restart Docky to see the changes. </div> </span></span> ARVhttp://www.blogger.com/profile/13867592943489571397noreply@blogger.com0tag:blogger.com,1999:blog-4205825614598938724.post-31500559827987884802010-07-27T11:16:00.000-07:002010-07-27T11:17:24.565-07:00Remove "Mounted Disks" from your Linux (ubuntu) desktop.<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span class="Apple-style-span" style="font-family: arial,helvetica,clean,sans-serif; font-size: 15px; line-height: 18px; text-align: left;"> <p style="margin: 20px 0px; padding: 0px; color: rgb(51, 51, 51); font-size: 14px; font-family: Verdana; line-height: 17px;">Just type in gconf-editor into the Alt+F2 run dialog to open the app. <br> Now browse down to the following key:<br> </p> <p style="margin: 20px 0px; padding: 0px; color: rgb(51, 51, 51); font-size: 14px; font-family: Verdana; line-height: 17px;">apps \ nautilus \ desktop<br> <br> You should see a key in the right-hand pane called volumes_visible. Remove the checkbox from it, and the icons will instantly disappear from the desktop.<br class="Apple-interchange-newline"> I prefer a clean desktop with no icons cluttering it up, but by default Ubuntu adds icons to the desktop for every single removable drive that you attach to your system.</p> <p style="margin: 20px 0px; padding: 0px; color: rgb(51, 51, 51); font-size: 14px; font-family: Verdana; line-height: 17px;"><img src="cid:part1.05000101.09020303@gmail.com" style="border-width: 0px; margin-left: -2px;" height="245" width="161"></p> <p style="margin: 20px 0px; padding: 0px; color: rgb(51, 51, 51); font-size: 14px; font-family: Verdana; line-height: 17px;">Having recently transitioned to using Ubuntu full-time at home (instead of just part-time), this was one of the first things I wanted to disable. Sadly there’s no option in the default configuration screens, so we’ll have to use the “registry editor” for Ubuntu, called gconf-editor.</p> <p style="margin: 20px 0px; padding: 0px; color: rgb(51, 51, 51); font-size: 14px; font-family: Verdana; line-height: 17px;">Just type in<span class="Apple-converted-space"> </span><em style="font-style: italic; font-weight: normal;">gconf-editor</em><span class="Apple-converted-space"> </span>into the Alt+F2 run dialog to open the app. </p> <p style="margin: 20px 0px; padding: 0px; color: rgb(51, 51, 51); font-size: 14px; font-family: Verdana; line-height: 17px;"> <img src="cid:part2.09030805.07030500@gmail.com" style="border-width: 0px; margin-left: -2px;" height="212" width="552"></p> <p style="margin: 20px 0px; padding: 0px; color: rgb(51, 51, 51); font-size: 14px; font-family: Verdana; line-height: 17px;">Now browse down to the following key:</p> <blockquote style="border: 1px dashed rgb(47, 111, 171); margin: 0px; padding: 4px 4px 4px 6px; text-align: left; clear: both; color: black; background-color: rgb(249, 249, 249); line-height: 1.1em; font-family: monospace;"> <p style="margin: 10px 0px; padding: 0px; color: rgb(51, 51, 51); font-size: 14px; font-family: Verdana; line-height: 17px;">apps \ nautilus \ desktop</p> </blockquote> <p style="margin: 20px 0px; padding: 0px; color: rgb(51, 51, 51); font-size: 14px; font-family: Verdana; line-height: 17px;"><img src="cid:part3.01090200.01010301@gmail.com" style="border-width: 0px; margin-left: -2px;" height="347" width="516"></p> <p style="margin: 20px 0px; padding: 0px; color: rgb(51, 51, 51); font-size: 14px; font-family: Verdana; line-height: 17px;">You should see a key in the right-hand pane called<span class="Apple-converted-space"> </span><em style="font-style: italic; font-weight: normal;">volumes_visible</em>. Remove the checkbox from it, and the icons will instantly disappear from the desktop.</p> </span></span> ARVhttp://www.blogger.com/profile/13867592943489571397noreply@blogger.com0tag:blogger.com,1999:blog-4205825614598938724.post-8967500004913147562010-07-27T11:04:00.000-07:002010-07-27T11:05:02.097-07:00Set up Internet Connection Sharing(using LAN ) in Linux (Ubuntu) between any computers<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span class="Apple-style-span" style="font-family: 'Helvetica Neue','Lucida Grande',Helvetica,Arial,Verdana,sans-serif; font-size: 14px;"> <p class="line874">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.<span class="anchor" id="line-7"></span><span class="anchor" id="line-8"></span></p> <p class="line874">Situations in which ICS may be necessary include:<span class="anchor" id="line-9"></span></p> <ul> <li>dial up connection<span class="anchor" id="line-10"></span></li> <li>authenticated (PPPoA/E) connection<span class="anchor" id="line-11"></span></li> <li>wireless connection<span class="anchor" id="line-12"></span></li> <li>When it is impractical (such as with distance) to run multiple network cables to each computer.<span class="anchor" id="line-13"></span><span class="anchor" id="line-14"></span></li> </ul> <p class="line867"></p> <h2 id="GUI Method via Network Manager (Ubuntu 9.10 and up)" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.3em;">GUI Method via Network Manager (Ubuntu 9.10 and up)</h2> <span class="anchor" id="line-15"></span> <p class="line874">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".<span class="anchor" id="line-16"></span><span class="anchor" id="line-17"></span></p> <p class="line874">When you are logged in:<span class="anchor" id="line-18"></span></p> <ul> <li>Go to "System" on your top bar<span class="anchor" id="line-19"></span></li> <li>Navigate to "Preferences" and select "Network Connections"<span class="anchor" id="line-20"></span></li> <li>When that window opens, select "Auto eth0" and press "Edit"<span class="anchor" id="line-21"></span><span class="anchor" id="line-22"></span></li> </ul> <p class="line874">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.<span class="anchor" id="line-23"></span><span class="anchor" id="line-24"></span></p> <p class="line867"></p> <h2 id="Ubuntu Internet Gateway Method (iptables)" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.3em;">Ubuntu Internet Gateway Method (iptables)</h2> <span class="anchor" id="line-25"></span> <p class="line862">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<span class="Apple-converted-space"> </span><em>eth0</em>. The other card connects to your internal network, we will call this<em>eth1</em>. It is also possible to do ICS with a single network card. In this case, use<span class="Apple-converted-space"> </span><em>eth0</em><span class="Apple-converted-space"> </span>for the internet and<span class="Apple-converted-space"> </span><em>eth0:0</em><span class="Apple-converted-space"> </span>for the internal network.<span class="anchor" id="line-26"></span><span class="anchor" id="line-27"></span></p> <ol type="1"> <li> <p class="line862" style="margin: 0.25em 0px;">Internet <<==>> eth0 <> Ubuntu gateway <> eth1 <<==>> Client PC<span class="anchor" id="line-28"></span></p> </li> <li> <p class="line862" style="margin: 0.25em 0px;">Internet <<==>> ppp0 <> Ubuntu gateway <> eth1 <<==>> Client PC<span class="anchor" id="line-29"></span></p> </li> <li> <p class="line862" style="margin: 0.25em 0px;">Internet <<==>> eth0 <> Ubuntu gateway <> eth0:0 <<==>> Client PC<span class="anchor" id="line-30"></span><span class="anchor" id="line-31"></span></p> </li> </ol> <p class="line867"></p> <h3 id="Gateway set up" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.1em;">Gateway set up</h3> <span class="anchor" id="line-32"></span> <p class="line874">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.<span class="anchor" id="line-33"></span><span class="anchor" id="line-34"></span></p> <p class="line862">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<span class="Apple-converted-space"> </span><a class="http" href="http://en.wikipedia.org/wiki/Ip_address#IPv4_private_addresses" style="border-width: 0px; color: rgb(217, 13, 25);">private IP subnet</a><span class="Apple-converted-space"> </span>can be used for the internal network IP addresses.<span class="anchor" id="line-35"></span><span class="anchor" id="line-36"></span></p> <p class="line874">In summary:<span class="anchor" id="line-37"></span></p> <ul> <li style="list-style-type: none;"> <p class="line862" style="margin: 0.25em 0px;">eth0 = the network adapter with internet (external or WAN).<br> <span class="anchor" id="line-38"></span>eth1 = the network adapter to which a second computer is attached (internal or LAN).<br> <span class="anchor" id="line-39"></span>192.168.0.x = IP subnet for eth1<br> <span class="anchor" id="line-40"></span><span class="anchor" id="line-41"></span></p> </li> </ul> <p class="line874">Your setup may be different. If so, make sure to change them accordingly in the following commands.<span class="anchor" id="line-42"></span><span class="anchor" id="line-43"></span></p> <p class="line867"></p> <h4 id="Configure internal network card" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1em;">Configure internal network card</h4> <span class="anchor" id="line-44"></span> <p class="line862">Configure your internal network card (eth1) for static IP like so:<span class="anchor" id="line-45"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">sudo ifconfig eth1 192.168.0.1</pre> <span class="anchor" id="line-46"></span> <p class="line874">(The external and internal network cards cannot be on the same subnet)<span class="anchor" id="line-47"></span></p> <h5 id="Configure NAT" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1em;">Configure NAT</h5> <span class="anchor" id="line-48"></span> <p class="line862">Configure iptables for NAT translation so packets can be correctly routed through the Ubuntu gateway.<span class="anchor" id="line-49"></span><span class="anchor" id="line-50"></span><span class="anchor" id="line-51"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">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 </pre> <span class="anchor" id="line-52"></span> <p class="line874">(rule1 allows forwarded packets (initial ones), rule2 allows forwarding of established connection packets (and those related to ones that started), rule3 does the NAT.)<span class="anchor" id="line-53"></span><span class="anchor" id="line-54"></span></p> <p class="line874">IPtables settings need to be set-up at each boot (they are not saved automatically), with the following commands:<span class="anchor" id="line-55"></span></p> <ul> <li>Save the iptables:<span class="anchor" id="line-56"></span></li> </ul> <p class="line867"><span class="anchor" id="line-57"></span><span class="anchor" id="line-58"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">sudo iptables-save | sudo tee /etc/iptables.sav</pre> <span class="anchor" id="line-59"></span><span class="anchor" id="line-60"></span> <ul> <li>Edit /etc/rc.local and add the following lines before the "exit 0" line:<span class="anchor" id="line-61"></span></li> </ul> <p class="line867"><span class="anchor" id="line-62"></span><span class="anchor" id="line-63"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">iptables-restore < /etc/iptables.sav</pre> <span class="anchor" id="line-64"></span><span class="anchor" id="line-65"></span> <p class="line867"></p> <h4 id="Enable routing" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1em;">Enable routing</h4> <span class="anchor" id="line-66"></span> <ul> <li>Configure the gateway for routing between two interfaces by enabling IP forwarding:<span class="anchor" id="line-67"></span></li> </ul> <p class="line867"><span class="anchor" id="line-68"></span><span class="anchor" id="line-69"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"</pre> <p class="line874"><span class="anchor" id="line-70"></span><span class="anchor" id="line-71"></span></p> <ul> <li>Edit /etc/sysctl.conf and add these lines:<span class="anchor" id="line-72"></span><span class="anchor" id="line-73"></span></li> </ul> <p class="line867"><span class="anchor" id="line-74"></span><span class="anchor" id="line-75"></span><span class="anchor" id="line-76"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">net.ipv4.conf.default.forwarding=1 net.ipv4.conf.all.forwarding=1</pre> <span class="anchor" id="line-77"></span><span class="anchor" id="line-78"></span> <p class="line867"><em><strong>The /etc/sysctl.conf edit is required because of following Bug (Hardy and later releases)</strong></em><span class="Apple-converted-space"> </span><span class="anchor" id="line-79"></span><a class="https" href="https://bugs.launchpad.net/ubuntu/+source/procps/+bug/84537" style="border-width: 0px; color: rgb(217, 13, 25);">Launchpad Bug Report</a><span class="anchor" id="line-80"></span><span class="anchor" id="line-81"></span></p> <p class="line867"></p> <h3 id="Client set up" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.1em;">Client set up</h3> <span class="anchor" id="line-82"></span> <p class="line874">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.<span class="anchor" id="line-83"></span><span class="anchor" id="line-84"></span></p> <p class="line874">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.<span class="anchor" id="line-85"></span></p> <h4 id="Disable networking" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1em;">Disable networking</h4> <span class="anchor" id="line-86"></span> <p class="line867"><span class="anchor" id="line-87"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">sudo /etc/init.d/networking stop</pre> <span class="anchor" id="line-88"></span> <p class="line867"></p> <h4 id="Give the client a static IP address" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1em;">Give the client a static IP address</h4> <span class="anchor" id="line-89"></span> <p class="line867"><span class="anchor" id="line-90"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">sudo ifconfig eth0 192.168.0.100</pre> <span class="anchor" id="line-91"></span> <p class="line874">This IP address can be anything within the gateway's private IP range.<span class="anchor" id="line-92"></span></p> <h4 id="Configure routing" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1em;">Configure routing</h4> <span class="anchor" id="line-93"></span> <p class="line867"><span class="anchor" id="line-94"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">sudo route add default gw 192.168.0.1</pre> <span class="anchor" id="line-95"></span> <p class="line874">This address should match the IP address on the gateway's internal network card (eth1 in the above example).<span class="anchor" id="line-96"></span></p> <h4 id="Configure DNS servers" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1em;">Configure DNS servers</h4> <span class="anchor" id="line-97"></span> <p class="line862">Unless your ICS gateway can also perform<span class="Apple-converted-space"> </span><a class="http" href="http://en.wikipedia.org/wiki/Domain_Name_System" style="border-width: 0px; color: rgb(217, 13, 25);">DNS</a>, you must manually configure the client with your ISP DNS servers. If you do not know your ISP's DNS servers, you can use<span class="Apple-converted-space"> </span><a class="https" href="https://www.opendns.com/start?device=ubuntu" style="border-width: 0px; color: rgb(217, 13, 25);">OpenDNS servers</a><span class="Apple-converted-space"> </span>instead.<span class="anchor" id="line-98"></span><span class="anchor" id="line-99"></span></p> <ul> <li>Backup your current /etc/resolve.conf file:<span class="anchor" id="line-100"></span></li> </ul> <p class="line867"><span class="anchor" id="line-101"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">sudo cp /etc/resolv.conf /etc/resolv.conf.backup</pre> <span class="anchor" id="line-102"></span> <ul> <li>Open /etc/dhcp3/dhclient.conf with your favorite text editor:<span class="anchor" id="line-103"></span></li> </ul> <p class="line867"><span class="anchor" id="line-104"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">sudo nano /etc/dhcp3/dhclient.conf</pre> <span class="anchor" id="line-105"></span> <ul> <li>Search for the line that starts "prepend domain-name-servers", and change it to look like this:<span class="anchor" id="line-106"></span></li> </ul> <p class="line867"><span class="anchor" id="line-107"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">prepend domain-name-servers 208.67.222.222,208.67.220.220;</pre> <span class="anchor" id="line-108"></span> <p class="line874">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.<span class="anchor" id="line-109"></span><span class="anchor" id="line-110"></span></p> <p class="line867"></p> <h4 id="Restart networking" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1em;">Restart networking</h4> <span class="anchor" id="line-111"></span> <p class="line867"><span class="anchor" id="line-112"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">sudo /etc/init.d/networking restart</pre> <span class="anchor" id="line-113"></span><span class="anchor" id="line-114"></span> <p class="line862">Once this is finished, your client will now have access to the internet via ICS. Please direct any questions/comments to the<a class="http" href="http://ubuntuforums.org/showthread.php?s=88b74f79f0ab07638e6b361c09040b45&t=503287" style="border-width: 0px; color: rgb(217, 13, 25);">Internet Connection Sharing Documentation</a><span class="Apple-converted-space"> </span>thread.<span class="anchor" id="line-115"></span></p> <hr style="border-width: 0px; height: 1pt; background-color: rgb(193, 180, 150);"> <p class="line874"><span class="anchor" id="line-116"></span>A beginner's working example of a Ubuntu Desktop with 2 nic cards, sharing internet connection<a class="http" href="http://ubuntuforums.org/showthread.php?p=3713684" style="border-width: 0px; color: rgb(217, 13, 25);">http://ubuntuforums.org/showthread.php?p=3713684</a><span class="anchor" id="line-117"></span><span class="anchor" id="line-118"></span></p> <p class="line867"></p> <h2 id="Advanced Gateway Configuration" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.3em;">Advanced Gateway Configuration</h2> <span class="anchor" id="line-119"></span> <p class="line874">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.<span class="anchor" id="line-120"></span><span class="anchor" id="line-121"></span></p> <p class="line874">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.<span class="anchor" id="line-122"></span><span class="anchor" id="line-123"></span></p> <p class="line867"></p> <h3 id="DHCP/DNS server" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.1em;">DHCP/DNS server</h3> <span class="anchor" id="line-124"></span> <p class="line874">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.<span class="anchor" id="line-125"></span><span class="anchor" id="line-126"></span></p> <ul> <li>Install software<span class="anchor" id="line-127"></span></li> </ul> <p class="line867"><span class="anchor" id="line-128"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">sudo aptitude install dnsmasq</pre> <span class="anchor" id="line-129"></span><span class="anchor" id="line-130"></span> <ul> <li>Stop the server<span class="anchor" id="line-131"></span></li> </ul> <p class="line874">After dnsmasq has been installed, it is automatically started, so it will need to be stopped before changes can be made.<span class="anchor" id="line-132"></span><span class="anchor" id="line-133"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">sudo /etc/init.d/dnsmasq stop</pre> <span class="anchor" id="line-134"></span><span class="anchor" id="line-135"></span> <ul> <li>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)<span class="anchor" id="line-136"></span></li> </ul> <p class="line867"><span class="anchor" id="line-137"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">sudo cp /etc/dnsmasq.conf /etc/dnsmasq.conf-backup</pre> <span class="anchor" id="line-138"></span><span class="anchor" id="line-139"></span> <ul> <li>Edit /etc/dnsmasq.conf with your favorite text editor and add the following two lines:<span class="anchor" id="line-140"></span></li> </ul> <p class="line867"><span class="anchor" id="line-141"></span><span class="anchor" id="line-142"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">interface=eth1 dhcp-range=192.168.0.100,192.168.0.250,72h</pre> <span class="anchor" id="line-143"></span><span class="anchor" id="line-144"></span> <p class="line874">Note:<span class="Apple-converted-space"> </span><span class="anchor" id="line-145"></span>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.<span class="anchor" id="line-146"></span><span class="anchor" id="line-147"></span></p> <ul> <li>Start the DHCP/DNS server<span class="anchor" id="line-148"></span></li> </ul> <p class="line867"><span class="anchor" id="line-149"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">sudo /etc/init.d/dnsmasq start</pre> <span class="anchor" id="line-150"></span><span class="anchor" id="line-151"></span> <p class="line874">Now your clients should be able to pull an automatic ip address and resolve host names.<span class="anchor" id="line-152"></span><span class="anchor" id="line-153"></span></p> <p class="line867"></p> <h2 id="Other approaches" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.3em;">Other approaches</h2> <span class="anchor" id="line-154"></span> <p class="line874">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.<span class="anchor" id="line-155"></span><span class="anchor" id="line-156"></span></p> <p class="line867"></p> <h3 id="Alternate server software (CLI)" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.1em;">Alternate server software (CLI)</h3> <span class="anchor" id="line-157"></span> <p class="line874">There are other ways to host ICS, but they are outside the scope of this article.<span class="anchor" id="line-158"></span><span class="anchor" id="line-159"></span></p> <p class="line867"></p> <h4 id="Alternate NAT" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1em;">Alternate NAT</h4> <span class="anchor" id="line-160"></span> <p class="line874">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.<span class="anchor" id="line-161"></span><span class="anchor" id="line-162"></span></p> <p class="line867"><span class="anchor" id="line-163"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">sudo aptitude install ipmasq</pre> <span class="anchor" id="line-164"></span><span class="anchor" id="line-165"></span> <p class="line874">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<span class="anchor" id="line-166"></span><span class="anchor" id="line-167"></span></p> <p class="line867"><span class="anchor" id="line-168"></span><span class="anchor" id="line-169"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">sudo dpkg-reconfigure ipmasq.</pre> <span class="anchor" id="line-170"></span><span class="anchor" id="line-171"></span> <p class="line867"></p> <h4 id="Dedicated DHCP server" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1em;">Dedicated DHCP server</h4> <span class="anchor" id="line-172"></span> <p class="line874">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:<span class="anchor" id="line-173"></span><span class="anchor" id="line-174"></span></p> <p class="line867"><a class="https" href="https://help.ubuntu.com/community/dhcp3-server" style="border-width: 0px; color: rgb(217, 13, 25);">https://help.ubuntu.com/community/dhcp3-server</a><span class="anchor" id="line-175"></span><span class="anchor" id="line-176"></span></p> <p class="line867"></p> <h4 id="Dedicated DNS server" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1em;">Dedicated DNS server</h4> <span class="anchor" id="line-177"></span> <p class="line874">BIND9 is a popular and well supported local DNS server. It is very versatile, and very powerful, but difficult to configure correctly:<span class="anchor" id="line-178"></span><span class="anchor" id="line-179"></span></p> <p class="line867"><a class="https" href="https://help.ubuntu.com/community/BIND9ServerHowto" style="border-width: 0px; color: rgb(217, 13, 25);">https://help.ubuntu.com/community/BIND9ServerHowto</a><span class="anchor" id="line-180"></span><span class="anchor" id="line-181"></span></p> <p class="line867"></p> <h3 id="Alternate gateway software (GUI)" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.1em;">Alternate gateway software (GUI)</h3> <span class="anchor" id="line-182"></span> <p class="line862">Another approach --- set up<span class="Apple-converted-space"> </span><a href="/community/Firestarter" style="border-width: 0px; color: rgb(217, 13, 25);">Firestarter</a>, 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.<span class="anchor" id="line-183"></span><span class="anchor" id="line-184"></span></p> <p class="line874">Basically, you need to have Firestarter active/turned on/protecting, to have the connection shared.<span class="anchor" id="line-185"></span><span class="anchor" id="line-186"></span></p> <p class="line874">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.<span class="anchor" id="line-187"></span><span class="anchor" id="line-188"></span></p> <p class="line874">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.<span class="anchor" id="line-189"></span>Alternatively, every time you run the sudo dpkg-reconfigure dhcp3-server, at the end, your server will restart.<span class="anchor" id="line-190"></span><span class="anchor" id="line-191"></span></p> <p class="line862">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.<span class="anchor" id="line-192"></span><span class="anchor" id="line-193"></span></p> <p class="line867"></p> <h3 id="simple iptables example" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.1em;">simple iptables example</h3> <span class="anchor" id="line-194"></span><span class="anchor" id="line-195"></span> <p class="line874">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.<span class="anchor" id="line-196"></span><span class="anchor" id="line-197"></span></p> <ul> <li style="list-style-type: none;"> <p class="line862" style="margin: 0.25em 0px;">#!/bin/sh<span class="Apple-converted-space"> </span><br> <span class="anchor" id="line-198"></span>#<span class="Apple-converted-space"> </span><br> <span class="anchor" id="line-199"></span># internet connection sharing wlan0 is the gate way<span class="Apple-converted-space"> </span><br> <span class="anchor" id="line-200"></span># eth0 is the lan port this might use a straight ethernet cable to a router wan port or a switch or a single PC<br> <span class="anchor" id="line-201"></span># 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<br> <span class="anchor" id="line-202"></span>#<br> <span class="anchor" id="line-203"></span># change wlan0 to ppp0 and you can use this for mobile broadband connection sharing<br> <span class="anchor" id="line-204"></span>#<br> <span class="anchor" id="line-205"></span>ifconfig eth0 up"<br> <span class="anchor" id="line-206"></span>ifconfig eth0 192.168.2.1<br> <span class="anchor" id="line-207"></span>echo “1” > /proc/sys/net/ipv4/ip_forward<br> <span class="anchor" id="line-208"></span>iptables -t nat -A POSTROUTING -o wlan0 -s 192.168.2.0/24 -j MASQUERADE<br> <span class="anchor" id="line-209"></span>iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 3074 -j DNAT --to-destination 192.168.2.2<br> <span class="anchor" id="line-210"></span>iptables -t nat -A PREROUTING -i wlan0 -p udp -m multiport --dports 88,3074 -j DNAT --to-destination 192.168.2.2<br> <span class="anchor" id="line-211"></span>iptables -A FORWARD -i wlan0 -d 192.168.2.2 -p tcp --dport 3074 -j ACCEPT<br> <span class="anchor" id="line-212"></span>iptables -A FORWARD -i wlan0 -d 192.168.2.2 -p udp -m multiport --dports 88,3074 -j ACCEPT<br> <span class="anchor" id="line-213"></span><span class="anchor" id="line-214"></span></p> </li> </ul> <p class="line862">You could use the above as a bash script changing things to suit<span class="Apple-converted-space"> </span><br> <span class="anchor" id="line-215"></span><span class="anchor" id="line-216"></span><span class="anchor" id="line-217"></span></p> <ul> <li style="list-style-type: none;">If things go wrong<span class="Apple-converted-space"> </span><span class="anchor" id="line-218"></span><span class="anchor" id="line-219"></span>The Following script should save you if things get badly messed up.<span class="anchor" id="line-220"></span><span class="anchor" id="line-221"></span></li> </ul> <p class="line867"><br> <span class="anchor" id="line-222"></span></p> <ul> <li style="list-style-type: none;"> <p class="line862" style="margin: 0.25em 0px;">#!/bin/sh<br> <span class="anchor" id="line-223"></span>#<span class="Apple-converted-space"> </span><br> <span class="anchor" id="line-224"></span># rc.flush-iptables - Resets iptables to default values.<span class="Apple-converted-space"> </span><br> <span class="anchor" id="line-225"></span>#<span class="Apple-converted-space"> </span><br> <span class="anchor" id="line-226"></span># Copyright (C) 2001 Oskar Andreasson <bluefluxATkoffeinDOTnet><br> <span class="anchor" id="line-227"></span>#<br> <span class="anchor" id="line-228"></span># This program is free software; you can redistribute it and/or modify<br> <span class="anchor" id="line-229"></span># it under the terms of the GNU General Public License as published by<br> <span class="anchor" id="line-230"></span># the Free Software Foundation; version 2 of the License.<br> <span class="anchor" id="line-231"></span>#<br> <span class="anchor" id="line-232"></span># This program is distributed in the hope that it will be useful,<br> <span class="anchor" id="line-233"></span># but WITHOUT ANY WARRANTY; without even the implied warranty of<br> <span class="anchor" id="line-234"></span># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br> <span class="anchor" id="line-235"></span># GNU General Public License for more details.<br> <span class="anchor" id="line-236"></span>#<br> <span class="anchor" id="line-237"></span># You should have received a copy of the GNU General Public License<br> <span class="anchor" id="line-238"></span># along with this program or from the site that you downloaded it<br> <span class="anchor" id="line-239"></span># from; if not, write to the Free Software Foundation, Inc., 59 Temple<br> <span class="anchor" id="line-240"></span># Place, Suite 330, Boston, MA 02111-1307 USA<br> <span class="anchor" id="line-241"></span>#<br> <span class="anchor" id="line-242"></span># Configurations<br> <span class="anchor" id="line-243"></span>#<br> <span class="anchor" id="line-244"></span>IPTABLES="/usr/sbin/iptables"<br> <span class="anchor" id="line-245"></span>#<br> <span class="anchor" id="line-246"></span># reset the default policies in the filter table.<br> <span class="anchor" id="line-247"></span>#<br> <span class="anchor" id="line-248"></span>$IPTABLES -P INPUT ACCEPT<br> <span class="anchor" id="line-249"></span>$IPTABLES -P FORWARD ACCEPT<br> <span class="anchor" id="line-250"></span>$IPTABLES -P OUTPUT ACCEPT<br> <span class="anchor" id="line-251"></span>#<br> <span class="anchor" id="line-252"></span># reset the default policies in the nat table.<br> <span class="anchor" id="line-253"></span>#<br> <span class="anchor" id="line-254"></span>$IPTABLES -t nat -P PREROUTING ACCEPT<br> <span class="anchor" id="line-255"></span>$IPTABLES -t nat -P POSTROUTING ACCEPT<br> <span class="anchor" id="line-256"></span>$IPTABLES -t nat -P OUTPUT ACCEPT<br> <span class="anchor" id="line-257"></span>#<br> <span class="anchor" id="line-258"></span># reset the default policies in the mangle table.<br> <span class="anchor" id="line-259"></span>#<br> <span class="anchor" id="line-260"></span>$IPTABLES -t mangle -P PREROUTING ACCEPT<br> <span class="anchor" id="line-261"></span>$IPTABLES -t mangle -P POSTROUTING ACCEPT<br> <span class="anchor" id="line-262"></span>$IPTABLES -t mangle -P INPUT ACCEPT<br> <span class="anchor" id="line-263"></span>$IPTABLES -t mangle -P OUTPUT ACCEPT<br> <span class="anchor" id="line-264"></span>$IPTABLES -t mangle -P FORWARD ACCEPT<br> <span class="anchor" id="line-265"></span>#<br> <span class="anchor" id="line-266"></span># flush all the rules in the filter and nat tables.<br> <span class="anchor" id="line-267"></span>#<br> <span class="anchor" id="line-268"></span>$IPTABLES -F<br> <span class="anchor" id="line-269"></span>$IPTABLES -t nat -F<br> <span class="anchor" id="line-270"></span>$IPTABLES -t mangle -F<br> <span class="anchor" id="line-271"></span>#<br> <span class="anchor" id="line-272"></span># erase all chains that's not default in filter and nat table.<br> <span class="anchor" id="line-273"></span>#<br> <span class="anchor" id="line-274"></span>$IPTABLES -X<br> <span class="anchor" id="line-275"></span>$IPTABLES -t nat -X<br> <span class="anchor" id="line-276"></span>$IPTABLES -t mangle -X<br> <span class="anchor" id="line-277"></span><span class="anchor" id="line-278"></span></p> </li> </ul> <p class="line862">Further reading<span class="Apple-converted-space"> </span><a class="https" href="https://help.ubuntu.com/community/IptablesHowTo" style="border-width: 0px; color: rgb(217, 13, 25);">https://help.ubuntu.com/community/IptablesHowTo</a><span class="anchor" id="line-279"></span><span class="anchor" id="line-280"></span></p> <p class="line862">Internet Connection Sharing Documentation thread<span class="Apple-converted-space"> </span><a class="http" href="http://ubuntuforums.org/showthread.php?s=88b74f79f0ab07638e6b361c09040b45&t=503287" style="border-width: 0px; color: rgb(217, 13, 25);">http://ubuntuforums.org/showthread.php?s=88b74f79f0ab07638e6b361c09040b45&t=503287</a><span class="anchor" id="line-281"></span><span class="anchor" id="line-282"></span></p> <p class="line867"></p> <h2 id="See also" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.3em;">See also</h2> <span class="anchor" id="line-283"></span> <ul> <li> <p class="line891" style="margin: 0.25em 0px;"><a href="/community/WifiDocs/ShareEthernetConnectionThroughWireless" style="border-width: 0px; color: rgb(217, 13, 25);">WifiDocs/ShareEthernetConnectionThroughWireless</a><span class="anchor" id="line-284"></span></p> </li> <li> <p class="line891" style="margin: 0.25em 0px;"><a href="/community/InternetHowto" style="border-width: 0px; color: rgb(217, 13, 25);">InternetHowto</a></p> </li> </ul> </span></span> ARVhttp://www.blogger.com/profile/13867592943489571397noreply@blogger.com0tag:blogger.com,1999:blog-4205825614598938724.post-65019547670312593782010-07-27T11:02:00.001-07:002010-07-27T11:02:43.851-07:00Set up Wireless Internet Connection Sharing(using Wifi) in Linux (Ubuntu) between any computers<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span class="Apple-style-span" style="font-family: 'Helvetica Neue','Lucida Grande',Helvetica,Arial,Verdana,sans-serif; font-size: 14px;"> <p class="line862">Okay, imagine you only have a network cable plugged in your desktop PC (which we'll call "<strong>eth0</strong>") and a wireless card too (which we'll call "<strong>wireless0</strong>"). 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<span class="Apple-converted-space"> </span><strong>share your internet connection for your laptop through your wireless card</strong>. Come aboard!<span class="anchor" id="line-5"></span><span class="anchor" id="line-6"></span></p> <p class="line862">Remember,<span class="Apple-converted-space"> </span><strong>your machine may vary</strong><span class="Apple-converted-space"> </span>so be sure to use the commands shown in the "<em><strong>The basics</strong></em>" section right below.<span class="anchor" id="line-7"></span><span class="anchor" id="line-8"></span></p> <p class="line867"><strong>Note:</strong><span class="Apple-converted-space"> </span>this guide has been tested for sharing connection between :<span class="anchor" id="line-9"></span></p> <div> <table style="margin: 0.5em 0px; border-collapse: collapse;"> <tbody> <tr> <td style="border: 1pt solid rgb(193, 180, 150); padding: 0.25em;"> <p class="line862" style="margin: 0px; padding: 0px;">Ubuntu Feisty Fawn (7.04)</p> </td> <td style="border: 1pt solid rgb(193, 180, 150); padding: 0.25em;"> <p class="line862" style="margin: 0px; padding: 0px;">and</p> </td> <td style="border: 1pt solid rgb(193, 180, 150); padding: 0.25em;"> <p class="line862" style="margin: 0px; padding: 0px;">Windows XP Professional</p> </td> </tr> </tbody> </table> </div> <span class="anchor" id="line-10"></span> <p class="line874">Please add successfull configurations<span class="anchor" id="line-11"></span><span class="anchor" id="line-12"></span></p> <p class="line867"> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <img src="cid:part1.09070903.00060201@gmail.com" alt="ICS2.jpeg"><br> <span class="anchor" id="line-13"></span><span class="anchor" id="line-14"></span></p> <p class="line862">Note: This diagram was created with inkscape. If you want to edit it download the full file<span class="Apple-converted-space"> </span><tt class="backtick">ics.svg</tt><span class="Apple-converted-space"> </span>from: More Actions->Attachments<span class="anchor" id="line-15"></span><span class="anchor" id="line-16"></span></p> <p class="line867"></p> <h1 id="The Basics" style="border-bottom: 1px solid rgb(109, 76, 7); margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.6em;">The Basics</h1> <span class="anchor" id="line-17"></span> <p class="line874">For getting your wireless card info, open a terminal and use these commands:<span class="anchor" id="line-18"></span><span class="anchor" id="line-19"></span><span class="anchor" id="line-20"></span><span class="anchor" id="line-21"></span><span class="anchor" id="line-22"></span><span class="anchor" id="line-23"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">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)</pre> <span class="anchor" id="line-24"></span><span class="anchor" id="line-25"></span> <p class="line867"></p> <h1 id="Packages" style="border-bottom: 1px solid rgb(109, 76, 7); margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.6em;">Packages</h1> <span class="anchor" id="line-26"></span> <ul> <li style="list-style-type: none;"> <p class="line862" style="margin: 0.25em 0px;">You also need<span class="Apple-converted-space"> </span><a href="/community/Firestarter" style="border-width: 0px; color: rgb(217, 13, 25);">Firestarter</a>, 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<span class="Apple-converted-space"> </span><tt>firestarter</tt>) or just issue a command in any open terminal window:<span class="anchor" id="line-27"></span></p> </li> </ul> <p class="line867"><span class="anchor" id="line-28"></span><span class="anchor" id="line-29"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">sudo apt-get install firestarter</pre> <span class="anchor" id="line-30"></span><span class="anchor" id="line-31"></span> <p class="line867"></p> <h1 id="Configuring the SERVER" style="border-bottom: 1px solid rgb(109, 76, 7); margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.6em;">Configuring the SERVER</h1> <span class="anchor" id="line-32"></span><span class="anchor" id="line-33"></span> <p class="line874">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:<span class="anchor" id="line-34"></span><span class="anchor" id="line-35"></span></p> <ol type="1"> <li>Computers must be in the same subnet (see below for explanations)<span class="anchor" id="line-36"></span></li> <li> <p class="line862" style="margin: 0.25em 0px;">You might not be able to use the Gnome Network Manager (and/or maybe KDE<span class="Apple-converted-space"> </span><a class="nonexistent" href="/community/WiFi" style="border-width: 0px; color: rgb(217, 13, 25);">WiFi</a><span class="Apple-converted-space"> </span>Manager) using this method.<span class="anchor" id="line-37"></span></p> </li> <li> <p class="line862" style="margin: 0.25em 0px;">The Server's<span class="Apple-converted-space"> </span><strong>wireless0</strong><span class="Apple-converted-space"> </span>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,<tt class="backtick">(1.reference please)</tt><span class="Apple-converted-space"> </span>or so I've read.<span class="anchor" id="line-38"></span></p> </li> <li> <p class="line862" style="margin: 0.25em 0px;">Your wireless card must have the lowest IP possible,<tt class="backtick">(2.reference please)</tt><span class="Apple-converted-space"> </span>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.<span class="Apple-converted-space"> </span><strong>Client computers ALWAYS MUST have greater IP addresses than the chosen one for the wireless adapter<span class="Apple-converted-space"> </span><tt class="backtick">(3.reference please)</tt>(or the one sharing the internet).</strong><span class="anchor" id="line-39"></span><span class="anchor" id="line-40"></span></p> </li> </ol> <p class="line874">If you haven't yet, it's time to stop the Network Manager:<span class="anchor" id="line-41"></span><span class="anchor" id="line-42"></span><span class="anchor" id="line-43"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">sudo /etc/dbus-1/event.d/25NetworkManager stop</pre> <span class="anchor" id="line-44"></span> <p class="line874">Once stopped, we shall proceed to edit our /etc/network/interfaces file.<span class="anchor" id="line-45"></span><span class="anchor" id="line-46"></span><span class="anchor" id="line-47"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">sudo gedit /etc/network/interfaces</pre> <span class="anchor" id="line-48"></span><span class="anchor" id="line-49"></span> <p class="line867"></p> <h2 id="Network Interfaces configuration -IMPORTANT-" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.3em;">Network Interfaces configuration -IMPORTANT-</h2> <span class="anchor" id="line-50"></span><span class="anchor" id="line-51"></span> <p class="line874">Your network configuration file will look similar to this one:<span class="anchor" id="line-52"></span><span class="anchor" id="line-53"></span><span class="anchor" id="line-54"></span><span class="anchor" id="line-55"></span><span class="anchor" id="line-56"></span><span class="anchor" id="line-57"></span><span class="anchor" id="line-58"></span><span class="anchor" id="line-59"></span><span class="anchor" id="line-60"></span><span class="anchor" id="line-61"></span><span class="anchor" id="line-62"></span><span class="anchor" id="line-63"></span><span class="anchor" id="line-64"></span><span class="anchor" id="line-65"></span><span class="anchor" id="line-66"></span><span class="anchor" id="line-67"></span><span class="anchor" id="line-68"></span><span class="anchor" id="line-69"></span><span class="anchor" id="line-70"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">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</pre> <span class="anchor" id="line-71"></span> <p class="line874">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.<span class="anchor" id="line-72"></span><span class="anchor" id="line-73"></span></p> <p class="line874">We need to think how we'll set up our network. We'll do it this way:<span class="anchor" id="line-74"></span><span class="anchor" id="line-75"></span></p> <ul> <li>IP Address for wireless0: 192.168.0.2 (its own IP address we can define manually).<span class="anchor" id="line-76"></span></li> <li>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).<span class="anchor" id="line-77"></span></li> <li>Network Mask for wireless0: 255.255.255.0 (Always needed and standard value 99.9% of the time).<span class="anchor" id="line-78"></span><span class="anchor" id="line-79"></span></li> </ul> <p class="line867"><strong>Note:</strong><span class="Apple-converted-space"> </span>You might need to think up another IP address for it if you're on a large network. Else, just leave it like that.<span class="anchor" id="line-80"></span><span class="anchor" id="line-81"></span></p> <p class="line874">For sharing internet through the wireless with those settings, our interfaces file will end up like this:<span class="anchor" id="line-82"></span><span class="anchor" id="line-83"></span><span class="anchor" id="line-84"></span><span class="anchor" id="line-85"></span><span class="anchor" id="line-86"></span><span class="anchor" id="line-87"></span><span class="anchor" id="line-88"></span><span class="anchor" id="line-89"></span><span class="anchor" id="line-90"></span><span class="anchor" id="line-91"></span><span class="anchor" id="line-92"></span><span class="anchor" id="line-93"></span><span class="anchor" id="line-94"></span><span class="anchor" id="line-95"></span><span class="anchor" id="line-96"></span><span class="anchor" id="line-97"></span><span class="anchor" id="line-98"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">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</pre> <span class="anchor" id="line-99"></span><span class="anchor" id="line-100"></span> <p class="line867"><strong>Note:</strong><span class="Apple-converted-space"> </span>Remember to replace wireless0 with your network adapter's name, which you can get by typing in a terminal:<span class="anchor" id="line-101"></span><span class="anchor" id="line-102"></span><span class="anchor" id="line-103"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">iwconfig</pre> <span class="anchor" id="line-104"></span> <p class="line874">Okay. Now, we're doing the following things:<span class="anchor" id="line-105"></span></p> <ul> <li>Setting wireless0 to load automatically.<span class="anchor" id="line-106"></span></li> <li>Specify a static configuration instead of being assigned by DHCP (which we won't be able to do).<span class="anchor" id="line-107"></span></li> <li>We'll set an hexadecimal WEP key for safety (WPA is not supported at this stage).<span class="anchor" id="line-108"></span></li> <li>Also, a channel where to send the information through. Remember Wireless is very similar to radio/tv communications.<span class="anchor" id="line-109"></span></li> <li>Specify that we're going be in an ad-hoc network (peer-to-peer or mesh).<span class="anchor" id="line-110"></span></li> <li>We'll put a name for it, which we'll use to identify it in Windows, and to identify ourselves in our location.<span class="anchor" id="line-111"></span></li> <li>We'll set it's address, gateway and netmask as we decided earlier.<span class="anchor" id="line-112"></span></li> </ul> <p class="line874">That done, we can restart networking to get the device ready:<span class="anchor" id="line-113"></span><span class="anchor" id="line-114"></span><span class="anchor" id="line-115"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">sudo /etc/init.d/networking restart</pre> <span class="anchor" id="line-116"></span> <p class="line874">After that, we'll fire up Firestarter:<span class="anchor" id="line-117"></span><span class="anchor" id="line-118"></span><span class="anchor" id="line-119"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">gksudo firestarter</pre> <span class="anchor" id="line-120"></span><span class="anchor" id="line-121"></span> <p class="line874">A wizard should appear. Follow through these steps:<span class="anchor" id="line-122"></span></p> <ol type="1"> <li>Press Next.<span class="anchor" id="line-123"></span></li> <li>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.<span class="anchor" id="line-124"></span></li> <li>Choose wireless0 (or your wireless device's name) as the device which will share Internet. Check the box that says to share Internet.<span class="anchor" id="line-125"></span></li> <li> <p class="line891" style="margin: 0.25em 0px;"><strong>Do NOT</strong><span class="Apple-converted-space"> </span>activate the option to enable DHCP in the Local Network.<span class="anchor" id="line-126"></span></p> </li> <li>Press Save.<span class="anchor" id="line-127"></span><span class="anchor" id="line-128"></span></li> </ol> <p class="line874">If everything went good, it should say Firewall Started. If not, please refer to the Troubleshooting section, else, we're done here.<span class="anchor" id="line-129"></span><span class="anchor" id="line-130"></span></p> <p class="line867"></p> <h1 id="Configuring the CLIENTS" style="border-bottom: 1px solid rgb(109, 76, 7); margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.6em;">Configuring the CLIENTS</h1> <span class="anchor" id="line-131"></span><span class="anchor" id="line-132"></span> <p class="line874">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:<span class="anchor" id="line-133"></span><span class="anchor" id="line-134"></span></p> <ol type="1"> <li> <p class="line891" style="margin: 0.25em 0px;"><strong>Make sure your other computer has wireless enabled and working.</strong><span class="anchor" id="line-135"></span></p> </li> <li> <p class="line862" style="margin: 0.25em 0px;">Go to the<span class="Apple-converted-space"> </span><strong>Wireless Connections</strong><span class="Apple-converted-space"> </span>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.<span class="anchor" id="line-136"></span></p> </li> <li> <p class="line891" style="margin: 0.25em 0px;"><strong>Double-click</strong><span class="Apple-converted-space"> </span>your connection and type your password in. Wait for it to connect.<span class="anchor" id="line-137"></span></p> </li> <li> <p class="line862" style="margin: 0.25em 0px;">Go to<span class="Apple-converted-space"> </span><strong>Control Panel -> Network Connections</strong><span class="Apple-converted-space"> </span>and<span class="Apple-converted-space"> </span><strong>right-click<span class="Apple-converted-space"> </span></strong>your wireless connection, then<span class="Apple-converted-space"> </span><strong>click Properties</strong>.<span class="anchor" id="line-138"></span></p> </li> <li> <p class="line862" style="margin: 0.25em 0px;">Click<span class="Apple-converted-space"> </span><strong>TCP/IP Internet Protocol</strong><span class="Apple-converted-space"> </span>(or similar) and click the<span class="Apple-converted-space"> </span><strong>Properties</strong><span class="Apple-converted-space"> </span>button.<span class="anchor" id="line-139"></span></p> </li> <li> <p class="line862" style="margin: 0.25em 0px;">Click the<span class="Apple-converted-space"> </span><strong>Assign an IP Address Manually</strong><span class="Apple-converted-space"> </span>radio button (or similar).<span class="anchor" id="line-140"></span></p> </li> <li>We'll need to put the following data:<span class="anchor" id="line-141"></span> <ul> <li>IP Address: 192.168.0.10<span class="anchor" id="line-142"></span></li> <li>Gateway: 192.168.0.1<span class="anchor" id="line-143"></span></li> <li>Network Mask: 255.255.255.0<span class="anchor" id="line-144"></span></li> </ul> </li> <li> <p class="line862" style="margin: 0.25em 0px;">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<span class="Apple-converted-space"> </span><strong>"nameserver"</strong>):<span class="anchor" id="line-145"></span></p> </li> </ol> <p class="line867"><span class="anchor" id="line-146"></span><span class="anchor" id="line-147"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">cat /etc/resolv.conf</pre> <span class="anchor" id="line-148"></span> <ol type="9"> <li> <p class="line862" style="margin: 0.25em 0px;">Click<span class="Apple-converted-space"> </span><strong>Ok</strong>, then<span class="Apple-converted-space"> </span><strong>Ok</strong><span class="Apple-converted-space"> </span>again to apply changes.<span class="anchor" id="line-149"></span></p> </li> <li> <p class="line862" style="margin: 0.25em 0px;">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<span class="Apple-converted-space"> </span><strong>Repair</strong>.<span class="anchor" id="line-150"></span></p> </li> <li> <p class="line862" style="margin: 0.25em 0px;">Pat yourself on the back for your hard work and make yourself a sandwich<span class="Apple-converted-space"> </span><img alt=":)" src="cid:part2.04070000.00050309@gmail.com" title=":)" style="border-width: 0px;" height="15" width="15"><span class="anchor" id="line-151"></span><span class="anchor" id="line-152"></span></p> </li> </ol> <p class="line874">Your laptop should have Internet now. If anything went wrong, check the Troubleshooting section, as always.<span class="anchor" id="line-153"></span><span class="anchor" id="line-154"></span><br> </p> <p class="line874"><br> For more details lease refer the original content at <a class="moz-txt-link-freetext" href="https://help.ubuntu.com/community/WifiDocs/ShareEthernetConnectionThroughWireless">https://help.ubuntu.com/community/WifiDocs/ShareEthernetConnectionThroughWireless</a> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> </p> <p class="line867"></p> </span></span><br class="Apple-interchange-newline"> ARVhttp://www.blogger.com/profile/13867592943489571397noreply@blogger.com0tag:blogger.com,1999:blog-4205825614598938724.post-53531937294951114172010-07-27T06:14:00.001-07:002010-07-27T06:14:09.232-07:00CD Slide-in trick to increase the speed of BSNL EVDO.<meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="font-family: Tahoma, Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><span style="font-weight: bold; ">First, let me start with the CD slide-in trick:</span><br> <br>1. Take an old CD or DVD.<br><br><a href="http://i293.photobucket.com/albums/mm47/Gigacore/06.jpg" target="_blank" style="color: rgb(75, 76, 76); text-decoration: none; "><img src="http://s293.photobucket.com/albums/mm47/Gigacore/th_06.jpg" border="0" alt="[Image: th_06.jpg]" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; "></a><br> <br>2. Connect the device:<br><br><a href="http://i293.photobucket.com/albums/mm47/Gigacore/03.jpg" target="_blank" style="color: rgb(75, 76, 76); text-decoration: none; "><img src="http://s293.photobucket.com/albums/mm47/Gigacore/th_03.jpg" border="0" alt="[Image: th_03.jpg]" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; "></a><br> <br>3. Swivel-Open the antenna of the device to about 90 degree: <br><br><a href="http://i293.photobucket.com/albums/mm47/Gigacore/11-1.jpg" target="_blank" style="color: rgb(75, 76, 76); text-decoration: none; "><img src="http://s293.photobucket.com/albums/mm47/Gigacore/th_11-1.jpg" border="0" alt="[Image: th_11-1.jpg]" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; "></a><br> <br>4. Slide-In an Old CD or a DVD into the antenna, such that the CD’s hole will enter into the antenna.<br><br><a href="http://i293.photobucket.com/albums/mm47/Gigacore/04.jpg" target="_blank" style="color: rgb(75, 76, 76); text-decoration: none; "><img src="http://s293.photobucket.com/albums/mm47/Gigacore/th_04.jpg" border="0" alt="[Image: th_04.jpg]" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; "></a> <a href="http://i293.photobucket.com/albums/mm47/Gigacore/05.jpg" target="_blank" style="color: rgb(75, 76, 76); text-decoration: none; "><img src="http://s293.photobucket.com/albums/mm47/Gigacore/th_05.jpg" border="0" alt="[Image: th_05.jpg]" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; "></a><br> <br>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.<br><br><span style="font-weight: bold; ">Now the second method requires a USB extension cable or a USB HUB. Here you go:</span><br> <br>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.<br><br><a href="http://i293.photobucket.com/albums/mm47/Gigacore/02.jpg" target="_blank" style="color: rgb(75, 76, 76); text-decoration: none; "><img src="http://s293.photobucket.com/albums/mm47/Gigacore/th_02.jpg" border="0" alt="[Image: th_02.jpg]" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; "></a><br> <br>2. Connect one end of the extension cable or the HUB to the EVDO data cable….<br><br><a href="http://i293.photobucket.com/albums/mm47/Gigacore/07.jpg" target="_blank" style="color: rgb(75, 76, 76); text-decoration: none; "><img src="http://s293.photobucket.com/albums/mm47/Gigacore/th_07.jpg" border="0" alt="[Image: th_07.jpg]" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; "></a><br> <br>3. ….and plug-in the device to the other end or to one of the hub’s port.<br><br><a href="http://i293.photobucket.com/albums/mm47/Gigacore/08.jpg" target="_blank" style="color: rgb(75, 76, 76); text-decoration: none; "><img src="http://s293.photobucket.com/albums/mm47/Gigacore/th_08.jpg" border="0" alt="[Image: th_08.jpg]" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; "></a><br> <br>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.<br> <br>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.<br><br><a href="http://i293.photobucket.com/albums/mm47/Gigacore/09.jpg" target="_blank" style="color: rgb(75, 76, 76); text-decoration: none; "><img src="http://s293.photobucket.com/albums/mm47/Gigacore/th_09.jpg" border="0" alt="[Image: th_09.jpg]" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; "></a> <a href="http://i293.photobucket.com/albums/mm47/Gigacore/10.jpg" target="_blank" style="color: rgb(75, 76, 76); text-decoration: none; "><img src="http://s293.photobucket.com/albums/mm47/Gigacore/th_10.jpg" border="0" alt="[Image: th_10.jpg]" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; "></a><br> <br>Here ends the tutorial..</span> ARVhttp://www.blogger.com/profile/13867592943489571397noreply@blogger.com0tag:blogger.com,1999:blog-4205825614598938724.post-66871110553848743632010-07-27T05:53:00.001-07:002010-07-27T05:53:59.591-07:00Tuning Ubuntu 9.10 Karmic for speed and better internet connectivity<br> After installing Ubuntu Karmic 9.10, I changed the following tunables<br> <span class="Apple-style-span" style="font-family: Georgia,Utopia,'Palatino Linotype',Palatino,serif; font-size: 14px; line-height: 18px;"> <div class="post-body entry-content" style="width: 498px; line-height: 1.4; font-size: 15px; position: relative;"><br> swappiness and vfs_cache_pressure<br> <br> 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<br> <br> If we decrease swappiness, speed of opening programs feels faster<br> <br> to get current swappiness of system<br> <br> <span style="font-size: large;"><b>sudo sysctl -q vm.swappiness</b></span><br> <br> to change swappiness to value 20, which is low<br> <b><br> </b><br> <b><span style="font-size: large;">sudo sysctl -w vm.swappiness=20</span></b><br> <br> 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<br> <br> to get current vfs_cache_pressure<br> <br> <span style="font-size: large;"><b>sudo sysctl -q vm.vfs_cache_pressure</b></span><br> <br> to set vfs_cache_pressure<br> <br> <span style="font-size: large;"><b>sudo sysctl -w vm.vfs_cache_pressure = 50</b></span><br> <br> You can read original tuxradar article about improving speed by clicking this <a moz-do-not-send="true" href="http://tuxradar.com/content/make-linux-faster-and-lighter" style="text-decoration: none; color: rgb(201, 95, 95);">http://tuxradar.com/content/make-linux-faster-and-lighter</a> <br> <br> 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<br> <br> <a moz-do-not-send="true" href="http://www.debian.org/devel/debian-installer/errata" style="text-decoration: none; color: rgb(138, 46, 46);">Debian Errata, see buggy routers may cause problem</a><br> <br> or<br> <br> <a moz-do-not-send="true" href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=401435" style="text-decoration: none; color: rgb(138, 46, 46);">http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=401435</a><br> <br> or<br> <br> <a moz-do-not-send="true" href="http://kerneltrap.org/node/6723" style="text-decoration: none; color: rgb(138, 46, 46);">http://kerneltrap.org/node/6723</a><br> <br> 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<br> <br> Hit the site you are having trouble viewing, if you feel there is problem open terminal and change the system param as follows<br> <br> <span style="font-size: large;"><b>sudo sysctl -w </b><b>net.ipv4.tcp_rmem="4096 65536 65536"</b></span><br> <br> and<b> <br> </b><br> <br> <span style="font-size: large;"><b>sudo sysctl -w net.ipv4.tcp_wmem="4096 65536 65536"</b></span><br> <br> 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<br> <br> To make above changes permanent upon reboot(speed increase and net improvements) <br> <br> Add these lines to end of <b>/etc/sysctl.conf</b> by editing it<b> </b>(<b>sudo vi etc/sysctl.conf</b>)<br> <br> <code><br> #decrease swappiness<br> vm.swappiness=20<br> #improve file/folder browsing speed<br> vm.vfs_cache_pressure=50<br> #debian tcp window scaling errata fix<br> net.ipv4.tcp_rmem=4096 65536 65536<br> net.ipv4.tcp_wmem=4096 65536 65536<br> </code><br> <br> Note: <b>sudo sysctl -p </b>reapplies all the settings from /etc/sysctl.conf and can be used<br> </div> </span> ARVhttp://www.blogger.com/profile/13867592943489571397noreply@blogger.com0tag:blogger.com,1999:blog-4205825614598938724.post-75978749410507044432010-07-25T08:50:00.001-07:002010-07-25T08:50:26.669-07:00How To mount Hard Drive Partitions Everytime when Login to Ubuntu Linux automatically<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span class="Apple-style-span" style="font-family: 'Helvetica Neue','Lucida Grande',Helvetica,Arial,Verdana,sans-serif; font-size: 14px;"> <h2 id="Mounting Fakeraid" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.3em;"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: Arial,Tahoma,Helvetica,FreeSans,sans-serif; font-size: 13px; line-height: 18px;">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!<br> 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:<br> <br> 1. I cannot keep any image from other hard drive as Wallpaper.<br> 2. Amarok cannot start playing songs. It gives me an error saying 'File not located'. This is the most important problem.<br> <br> So if you have been hounded by this problem too, then rejoice cause I have finally found a solution to this problem. <br> 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.</span></span></h2> <h2 id="Mounting Fakeraid" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.3em;"><br> </h2> here are some methods.<br> <br> <h2 id="Mounting Fakeraid" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.3em;"><br> </h2> <h2 id="Mounting Fakeraid" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.3em;">Mounting Fakeraid</h2> <span class="anchor" id="line-166"></span> <p class="line862">Its assumed you have formated you raid set using<span class="Apple-converted-space"> </span><tt class="backtick">dmraid</tt><span class="Apple-converted-space"> </span>command with instructions found at<span class="Apple-converted-space"> </span><a href="/community/FakeRaidHowto" style="border-width: 0px; color: rgb(217, 13, 25);">FakeRaidHowto</a><span class="anchor" id="line-167"></span><span class="anchor" id="line-168"></span></p> <p class="line862">You need to know the name of your raid set<span class="anchor" id="line-169"></span><span class="anchor" id="line-170"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">sudo dmraid -ay</pre> <span class="anchor" id="line-171"></span> <p class="line867"><span class="anchor" id="line-172"></span><span class="anchor" id="line-173"></span><span class="anchor" id="line-174"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">RAID set "sil_aiaedhaeafaa" already active RAID set "sil_aiaedhaeafaa1" already active</pre> <span class="anchor" id="line-175"></span> <p class="line862">Edit<span class="Apple-converted-space"> </span><tt class="backtick">fstab</tt><span class="Apple-converted-space"> </span>as per instructions above :<span class="anchor" id="line-176"></span><span class="anchor" id="line-177"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">nano -w /etc/fstab</pre> <span class="anchor" id="line-178"></span> <p class="line862">An example line to add<span class="anchor" id="line-179"></span><span class="anchor" id="line-180"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">/dev/mapper/sil_aiaedhaeafaa1 /media/raid reiserfs user,nosuid,exec,nodev 0 0</pre> <span class="anchor" id="line-181"></span> <p class="line862">Make sure you create the directory<span class="Apple-converted-space"> </span><tt class="backtick">/media/raid</tt><span class="anchor" id="line-182"></span><span class="anchor" id="line-183"></span><span class="anchor" id="line-184"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">mkdir /media/raid</pre> <span class="anchor" id="line-185"></span><span class="anchor" id="line-186"></span> <p class="line874">Reboot<span class="anchor" id="line-187"></span><span class="anchor" id="line-188"></span><span class="anchor" id="line-189"></span></p> <h2 id="Mounting and checking the partitions" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.3em;">Mounting and checking the partitions</h2> <span class="anchor" id="line-190"></span> <p class="line874">In the terminal, type the following command.<span class="anchor" id="line-191"></span><span class="anchor" id="line-192"></span><span class="anchor" id="line-193"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">sudo mount -a</pre> <span class="anchor" id="line-194"></span><span class="anchor" id="line-195"></span> <p class="line874">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.<span class="Apple-converted-space"> </span><span class="anchor" id="line-196"></span>If the partition being examined contains files, the modifications were successful, and the partitions will be automatically mounted every time the system is restarted.<span class="anchor" id="line-197"></span><span class="anchor" id="line-198"></span></p> <p class="line862">If no files are found, please see<span class="Apple-converted-space"> </span><a href="/community/XChatHowto" style="border-width: 0px; color: rgb(217, 13, 25);">XChatHowto</a><span class="Apple-converted-space"> </span>and join #ubuntu on irc.freenode.net.<span class="anchor" id="line-199"></span><span class="anchor" id="line-200"></span></p> <h1 id="Using pysdm" style="border-bottom: 1px solid rgb(109, 76, 7); margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.6em;">Using pysdm</h1> <span class="anchor" id="line-201"></span> <p class="line874">Pysdm is a program to automatically setup partitions every time Ubuntu starts.<span class="Apple-converted-space"> </span><span class="anchor" id="line-202"></span>This is verified to work in 9.04.<span class="anchor" id="line-203"></span><span class="anchor" id="line-204"></span></p> <h2 id="Installation" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.3em;">Installation</h2> <span class="anchor" id="line-205"></span> <p class="line867"><span class="anchor" id="line-206"></span><span class="anchor" id="line-207"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">sudo apt-get install pysdm</pre> <span class="anchor" id="line-208"></span><span class="anchor" id="line-209"></span> <h2 id="Usage" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.3em;">Usage</h2> <span class="anchor" id="line-210"></span> <p class="line874">Select each partition you want to change in the list.<span class="Apple-converted-space"> </span><span class="anchor" id="line-211"></span>Note the type. Often it is ext3 (Linus) or NTFS (Windows).<span class="Apple-converted-space"> </span><span class="anchor" id="line-212"></span>Use assistant and press OK. By default the partition is mounted at boottime.<span class="Apple-converted-space"> </span><span class="anchor" id="line-213"></span>You can also mount the partition now.<span class="Apple-converted-space"> </span><span class="anchor" id="line-214"></span>Press Apply.<span class="Apple-converted-space"> </span><span class="anchor" id="line-215"></span>Done.<span class="anchor" id="line-216"></span><span class="anchor" id="line-217"></span></p> <h1 id="Using GNOME-Mount" style="border-bottom: 1px solid rgb(109, 76, 7); margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.6em;">Using GNOME-Mount</h1> <span class="anchor" id="line-218"></span> <p class="line874">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.<span class="anchor" id="line-219"></span><span class="anchor" id="line-220"></span></p> <h2 id="Installation" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.3em;">Installation</h2> <span class="anchor" id="line-221"></span> <p class="line867"><span class="anchor" id="line-222"></span><span class="anchor" id="line-223"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">sudo apt-get install gnome-mount</pre> <span class="anchor" id="line-224"></span><span class="anchor" id="line-225"></span> <h2 id="Usage" style="margin: 0px; padding: 2px 0px; font-weight: normal; color: rgb(90, 51, 32); line-height: 1.2em; font-size: 1.3em;">Usage</h2> <span class="anchor" id="line-226"></span> <p class="line874">You can mount a disk as a normal user via<span class="anchor" id="line-227"></span><span class="anchor" id="line-228"></span><span class="anchor" id="line-229"></span></p> <pre style="border: 1px dashed rgb(193, 180, 150); padding: 4pt; background-color: rgb(240, 238, 230); font-family: courier,monospace; white-space: pre-wrap; word-wrap: break-word;">gnome-mount -p myDiskLabel</pre> <span class="anchor" id="line-230"></span> <p class="line862">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.<br> Please refer <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <a href="https://help.ubuntu.com/community/AutomaticallyMountPartitions">https://help.ubuntu.com/community/AutomaticallyMountPartitions for details<br> </a></p> </span></span> ARVhttp://www.blogger.com/profile/13867592943489571397noreply@blogger.com0tag:blogger.com,1999:blog-4205825614598938724.post-33801134195625782212010-07-24T10:41:00.001-07:002010-07-24T10:41:52.321-07:00How to install Ubuntu themes<div class="KonaBody"><p>This tutorial will guide you through installing new Desktop Themes in Ubuntu Linux – and provide a couple of resources to find themes. <span id="more-2815"></span></p> <ol><li> 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 <a href="http://www.gnome-look.org/index.php?xcontentmode=101" target="_blank" rel="nofollow">gnome-look.org</a> is a great place to find even more themes. </li> <li> 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 <strong>System</strong> -> <strong>Preferences</strong> -> <strong>Appearance</strong>. </li><p><a href="http://www.simplehelp.net/images/ubuntu_themes/ubuntu_themes_00.png"><img src="http://www.simplehelp.net/images/ubuntu_themes/ubuntu_themes_00a.png" alt=""><br> click to enlarge</a></p><li> On the <strong>Appearance Preferences</strong> page, make sure that the <strong>Theme</strong> tab is selected. Then click the <strong>Install…</strong> button. </li><p><img src="http://www.simplehelp.net/images/ubuntu_themes/ubuntu_themes_01a.png" alt=""><br> click to enlarge</p><li> Navigate to the theme file that you downloaded, select it, and click <strong>Open</strong>. </li><p><img src="http://www.simplehelp.net/images/ubuntu_themes/ubuntu_themes_02a.png" alt=""><br> click to enlarge</p><li> The theme should now install. Click <strong>OK</strong>. </li><p><img src="http://www.simplehelp.net/images/ubuntu_themes/ubuntu_themes_03.png" alt=""></p><li> Click the <strong>Apply New Theme</strong> button. </li> <p><img src="http://www.simplehelp.net/images/ubuntu_themes/ubuntu_themes_04.png" alt=""></p><li> And Ubuntu will now apply that theme, changing the look and style of Ubuntu. </li><p><img src="http://www.simplehelp.net/images/ubuntu_themes/ubuntu_themes_05a.png" alt=""><br> click to enlarge</p><li> Repeat the above steps to try out other themes. That's it! </li></ol> </div> ARVhttp://www.blogger.com/profile/13867592943489571397noreply@blogger.com0tag:blogger.com,1999:blog-4205825614598938724.post-72060361622540168632010-07-24T03:33:00.001-07:002010-07-24T03:33:39.119-07:00HOWTO: Parental control. Now with GUI too!HOWTO: Parental control. Now with GUI too! (updated version)<br>Description:<br>WebContentControl is a parental control GUI (more specifically a GUI for <br>DansGuardian+TinyProxy+FireHol).<p>Official website: <a href="https://launchpad.net/webcontentcontrol">https://launchpad.net/webcontentcontrol</a><p>Feedback is very welcome. And help too!<p>Please report bugs at <a href="https://bugs.launchpad.net/webcontentcontrol">https://bugs.launchpad.net/webcontentcontrol</a><p>Pre-Installation:<br>Please make sure you have the "universe" repository enabled.<p>Go to System->Administration->Software sources and check the "universe" <br>repository.<br>More info: <a href="https://help.ubuntu.com/community/Repositories/Ubuntu">https://help.ubuntu.com/community/Repositories/Ubuntu</a><p>Installation:<br>There are three ways to install WebContentControl:<br>1)Through the PPA repositories<br>2)From the Debian package<br>3)From source<p>1)Through the PPA repositories<br>Code:<p>deb <a href="http://ppa.launchpad.net/webcontentcontrol/webcontentcontrol/ubuntu">http://ppa.launchpad.net/webcontentcontrol/webcontentcontrol/ubuntu</a> <br>lucid main<br>deb-src <br><a href="http://ppa.launchpad.net/webcontentcontrol/webcontentcontrol/ubuntu">http://ppa.launchpad.net/webcontentcontrol/webcontentcontrol/ubuntu</a> <br>lucid main<p>See here for how to add repositories:<br><a href="https://help.ubuntu.com/community/Repositories/Ubuntu">https://help.ubuntu.com/community/Repositories/Ubuntu</a><p>Add the repos by command-line:<br>Code:<p>sudo add-apt-repository ppa:webcontentcontrol/webcontentcontrol<br>sudo apt-get update<p>Once you've added those repositories, just:<br>Code:<p>sudo apt-get install webcontentcontrol<p>(Or use Synaptic package manager if you prefer a GUI.)<p>2)From the Debian package<br>Download the latest .deb from the site and double-click on it or by <br>command-line:<br>Code:<p>sudo gdebi <package>.deb<p>3)From source<br>Code:<p>sudo apt-get install gambas2-runtime gambas2-gb-qt gambas2-gb-form <br>gambas2-gb-form-dialog gambas2-gb-qt-kde gambas2-gb-qt-kde-html<br>sudo apt-get install dansguardian tinyproxy firehol<p>Then download the latest version on <br><a href="https://launchpad.net/webcontentcontrol/+download">https://launchpad.net/webcontentcontrol/+download</a> and:<br>Code:<p>tar -xzvf webcontentcontrol-1.0.tar.gz<br>cd webcontentcontrol-1.0<br>./configure && make && sudo make install<p>The shortcut should be created in Applications->System tools.<br>If it isn't, the command-line to launch it is:<br>Code:<p>/usr/bin/webcontentcontrol<p>How to uninstall it:<br>Code:<p>sudo make uninstallARVhttp://www.blogger.com/profile/13867592943489571397noreply@blogger.com0tag:blogger.com,1999:blog-4205825614598938724.post-89317289115038212782010-07-24T02:42:00.001-07:002010-07-24T02:42:29.170-07:00How to Block Unwanted Website in Ubuntu Linux?The process to block websites in Ubuntu Linux is very simple and doesn't <br>require any third party application. You just need to make a simple <br>entry in the /etc/hosts file. /etc/hosts is a very important file which <br>handles DNS and internet handling on Linux based systems. In order to <br>block some site from opening, open the /etc/hosts file by typing the <br>following command on the terminal:<p>gedit /etc/hosts<p>and add the following line:<p>127.0.0.1 <a href="http://domain.com">domain.com</a><p>Example 127.0.0.1 <a href="http://yahoo.com">yahoo.com</a><p>Here replace <a href="http://domain.com">domain.com</a> with the name of the domain that you wish to <br>block. Once the above exercise is done, who ever tries to access the <br>site will get a message "Failed to Connect".ARVhttp://www.blogger.com/profile/13867592943489571397noreply@blogger.com0tag:blogger.com,1999:blog-4205825614598938724.post-67534267905649634532010-07-23T13:38:00.000-07:002010-07-23T13:38:12.960-07:00show-homemycomputer-in-ubuntu
<p> * Right Click on the top left corner of your desktop(notice the small ubuntu icon) as shown in the screenshot below and select Edit Menus option.</p><p>
</p><p>
* Tick the Configuration Editor from the System Tools menu.</p><p>
</p><p>
* Now close the above window and then Goto Applications - System Tools - Configuration Editor</p><p>
</p><p>
* Now select the apps dropdown menu.</p><p>
</p><p>
* Goto apps - nautilus - desktop and tick the two options, computer_icon_visible and home_icon_visible ie.</p><p>
</p>ARVhttp://www.blogger.com/profile/13867592943489571397noreply@blogger.com0tag:blogger.com,1999:blog-4205825614598938724.post-56043841568382682092010-07-23T11:20:00.000-07:002010-07-23T11:20:54.454-07:00Re: Internet speed has increased after installing Lucid
<p>Sometimes people screw things up by tinkering with caching at the application level or system settings like the MTU and driver options, and then software updates unscrew them.</p><p>
</p><p>
It's also theoretically possible that Ubuntu had a suboptimal kernel network configuration (things like explicit congestion notification). They might also have tuned the kernel's TCP stack. I believe the conventional wisdom on some of that has changed over the past couple of years.</p><p>
</p><p>
For example, I noticed a while back that the the defaults set by the kernel developers disagree with those recommended by the Web100 project researchers.</p><p>
</p><p>
</p><p>
I don't use Ubuntu, but last time I checked, my distro's kernel is set like this by default</p><p>
Code:</p><p>
net.core.wmem_max = 109568</p><p>
net.core.rmem_max = 109568</p><p>
net.ipv4.tcp_wmem = 4096 65536 179776</p><p>
net.ipv4.tcp_rmem = 4096 87380 179776</p><p>
And I change it to this:</p><p>
Code:</p><p>
net.core.wmem_max = 4194304</p><p>
net.core.rmem_max = 4194304</p><p>
net.ipv4.tcp_wmem = 4096 65536 4194304</p><p>
net.ipv4.tcp_rmem = 4096 87380 4194304</p><p>
Those settings I've been using are a compromise between the defaults and what is recommended by the research I read at:</p><p>
http://fasterdata.es.net/TCP-tuning//linux.html</p><p>
http://www.web100.org/download/kernel/<version>/README.web100</p><p>
</p><p>
I'd be curious to see how Ubuntu is set up:</p><p>
Code:</p><p>
cat /proc/sys/net/core/wmem_max</p><p>
cat /proc/sys/net/ipv4/tcp_wmem</p><p>
cat /proc/sys/net/ipv4/tcp_rmem</p><p>
Who knows, maybe I'm massively suboptimizing my own. </p>ARVhttp://www.blogger.com/profile/13867592943489571397noreply@blogger.com0tag:blogger.com,1999:blog-4205825614598938724.post-46968086861989157842010-07-23T10:04:00.000-07:002010-07-23T10:04:30.703-07:00Basic ubuntu softwares needed
<p><strong>1. Restricted Extras</strong></p><p>
</p><p>
The Ubuntu Restricted Extras will install Adobe Flash Player, Java Runtime Environment (JRE) (sun-java-jre) with Firefox plug-ins (icedtea), a set of Microsoft Fonts (msttcorefonts), multimedia codecs (w32codecs or w64codecs), mp3-compatible encoding (lame), FFMpeg, extra Gstreamer codecs, the package for DVD decoding (libdvdread4, but see below for info on libdvdcss2), the unrar archiver, odbc, and cabextract. It also installs multiple "stripped" codecs and avutils (libavcodec-unstripped-52 and libavutil-unstripped-49). This is a single command approach.</p><p>
</p><p>
<strong>sudo apt-get install ubuntu-restricted-extras</strong></p><p>
Note: Installation only works completely and properly when done from the command-line Terminal. The entire package will not usually install completely from within a Package Manager.</p><p>
<strong>2. Multimedia</strong></p><p>
</p><p>
Audio and Video Playback</p><p>
</p><p>
Playing a Video (XVid, DivX etc.) or Audio (MP3) file has become pretty easy. Just double click the file you want and allow Totem to automatically download the needed codecs. But you could also do this by yourself very easily by installing a package which contains all the needed codecs and more. Just look above at Ubuntu Restricted Extras.</p><p>
DVD Playback</p><p>
</p><p>
To play encrypted DVDs you must install libdvdcss2. In Ubuntu 10.04 there is no need to manually configure the Medibuntu repository. If you have previously installed Ubuntu Restricted Extras skip the following command. If you haven't open a terminal and type:</p><p>
</p><p>
<em><strong> sudo apt-get install libdvdread4</strong></em></p><p>
Next type:</p><p>
</p><p>
<em><strong> sudo /usr/share/doc/libdvdread4/install-css.sh</strong></em></p><p>
MPlayer/SMPlayer</p><p>
</p><p>
Personally I prefer mplayer and smplayer (mplayer's GUI) for video playback. It supports almost any video type, external subtitles as well as DVD playback as long as you have the needed codecs installed as shown previously. To install it type:</p><p>
</p><p>
<em><strong> sudo apt-get install mplayer smplayer</strong></em></p><p>
You will find it under Applications -> Video & Sound -> SMPlayer</p><p>
VLC</p><p>
</p><p>
Many users prefer the Video Lan Client (VLC) as their multimedia player. VLC supports many formats without need for additional codecs. Simply install it by typing:</p><p>
</p><p>
sudo apt-get install vlc vlc-plugin-pulse</p><p>
K9copy</p><p>
</p><p>
K9copy is a free open source DVD backup, copying, compression, and authoring utility that requires libdvdcss. For other info, see this or this guide. You can easily create MPEG-2. MPEG-4, or DVD videos with this utility. To install it type:</p><p>
</p><p>
<em><strong> sudo apt-get install k9copy</strong></em></p><p>
For more information you can read my How to backup your DVDs (in dvd, xvid, mpeg-4, x264 formats) using k9copy guide.</p><p>
DVD::Rip</p><p>
</p><p>
DVD::Rip is a DVD backup/copy program, written in GTK-based perl, that uses the transcode video/audio processing and conversion tools. To install it type:</p><p>
</p><p>
<em><strong> sudo apt-get install dvdrip</strong></em></p><p>
For more information you can read my How to rip a DVD to DivX/XviD/H264 using DVD::Rip </p><p>
2ManDVD</p><p>
</p><p>
2ManDVD is a GUI utility for creating DVD videos. It is the successor of ManDVD. For more information on how to install it and use it read my How to author a DVD using 2ManDVD in Linux guide.</p><p>
DeVeDe</p><p>
</p><p>
DeVeDe is a program to create video DVDs and CDs suitable for home players (i.e. VCD, sVCD or CVD) from any source video file that is supported by MPlayer. For more information on how to install it and use it read my How to create a custom DVD using DeVeDe .</p><p>
<strong>3. Java</strong></p><p>
</p><p>
Ubuntu 10.04 uses OpenJDK, which mostly derives from Sun's JRE, as its default flavor of JRE. Moreover Icddtea is the default browser plugin to run Java applets. Most users should be fine with those JRE versions. If you don't have them installed simply type:</p><p>
sudo apt-get install openjdk-6-jre icedtea6-plugin</p><p>
However you can still install Sun's JRE and JDK like this if you are not satisfied with those packages. To do so first you must enable the partner repository. Go to System > Administration > Synaptic Package Manager > Settings > Repositories > Other Software and enable the partner repository. Now you can either search for sun-java6-jre, sun-java6-plugin, sun-java6-jdk using Synaptic or type the following commands in a terminal.</p><p>
Sun Java Runtime Environment (JRE) and Firefox Java Plugin</p><p>
</p><p>
Close Firefox if it's running, open a terminal and type:</p><p>
</p><p>
sudo apt-get install sun-java6-jre sun-java6-plugin</p><p>
Sun Java Development Kit (JDK)</p><p>
</p><p>
If you want to build applications, applets, and components using the Java programming language you need to install JDK.</p><p>
sudo apt-get install sun-java6-jdk</p><p>
Now you must choose the default Java you want to use. Open a terminal and type:</p><p>
sudo update-alternatives --config java</p><p>
And follow the instructions. Simply select the number for java-6-sun.</p><p>
<strong>4. Google Earth</strong></p><p>
</p><p>
Google Earth lets you fly anywhere on Earth to view satellite imagery, maps, terrain, 3D buildings, from galaxies in outer space to the canyons of the ocean. You can explore rich geographical content, save your toured places, and share with others. To install it type:</p><p>
</p><p>
sudo apt-get install googleearth-package</p><p>
make-googleearth-package --force</p><p>
sudo dpkg -i googleearth*.deb</p><p>
Afterwards you will find Google Earth under Applications > Internet > Google Earth</p><p>
<strong>5. Google Chromium</strong></p><p>
</p><p>
Chromium is Google's open source web browser and it's fast! You should give it a try. To install it type:</p><p>
sudo apt-get install chromium-browser</p><p>
If you want a daily version of Chromium (this version might have various problems and even crash) you must first add the gpg key: </p><p>
</p><p>
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 4E5E17B5</p><p>
Next You will have to add the following chromium-daily repo to your 3rd party repository list. Go to System - Administration - Software Sources, select the Other Software tab and Click ADD.</p><p>
deb http://ppa.launchpad.net/chromium-daily/ppa/ubuntu lucid main</p><p>
sudo apt-get update</p><p>
sudo apt-get install chromium-browser</p><p>
Now you will find it under Applications > Internet > Chromium Web Browser.</p><p>
<strong>6. Eye Candy</strong></p><p>
</p><p>
Compiz Fusion</p><p>
</p><p>
Compiz Fusion allows you to use advanced desktop effects such as the rotating cube desktop. </p><p>
</p><p>
sudo apt-get install compiz compizconfig-settings-manager compiz-fusion-plugins-main \</p><p>
compiz-fusion-plugins-extra emerald librsvg2-common fusion-icon</p><p>
Run Applications -> System Tools -> Compiz Fusion Icon. A blue icon will appear to the tray. From here you can configure Compiz-Fusion.</p><p>
Conky</p><p>
</p><p>
Conky is a light-weight system monitor for X, that displays any information on your desktop.</p><p>
</p><p>
sudo apt-get install conky</p><p>
Screenlets</p><p>
</p><p>
Screenlets are small applications that are laying on your desktop. Eye candy stuff and useful in many ways. Just type:</p><p>
</p><p>
sudo apt-get install screenlets</p><p>
Go to Applications -> Accessories –> Screenlets choose the screenlet you want click launch/add (you can choose Auto start on login)</p><p>
</p><p>
You can download additional screenlets from www.gnome-look.org or screenlets.org from http://screenlets.org/index.php/Category:UserScreenlets</p><p>
Cairo Dock</p><p>
</p><p>
Cairo Dock is a light eye-candy fully themable animated dock for any Linux desktop. It has a family-likeness with OSX dock, but with more options.</p><p>
sudo apt-get install cairo-dock cairo-dock-plug-ins</p><p>
You will find it under Applications > Accessories > Cairo Dock</p><p>
Gnome Do</p><p>
</p><p>
GNOME Do (Do) is an intelligent launcher tool that makes performing common tasks on your computer simple and efficient. Do not only allows you to search for items in your desktop environment (e.g. applications, contacts, bookmarks, files, music), it also allows you to specify actions to perform on search results (e.g. run, open, email, chat, play).</p><p>
sudo apt-get install gnome-do</p><p>
You will find it under Applications > Accessories > Cairo Dock</p><p>
Windows Buttons Order</p><p>
</p><p>
A lot of users complain that the new place for the minize - maximize - close window buttons isn't good. Mwbuttons is a script that allows you to easily change the place the buttons place from left to right. To install and run it type:</p><p>
wget http://launchpad.net/mwbuttons/trunk/v0.2/+download/mwbuttons</p><p>
chmod +x mwbuttons</p><p>
./mwbuttons</p><p>
Now just select Settings > Karmic style and the buttons will go to the right.</p><p>
<strong>7. Internet</strong></p><p>
</p><p>
IRC</p><p>
</p><p>
XChat is an IRC chat program for both Linux and Windows. It allows you to join multiple IRC channels (chat rooms) at the same time, talk publicly, private one-on-one conversations etc. Even file transfers are possible. </p><p>
</p><p>
sudo apt-get install xchat</p><p>
You will find it under Applications -> Internet -> XChat IRC</p><p>
</p><p>
Ubuntu 9.10 uses empathy as its default IM (Instant Messaging) client. A few others IMs are:</p><p>
Pidgin</p><p>
</p><p>
Pidgin is an open source IM application. It is the previous default in the Ubuntu (Gnome) desktop.</p><p>
sudo apt-get install pidgin</p><p>
aMSN</p><p>
</p><p>
aMSN is an MSN Messenger utility that functions like the original client. To install it type:</p><p>
</p><p>
sudo apt-get install amsn</p><p>
You will find it under Applications -> Internet -> aMSN</p><p>
Emesene</p><p>
</p><p>
Emesene is an MSN messenger client that uses a simplified interface similar to the original client. To install it type</p><p>
</p><p>
sudo apt-get install emesene</p><p>
You will find it under Applications -> Internet -> Emesene</p><p>
Skype</p><p>
</p><p>
Skype is a proprietary integrated VOIP and video conferencing program similar to Ekiga. To install skype on Ubuntu 10.04 just click on the Ubuntu 8.10+ 32bit version or Ubuntu 8.10+ 64 bit version. Download skype .</p><p>
</p><p>
<strong>8. Torrent clients</strong></p><p>
</p><p>
Transmission is the default BitTorrent client in Ubuntu 9.10. Here are some additional clients if you want to try them.</p><p>
Deluge</p><p>
</p><p>
Deluge is a lightweight, Free Software, cross-platform BitTorrent client.</p><p>
</p><p>
sudo apt-get install deluge</p><p>
You will find it under Applications -> Internet -> Deluge BitTorrent client</p><p>
Vuze</p><p>
</p><p>
Vuze is the next version of Azureus. To install it type:</p><p>
</p><p>
sudo apt-get install vuze</p><p>
You will find it under Applications -> Internet -> Vuze</p><p>
</p><p>
<strong>9. NTFS read/write support</strong></p><p>
</p><p>
Ubuntu has a graphical configuration tool for enabling read/write on NTFS partitions, either from a Windows/Linux dual boot system or from external hard disks. To install it type:</p><p>
sudo apt-get install ntfs-config</p><p>
Run it through System -> Administration -> NTFS Configuration Tool.</p><p>
NTFS-Config will auto detect your NTFS partitions and afterwards you can enable write support for them. The will be mounted under /media. </p>ARVhttp://www.blogger.com/profile/13867592943489571397noreply@blogger.com0tag:blogger.com,1999:blog-4205825614598938724.post-77775277115350540472010-07-23T09:33:00.000-07:002010-07-23T09:33:27.846-07:00How To Disable IPv6 In Ubuntu 9.10 Karmic Koala
<p>The easy way: if you use Firefox, you can just disable IPv6 in Firefox. Type about:config and search for:</p><p>
network.dns.disableIPv6</p><p>
</p><p>
and toggle it to TRUE.</p><p>
</p><p>
The 'hard' way: disable IPv6 system-wide: you must edit the GRUB. Be very careful, and edit it correctly or else your system might not boot!</p><p>
</p><p>
1. Open a terminal and type the following command (if you don't use Gedit, replace it with your text editor such as Kate, etc).</p><p>
sudo gedit /etc/default/grub</p><p>
</p><p>
2. And search for this:</p><p>
GRUB_CMDLINE_LINUX</p><p>
</p><p>
Modify it so it looks like this:</p><p>
GRUB_CMDLINE_LINUX="ipv6.disable=1"</p><p>
</p><p>
3. Now, let's update the GRUB:</p><p>
sudo update-grub2</p><p>
</p><p>
Or if you don't use GRUB 2, do:</p><p>
sudo update-grub</p><p>
</p><p>
4. And finally, restart your system.</p><p>
</p>ARVhttp://www.blogger.com/profile/13867592943489571397noreply@blogger.com0