Nov 30 2011

Faster Browsing on Ubuntu [1130]

One of the best things with Ubuntu or any flavour of Linux is that you can basically make it do whatever you want it to as long as you put the time and effort in. There was a recurring argument a couple of years ago between myself and a close friend regarding running a Squid cache server on a clients linux server. I had always argued that you know running a centralised Squid server is really dependent on a lot of traffic going through it on a regular basis to build up the cache reserve to make it a useful investment.

 

However it didn’t matter how much I argued it was never changed, and we just had to put up with it. On a couple occasions I have seen a Squid server slow down the browsing speed on local machines however I have now tested this rigorously on a server within my own personal network to see if it is a worthwhile investment of time and what I found out was that yes for a larger scale distribution this works. You have a lot more traffic going through the server for the Squid system to capture and therefore a much greater amount of data that can be used for calls after the capture time.

 

Now what I did find out is that instead of caching the pages you access, why not just reduce the resolution time and therefore cut down on at least one of the lengthy time variables it takes to launch a page in your own browser.

 

To be able to do this on Linux you will need to get dnsmasq installed.

 

  • sudo apt-get install dnsmasq

 

Then you will need to configure dnsmasq correctly. The most easiest way to do this will be using the terminal and your favourite editor. My command would look something like this:

 

  • sudo nano /etc/dnsmasq.conf

 

You will then need to find the line which says “#listen-address=”. You will need to remove the ‘#’ and add “127.0.0.1” after the ‘=’ to set this variable up correctly. Now make sure you save the changes and exit from the editor you have been using.

 

Now that that is done you will want to open up the dhclient.conf file “sudo nano /etc/dhcp3/dhclient.conf and add in the line “prepend domain-name-servers 127.0.0.1;” to the file to make your other changes work.

 

Next is the changes to your resolv.conf file which you may need to change and you will need to add in an additional line at the top of the file. This line should be nameserver 127.0.0.1, after you have added this line in you will need to save the file and exit out of your editor again.

 

After doing this you will need to restart two services, firstly restart your networking and after that restart dnsmasq to put the new config into use.

 

After you have done this you should have a nice little dnsmasq setup on your own computer caching the name queries removing the time it takes to resolve the name. You should be able to notice a different in which the pages load however please note that this does not “speed up your connection”, your connection, download and upload will all be the same. Just the method in which the pages are resolved.

 

As for seeing that this works, you can quickly test this in the terminal by “digging” a domain and after the initial time you do the request. Further ones should show a “Query Time” of 0ms.


Nov 5 2011

Scrolling Speed in Ubuntu Linux [1105]

Firstly this is going to be a real short thing – it is firework night after all and I have places to be but none the less I need to keep up with this.

 

I’m not exactly sure why this has suddenly affected me, maybe the recent change in my peripherals that I use on a daily basis however some people may have noticed that the scroll wheel within ubuntu doesn’t really scroll anywhere fast.


Now I thought ok this will be a really simple fix, going into the system settings then mouse/pointer options and changing the number of lines the scroll wheel scrolls. However unlike shiny Windows, ubuntu doesn’t have this option and therefore you are left with a rather annoying slow scroll speed. Coming from a background of knowledge in regards to ripping things apart and putting them together I tried to think of ways to be able to change the sensitivity of this input. My first thought was trying to work out how I would be able to capture cat /dev/input/event4 and then manipulate that action to change the speed of the scroll action. Discovering that this was pretty much a long drawn out task I discovered that by possibly editing your xorg.conf I possibly could assign an option and then set that variable.


So that’s what I did, I edited my xorg.conf file to include Option "VertScrollDelta" "10" in it underneath the section defined for mouse options. So willingly I saved my xorg file, restarted x and hoped it had work. Didn’t exactly go as planned, well I say this but there was really no difference. Nothing had changed at all, it was better it wasn’t worse. So I gave up for the moment. Looking across forums regarding this item it seems it has actually been an outstanding bug in GNOME for about nine years, one they are yet to fix.


As it is very frustrating to pretty much have to attack your mouse to get to the bottom of a page, I think I will keep this in my “fix, to-do” list so maybe one day I can sit down and actually get the time to look at the problem straight on and try and see if I can find a work around. Maybe one day.