Posted in Mac OS X, Unix on December 4th, 2006 5 Comments »
i can now rm with impunity, thanks to the code snippet i’ve inserted into my ~/.profile: alias rm=’safe_rm.sh’ where ‘safe_rm’ refers to this wonderful piece of code i found on the interwebs some months ago [download safe_rm if too lazy to copy+paste; don't forget to rename safe_rm.sh]: #!/bin/sh for file in $*; do if [ […]
Posted in Unix on October 3rd, 2006 No Comments »
where does the list of servers apt-get queries live? here: /etc/apt/sources.list
Posted in Mac OS X, Unix on October 3rd, 2006 4 Comments »
sure sftp is more secure than ftp, but the default client has got some terrible usability problems. for instance, it always really bugged me that i couldn’t tab-auto-complete in sftp. it’s crazy! how else do you enter long filenames?! thankfully, i’ve finally found a command-line sftp client that does handle auto-completion: yafc (yet another ftp […]
Posted in Unix on September 21st, 2006 2 Comments »
to open a zip file in debian, install “unzip” $ sudo apt-get install unzip you can then call unzip to uncompress your zip file.
Posted in Unix on September 21st, 2006 2 Comments »
to decompress a .tar.gz file, try: $tar -zxvf myfile.tar.gz
Posted in Mac OS X, Unix on May 19th, 2006 3 Comments »
to send mail from the command-line, use the mailx utility. this works on both mac os x and linux. it’s also super-convenient for cron jobs where you want to auto-send emails; you can’t stick pine into a script. echo “message body” | mailx -s “subject header” recipient@isp.com nb: your message may bounce back, complaining “sender […]
Posted in Unix on March 18th, 2006 No Comments »
for a while now, i’ve been looking for a unix command-line tool for viewing a machine’s hardware configuration, kind of like “about this mac” in os x or, well, “hardware configuration” in windows. this program does the job reasonably well: lshw. install via: $ sudo apt-get install lshw
Posted in Mac OS X, Unix on March 18th, 2006 3 Comments »
to decompress a .tar.bz2 file, go with: > tar xvjf filename.tar.bz2
Posted in Hardware, Unix on March 11th, 2006 1 Comment »
i decided a couple of months ago to hookup to my linux box a brother laser printer i picked up on craigslist. the idea would be to make this a network printer, accessible from anywhere on my lan. getting this thing installed (an HL-1240) though, was a nightmare. here’s how i finally got it working: […]
Posted in Mac OS X, Unix on March 6th, 2006 No Comments »
if you’ve got access to a file server, rsync can be a godsend. for instance, i use the following one-liner to synchronize my itunes music folder with my music server: rsync -av –progress –size-only –delete –rsh=/usr/bin/ssh ~/Music/iTunes/iTunes\ Music/ user_name@server_address:~/Music/ this command copies all of the music in my laptop’s itunes directory to the ~/Music directory […]