Monday, September 08, 2008

The Chrome and the CPU

Well, yeah yeah, everybody's already said a lot of stuff about Google Chrome holding up CPU like a Goblin holding onto the last galleon in the world, but I'll write a few things anyway. I'll also keep updating which features were found to be bigger CPU hogs (courtesy Windows and Chrome Task Managers).
  1. I found Chrome taking up 98% of CPU one day. I found that it was sending out a truck-load of requests to fetch the phishing and malware blacklists. I turned off the feature and the CPU was freed!! Hurray. (You can do this by unchecking 'Enable phishing and...' in Options -> Under the Hood -> Security)
  2. For good measure, I turned off the suggestion service as well. (Right click on the omnibar, click 'Edit Search Engines...' and uncheck 'Use a suggestion service..')
  3. It was just today that I found that Chrome was taking up 80% of the CPU once again. Thanks to the Chrome Task Manager, I found that the culprit this time was the Flash Player, rendering the Dilbert of the Day Widget in iGoogle (-snigger-). Well, since I couldn't kill the Flash without rendering the widget useless, I just killed Chrome instead and opened everything in Firefox.
By the way, my default browser is Firefox 3 once again :-). Just thought I'd mention it.

Monday, August 04, 2008

A Big Dog Named Robot

Or is it a robot named BigDog? I'm confused. Heck, anyone would be.

See for yourself - here is the link to the homepage of a Boston Dynamics robotics project called BigDog funded by the Defense Advanced Research Projects Agency (DARPA). There is a Flash video on this page that shows BigDog toiling hard when mere humans try to unsettle him, make him jump and walk over boulders, etc.

From the site -"BigDog is being developed by Boston Dynamics with the goal of creating robots that have rough-terrain mobility that can take them anywhere on Earth that people and animals can go". And boy, is it ready to go all those places!

It's balance is remarkable, even in the face of obstacles and external forces. It's jumping capability (yes, it can jump on all fours) is amazing. What's more, it actually works on a gasoline engine. So, no strings attached. Even with a sure chance of sounding cliched, you have simply got to see it to believe it. Take a look.

Monday, July 21, 2008

Effortless Web Browsing Without Moving the Mouse

Well, it's not really effortless, but it does reduce the use of your mouse to quite an extent while browsing the Web. And it doesn't even take 1/10th of the time you'll take to read this. Alas, this works only in Firefox.

Everybody who loves using the keyboard knows the annoyance that they feel when browsing the Web. You just can't do a lot of things without a mouse. Of course, you can always press zillions of tabs to reach the exact link you want, but that is prohibitively boring. It turns out there's an easier way to do a lot of such things in Firefox.

All you have to do is load a page and then press Ctrl+F. This opens the Firefox Find Toolbar at the bottom of the window. Now, if you know which link you want to click, you know at least a word from the link text. Just start typing that word and Firefox will highlight that word in the page for you as you type. If you're not already at the link by the time you finish, just press F3 or Enter (for Find Next) a few times until you are. Now, when you see that word highlighted, just press Escape to make the Find Toolbar go away. Wallah!! The link is surrounded by the familiar dotted line, which shows focus on the link. Just press Enter now & there you go, you've clicked the link.

The same trick can be used to reach input fields of a form. Just type the label of the field (e.g. Username or Search) after Ctrl+F and once you're at the label, press Escape. You're at the label and the input field is just one Tab away. So also for buttons.

Same for links in images and other stuff you can't reach from the Find Toolbar. Just find something that is close enough and in a couple of Tabs, you're at the link you want.

For normal browsing, when you haven't decided where you want to go, the page can be seen by just scrolling using the arrow keys and page-up/page-down. Then, when you know which link to use, just use the trick above.

And you thought the 'find-as-you-type' Find was just a cool feature in Firefox, not of great use? ;-)

Update 21/07/2008


This trick works with text entered in a field, too. So, if you're writing a long post or e-mail, just press Ctrl+F to look up something you just wrote.


Update 04/09/2008


It would've been unfair if I hadn't commented on Google Chrome, Google's own entry into the browser brawl. Unfortunately, although Chrome has used parts of the Firefox codebase, the trick explained here doesn't work. When you quit the find box, the tab focus goes to the top, defeating the whole purpose.

Wednesday, July 16, 2008

Saving private power

Something a little detached from the normal theme, this is about saving energy.

Using nothing else, but just your CRT monitors. Here is a very interesting (although a bit long :) ) article talking about power savings and CRT monitors. This post is about is the impact of such power saving.

By the way, a CRT monitor is the big, boxy old display that used to come with older PCs. And sometimes with newer ones as well.

We, in India, (at least in our part of the country, that is) are faced with constant power shortages. In fact, barring major cities, it's been quite a few years since we had electricity 24x7. As a result, small businesses, students studying for exams and people critically dependent on electricity are at a huge loss. That's why I urge you to reconsider your electrical usage. But without being too preaching, here are some suggestions you can very easily act upon. And, as promised, just by using (or not using), your CRT monitors.

It doesn't take a lot to save electricity through correct use of monitors. Just keep in mind these simple steps to avoid wastage of electricity and their effects:
  1. Switch Off all your monitors before going home every evening without fail. You might be ensuring every night that one household receives evening light for one week.[1]
  2. Switch Off all your monitors if you are going away from your seat for more than 10 minutes. Better still, have the operating system do it for you through the power saving options. Every day, you could ensure that a medium shop stays open for an hour more.[2]
  3. Keep your brightness and contrast levels to an optimum level. The less bright your display, the less power it will use.[3] You would be helping your own eyes see better for longer.
