Saturday 25 February 2006

Postscript Layout

Normally I pipe my postscript printouts through xpp. Sadly xpp’s multiple copies doesn’t seem to work for my printouts, and it also lacks the ability to scale and rotate the image to get multiple smaller copies per page.

I wrote a quick bash script I put together so I can scale A4 postscript printouts to fit multiple images per page, so to print 4 per page, with 2 pages I now pipe through:

| psmul 4 2 | xpp

Here it is:

#! /bin/sh

while test "$C" -lt "$MUL"


while test "$C" -lt "$PAGES"

pstops $SPEC | psnup -$MUL

Thursday 23 February 2006

Hard to buy from DELL

I have a friend who wants to buy a laptop. At work I use a nice Dell M70 with a good Nvidia 3D graphics card. Very nice to play Battlefield2.

It’s very hard to find a Dell laptop with a 3D graphics card, or a way to select Dell laptops with this option.

I thought I’d point out this deficiency to Dell and ask for their help.

The Dell contact web page has a link to Customer Care general Order enquiries but I have to create an account before I can ask a question or point out their problem that makes it too hard to buy from them. It’s too complicated. I don’t even know if I want to buy a Dell laptop, I’m looking for someone else.

So I just closed my jolly browser and got down to watching Pride and Prejudice with my wife.

Wednesday 1 February 2006

Amarok Spasms

Amarok happens to be the best media player out there. Apart from windows media player which I think is pretty hard to beat, but Amarok has all the essential features.

Sadly, recent Ubuntu KDE updates have had Amarok unable to run more than a few seconds, so after depriving my family of music for a few days I came home to find my daughter trying to stuff what turned out to be compact discs into the CD player. She was doing it right, it just un-nerved me.

Time to get out the Breezy backports from Dapper Drake and see if a new Amarok fixes things for me.

I used source-o-matic to cough up the latest official backports repository to add to my /etc/apt/sources.list

This gives me Amarok 1.3.7 which thankfully does manage to stay up for more than a few seconds.

Faking bash history

In the bad old days, hackers get a root shell and disable bash_history so the true owner of the system wouldn’t know what they’d been up to.

These days they get a reverse shell via icmp or some such and don’t even generate a bash history so it doesn’t really matter that bash with readline enables the selective prevention of command logging in bash_history.

Try this;
  1. get a bash shell
  2. type a command; maybe: zookie
  3. close the bash shell
  4. get a bash shell
  5. press the up arrow, there is your command, nicely in bash history.
  6. close the bash shell

Now try this:
  1. get a bash shell
  2. type a command, maybe: secret-command
  3. press the up-arrow
  4. ^U (or lots of backspace) to delete the command
  5. type a new command but don’t press enter, maybe: mundane-command
  6. press down-arrow
  7. press enter

Now if you press up-arrow you will see mundane-command instead of secret-command, if you quit the shell and get a new shell, your command history shows the mundane-command which you did NOT execute instead of the secret-command that you DID execute.