ADAM'S WEB PRESENCE

3 December 2006

Souped up IR keyboard

Filed under: Homemade Creations — adam @ 9:30 pm

An IR keyboardI have been using this infra-red wireless keyboard on my media PC for about a year now. I have always been disappointed with its poor range and short battery life.

So I decided to do something about it.


Let's void the warranty!Instead of expensive AAA batteries, it would definitely last longer on AA cells. Four cells would also supply a higher voltage than three and so give greater output power. First thing to do is void the warranty and take it apart.


Don't you know you shouldn't connect the red to the black!Then I simply grabbed a 4xAA battery holder and soldered the wires in place of the existing 3xAAA battery compartment. I loaded up the batteries to see if it would work.

Ah, but it didn’t. The activity LED did not light and after a few seconds I could smell the familiar aroma of burning silicon. After very quickly removing the batteries, I had a closer look to see what was up (apart from the main chip being very hot).

Turns out I had relied on the colour-coding of the wires and connected my positive to the red wire and the negative to the black wire. After all, that is the standard right ?

If I had checked more closely, I would have noticed that whoever assembled this thing had used a red wire for negative and a black wire for positive !

After I stopped swearing, I connected my battery positive to the black wire, and negative to the red wire. My engineer mind was screaming “noooo!” but I did it anyway. After that I tested again and it worked! I was very lucky the chips had not been fried by my earlier mistake.


Gluing on the battery holderFinally since the battery holder would not fit inside, I glued it to the underside with some hot glue. After testing I was pleased to note that the range was much increased. I can use it while leaning back on my lounge and I don’t have to carefully aim it anymore. With the larger batteries on the case, it should be quite a while before I need to change them.


2 December 2006

Watch and Screen

Filed under: Nerd Notes — adam @ 11:35 am

I want to mention two very useful commandline tools in Linux and other UNIX based systems. I use these all the time but they are rarely mentioned in Linux guides and documentation. They are screen and watch.

screen allows you to:

  1. Log out and yet leave a process running.
  2. Move a terminal from one computer to another without interrupting the running processes.
  3. Manage several running processes from one terminal.

I mainly use this if I have a large download to do or a big batch processing job to run – anything which takes a few hours. I can start a big download on my home box in the morning and then log in via SSH from work during the day to see how it is going.

Most Linux distros do not install screen by default so you will need to do that (you are running Debian right ?):

# apt-get install screen

Then activate it:

$ screen

Start your big process and then press Ctrl-A D to detach the process from the terminal. To re-attach the process, type:

$ screen -r

You can start as many screens as you like and reattach each individual one by referring to its process id as in this example:

$ screen -r 6255

UPDATE

If you want to attach a screen but forgot to detach it before you left home (oops!), you can force it to detach using the -D option like this:

$ screen -D -r 2324

watch lets you run a command periodically. The most common thing I do with this is monitor disk usage while performing large file transfers (so I know when to panic if the disk is getting too full). To do this, simply type:

$ watch df -h

I usually leave that running in a separate window. A more advanced form of the same thing would be to monitor the disk free space while also listing the size of each file in the current directory:

$ watch "df -h; echo ; ls -l"

I can even do more fancy things like monitor the number of items in a database table:

$ watch psql rego -c "select count(userid) from users"

These commands make the commandline so much more useful. Its a shame more people do not know about them.


Powered by WordPress