Some important points to be noted also, are:
  • Switching the monitors Off manually is the best option. Even if the monitors have an auto-off feature, that is like switching the TV off using a remote control. They still require about 2 watt of power.[4]
  • Screensavers save screen pixels. They don't save power. The monitor is still On. They may only save some power if a screensaver has a black background, causing the monitor to use less power. But not as less as when it's switched Off.
  • LCD screens are much more power-friendly. They use up about 20-30 watt of power. But they still should be switched Off when not in use. 20 is not equal to 0.
  • LCD screens are indifferent to brightness levels. They use up almost the same amount of power at the most bright and least bright settings.[3] Even then, the less bright screen uses less power.
These steps are simple enough if we make a habit of these things. Is forming a habit of switching Off your monitor whenever you get up to leave the room that tedious? I don't think so; what do you say?


Footnotes
  1. Simple calculations again. A sensible home in areas outside Pune will use about 75-80 W for evening lights (two tubes / 4 CFLs). A 150-160 W monitor burning for 12 hours every night translates to the evening lights burning for 24 hours, which is about 7 days with 3.5 hours of evening lighting every day. That's how much the average load-shedding in the evenings is.
  2. Lunchtime, tea-times, calls and meetings and some other gaps in between mean we're don't use our monitors for about 2 hours everyday during the daytime. For a medium sized shop requiring power for lighting mainly (e.g. a barber, grocer, medical shop), the consumption may be around 300-320 W (8 tubes / 16 CFLs).
  3. Here is an excellent blog entry giving details of an informal study by a person named Kedar Soman. He gives graphs of power consumption measurements as well.
  4. In the same blog entry, Kedar mentions this 2 W usage. He mentions also an interesting observation that some models of TVs consume up to 20 W in this idle state. So be careful next time when you touch that red button on the remote. :-)

Wednesday, January 23, 2008

ADSL Connections on Linux

It seems this is a very commonly faced problem and the solution is not very clearly stated anywhere. This is an attempt to bridge the gap. It should work at least for people in India using the Dataone service from BSNL India.

The main problem people seem to be facing that even when the ADSL connection is working, gets connected, they can't browse any site, nor can they connect to any host using any other mechanism such as FTP. When they try to ping an IP address other than that of the modem, they see an error message something like:

Reply from 192.168.0.1: Destination net unreachable

Don't get me wrong here, but doing anything slightly out of the normal operation in Linux does require some patience and conscious efforts. Of course, there's the exhilarating feeling when you finally get it done, but you just can't help think that it would've been better if it just worked at the first attempt. Configuring and starting ADSL broadband connections is one of those things. Here's a procedure that would get you set up quickly and completely:

You'll need: one full installation of a standard Linux distribution, your username-password for the ADSL connection, one ADSL modem with an Ethernet interface (with a DHCP server) and, most importantly, one working ADSL connection.

Steps:
  1. Login to your Linux box as root. This is not recommended, but the only problem with using a non-root account is that you'll have to give the password a lot of times.
  2. Configure your Ethernet interface (eth0 or some such, ethX - we'll stick to the name eth0) to get the IP information using DHCP. But, uncheck the option to do this at system startup. This is probably the single most important thing to be remembered. Setting it to run DHCP at startup is the reason the problem stated above appears. More later.
  3. Do one of the two:
    1. Use the script adsl-setup to get the system to store your ADSL username/password and any other details that you may wish to provide. The one option that is important is the DNS settings - this is set to SERVER in most cases and this means that your ISP will provide the DNS server settings when you connect.
    2. Use a graphical client such as kpppoe (which is internally a popular client called RpPPPoE) to provide the ADSL username/password and other settings. This is even simpler as the user interface is one of the most minimal I've seen.
  4. Make sure that the Ethernet interface (eth0) is down.
  5. If you used 3.1 above, you can use another script adsl-start to open ADSL connection. Only in this case, you will have to change the permissions as per which users of your system you want to be able to connect using this script.
    If you used 3.2 above, all you need to do is click on the "Start" button on the kpppoe window. There is an option in the settings of kpppoe to enable other users of the system to be able to use it to open up access to the Internet.
  6. Once you're done, use adsl-stop to close the ADSL connection if you used the adsl-setup path or click the button "Stop" to close it if you used kpppoe.
Now, the reason for the warning in bold letters. As you may know, to connect to any other machine over the Ethernet, the system requires what is called a gateway, which can route our message to that machine. If the Ethernet interface does come up during system startup, or if it is up already when we try to open the ADSL connection, this means that DHCP has been performed and the interface already has an IP address as well as gateway. Now, the crux of the matter is that scripts which bring up eth0 also set the default route to this gateway.

What adsl-start or kpppoe do is they bring up the adsl and pppd services, enabling the machine to create a PPP interface on top of eth0 over which all our traffic flows. Ideally, once that is done, the default route should be set to the gateway beyond the ADSL modem - the ISP's gateway. Unfortunately, these programs invoke pppd with an option which tells it not to create the default route if one exists already.

That's where the warning comes in. If eth0 is already up, there is already a default route to the ADSL modem, hence, no default route to the ISP's gateway. Since it is the ISP's gateway - and not the ADSL modem - which knows how to reach the DNS servers, and all machines on the Internet, we can't reach all these with the default route going into the ADSL modem. And the weird "Destination net ..." message starts showing up.

The easiest way out is to follow the procedure outlined above. The difficult way out is to change all the scripts so that such a situation never occurs. But that, probably is a topic for another time. Enjoy broadband, in the meanwhile.