You are currently browsing the LlamaLabs weblog archives for April, 2007.

IO.putc and $stdout.sync

It’s often useful to provide some sort of output when a script is waiting for something or running a loop that take a while to complete.  Instead of writing a bunch of output and running the risk of scrolling useful information off the page, I like writing out a single ‘.’ every once in a while, just [...]

<<'EOF'

Lately I’ve been entranced by Amazon’s EC2 and S3 systems, but it has brought up some good ideas to share here. This one came in handy when writing a shell script to automate installation of Debian in a loopback file mount, and I needed the script to write another script itself. I’ll get around to [...]

SVN Commit Log Message Correction

Have you ever done a commit and then realized that the message you put wasn’t quite right? It is possible to change those messages using the Subversion admin tools. From the Subversion book: Commit Log Message Correction Example: [admin@svn]$ echo “Here is the new, correct log message” > newlog.txt [admin@svn]$ svnadmin setlog myrepos newlog.txt -r [...]

How to flush your DNS cache on OS X

It’s not often that I need to do this, but I always end up looking it up. From the command line: sudo lookupd -flushcache And just for fun, you can examine your resolver configuration using: lookupd -configuration

Erase the contents of a file.

I had been using cat /dev/null > /path/to/file for a long time. Whlie reading through a friend’s shell script for creating Amazon EC2 images I found out another way of erasing the contents of a file. > /path/to/file That results in the open system call being called with the O_TRUNC flag. open(“/path/to/file”, O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666)

dpkg -S

Debian and Ubuntu tip #1 You can use dpkg to figure out what package installed a file on your system. For instance, I don’t particularly like emacs so was suprised to find /etc/emacs is installed with a default Debian Etch install. debian:~# dpkg -S /etc/emacs dictionaries-common: /etc/emacs To see more information about that package (to [...]

Which package does a file belong to? (RPM Style)

If you want to figure out which package a file belongs to you can use rpm to find out (On a system that uses rpm). Which package does /bin/bash belong to? [root@host ~]# rpm -qf /bin/bash bash-3.0-19.3 So /bin/bash belongs to bash-3.0-19.3 The -q option lets rpm know that you want to do a query [...]

  • April 2007
    M T W T F S S
    « Mar   May »
     1
    2345678
    9101112131415
    16171819202122
    23242526272829
    30  
  • Author

    A little something about you, the author. Nothing lengthy, just an overview.