linux/tips

How to find the current glibc version

A recent
post
reminded me of a problem I once had; determine the glibc
version and its support for various things.

There's actually a little known but useful confstr call
defined for just this sort of thing. Here's a minimal example:

Netgear WG311 shielding

I recently picked up the Netgear WG311
V3
very cheap from Office Depot.

The card seems to work fine with ndiswrapper; there are other
guides
on getting it working.

The first problem was the reception was, in a word, rubbish. After
putting the box back in it's usual home the house wireless was lucky
to get a 7/100 signal rating. I found a work-around while the cheap
external antenna I ordered is arriving; shield the antenna with foil.
This increased signal to between 30-40/100, a considerable boost
making it actually useful.

Sending arbitrary keys through xtightvnc

Although it's not particularly clear, a neat feature of xtightvnc
is the ability to modify the pop-up menu that appears when you press
F8 to send arbitrary keystrokes.

The trick is overriding some of the X11 resources of the file. If
you have a look in /etc/X11/app-defaults/Vncviewer (make sure
you have a recent
package
) you can see the default keybindings for the popup menu,
which are a good template. Assuming you want to keep them all, you
can add your own buttons by starting at button 9 and re-defining the
total button count in your ~/.Xresources:

Forwarding VNC via ssh, or finding the PID of a running ssh

I found a few people asking how to automate scripts using ssh with
the -f option but not many solutions. Th -f option
makes the ssh process fork into the background once started,
but since it doesn't give you it's PID it becomes hard to kill it once
the script ends.

The solution is to setup a control channel with -M. This
allows you to communicate to the ssh process and close it down when
your process finishes. For example, here is how I open a VNC
connection to my desktop at work, which involves going through a
corporate ssh firewall box.

A cool laptop

Or, a modern guide to CPU frequency scaling with Linux. Having
setup my laptop long ago, I had a strange hybrid of daemons running
all trying to scale the frequency of my laptop periodically based on a
myriad of different situations. Having decided to fix this, it
appears the simplest approach is, as usual, the best.