edeca.net logo
  • rss
  • Home
  • Graphics
  • Electronics
    • PCB0002 – LED matrix
  • Computing
    • ROT Util
    • MOTD maker
    • GNU screen config
    • VB6 reverse DNS
    • VB6 RichTextBox control
  • About

Better than grep

David | May 29, 2010

Anybody who has used command-line systems for a serious amount of time will love grep. But today I stumbled across ack, which (for many things) is better than grep and a whole lot nicer to use.

The best bit? It’s pure Perl, therefore also uses real Perl regular expressions. Yes, there might be grep --perl-regexp, but nobody bothers compiling that in. Plus ack has some other neat features.

See more at the ack website.

Comments
No Comments »
Categories
Computing
Comments rss Comments rss
Trackback Trackback

Cooking with gas, my first SMD board

David | May 10, 2010

My first bunch of boards arrived back from BatchPCB and I’m really impressed.  Great printing for the silkscreen and a really professional looking product.  One of the boards I ordered was a breakout board for the SMD PIC 18F2321, the first surface mount board I have tried.
Read the rest of this entry »

Comments
No Comments »
Categories
Electronics
Comments rss Comments rss
Trackback Trackback

I am not a photographer

David | May 7, 2010

During a recent conversation with another Dave he pointed me at the Facebook group “No, you’re not a photographer, you just own a camera” (update May 2011: this no longer exists).  Whilst I don’t agree with most of the comments on there (they are generally rude and unhelpful) it does raise an interesting point: How high the bar should be set for whether you are really a photographer or not?
Read the rest of this entry »

Comments
2 Comments »
Categories
Photography
Comments rss Comments rss
Trackback Trackback

Limiting command runtime in Linux

David | May 2, 2010

It is sometimes useful to limit the running time of a process, either to stop it from using up all resources or to make sure nightly cron jobs don’t continue into working hours.

I needed this for rsync, to let a remote backup server slowly catch up if large amounts of data were added to the live server during the day. A useful post on the rsync mailing list discusses an rsync patch but also the timeout command.

After installing (the Debian package is simply timeout) it is as easy as running with the number of seconds to run for:

$ timeout 21600 rsync -a ...

It is also possible to specify the signal which will be sent to a program, which is useful if you do not want to simply send SIGKILL. I used SIGHUP in the hope that rsync would have a chance to exit gracefully:

$ timeout -1 21600 rsync -a ...

A full list of signals and their numeric values can be found in man 1 kill.

A wrapper script is also available from Johannes Buchner.

Comments
1 Comment »
Categories
Computing
Tags
linux, rsync
Comments rss Comments rss
Trackback Trackback

Categories

  • Computing
  • Electronics
  • General
  • Perl
  • Photography
  • Uncategorized

Archives

  • February 2012
  • December 2011
  • November 2011
  • July 2011
  • June 2011
  • April 2011
  • March 2011
  • February 2011
  • December 2010
  • November 2010
  • October 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • November 2009
  • September 2009
  • August 2009
  • July 2009
  • June 2009

Links

  • My photo gallery
  • Pookey's site

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox