Archive for July, 2008

i haz iphone 3g

Friday, July 25th, 2008

Title says it all, sent from the dock with the wordpress app.

photo

Polite Spam

Tuesday, July 15th, 2008
From: "claude je" <redacted>
To: <billing@linode.com>
Subject: You are about to get fired

You are about to get fired
http://[redacted]/view.exe

It is quite polite of the sender of this piece of mail to warn the recipient that they are about to get fired for infecting office machines (supposing they click the link from a suitable browser, that is).

screen copy mode can be used to copy/paste

Thursday, July 10th, 2008

I’m aware of many people that use GNU Screen’s copy mode to scroll back through terminal history but don’t actually use copy mode for copying text for later pasting. I was one of those people myself for some time. Screen supports some pretty nifty copy/paste tricks but a few basic key strokes will get you started.

Entering Copy Mode and Scrolling

By default, enter copy mode with CTRL+a then ESCAPE. You can use vi like commands to navigate through the scollback buffer. The arrows and PAGE UP/DOWN should work as well. A few useful commands some may be unfamiliar with:

  • M - jumps to the middle visible line
  • NN% - jumps to the specified percentage in the buffer (0 - start, 100 - end
  • g - jumps to the beginning of the buffer
  • G - jumps to the end of the buffer

These keys are even useful when you aren’t using copy mode to copy/paste text.

Copying Text

Once the cursor is at the beginning location, press SPACEBAR to set your first mark. Next navigate to the ending position and hit it again. The second SPACEBAR will set your end mark and exit copy mode. One neat and often useful feature is selecting a rectangle on the screen rather than full lines. Use c and C to set the left and right column margins to the cursor’s current location.

Pasting

Pasting is easy, just hit CTRL+a to activate screen then ] to paste.

There’s More!

There are loads more options such as multiple copy buffers, the ability to append marked text to the buffer rather than replacing it, etc. Check out the man page for more screen goodness.

dh-make-perl will rock your socks

Wednesday, July 2nd, 2008

dh-make-perl is the most awesome Debian package /ever/.

dh-make-perl --cpan Some::Module --build
sudo dpkg -i libsome-module-0.1-1_all.deb

Done.

Dependencies

If you have apt-file installed and Some::Module requires Lib::Foo for which a Debian package is available, the dependancy will automatically be created. If Lib::Foo does not have a Debian package already available, you will likely need to manually run dh-make-perl on Lib::Foo first.

I haven’t seen the apt-file trick mentioned elsewhere. Honestly when someone mentioned it on IRC I didn’t believe him. Sure enough, looking at the source for dh-make-perl revealed that it does indeed check apt-file for each module that Some::Module lists as required in the META.yml.

Why?

Now dpkg/apt know that you have Some::Module installed. If an official package for Some::Module comes out, it will likely have the same name and if it is for a newer version of Some::Module aptitude upgrade will automagically upgrade you to it. The real win is ease of cleanly uninstalling though. How many times have you found what you thought was the perfect module for task XYZ and installed it. Only to find that it isn’t so hot 5 minutes after beginning to use it. Making sure ‘make uninstall‘ really uninstalled every thing can be a pain.