script for logging standing desk state transitions

At work I have an adjustible-height desk, that way it can be both a standing or a sitting desk. In order to better understand my own usage habits, I made the desk script, which logs state transitions.

Read More…

Revisiting spaces in file names

I don’t like spaces in file names, as I’ve written before, and as I’ve tried in vain to fix. I’ve been working around this issue with a little hack that I call wrap: #!/bin/sh

Read More…

Analyzing Bash History and Fixing Typos

At the command line, I frequently type things too fast, and typos abound. A single character can mean the difference between showing documentation and deleting files (rm vs ri), so autocorrect is defi

Read More…

Reinventing the wheel: Or how I learned to stop coding and read the manpages

About a month ago I wrote about a command line utility I made that calculates word and character frequencies. It was packaged as a ruby gem and it interacted well with the Unix pipeline interface. The

Read More…

Fixing spaces in filenames

Sorry this has taken so long, I’ve been working on the Cryptography Coursera class, to get rid of all spaces in all files below the current directory, the following bash script will do:

for filename in $(find .); do
  newfilename=$(echo $filename | sed 's/ /_/g'); 
  mv $filename $newfilename
done
All Posts by Category or Tags.