cli apps

tar backup stupidity and limited space

So, pretend you have:

  • a new Mac laptop with a fast hard drive, but one that is smaller than all the data you need to backup
  • A backup hard drive you’ve used on Windows and Linux, but is formatted NTFS, and is much larger than your new laptop’s HD
  • You have files named on your system that needs to be backed up that aren’t kosher for NTFS

So, being a Linux geek, you realize “Ha! I’ll just tar my files up, copy it to the backup drive, over to the new system, and untar.”

Yes - you do just that, but then you need to use your laptop for work; so instead of waiting to untar the file, you copy the very large backup tar files from the external HD to your new laptop.

Now, here’s the problem: you can’t untar the entire tar flle w/o running out of space. What do you do? Un-tar a bit at a time; delete; continue.

Untar a bit of the archive you want, delete it from the tar, and continue until you have more space on your HD than the rest of the tar file.

# tar xf MYBACKUP.tar This/directory/I/want
# tar --delete --file=MYBACKUP.tar This/directory/I/want

This method works surprisingly well, considering the tar file crossed all three major operating systems.

If you are unsure of what is inside the archive, you can use:

# tar --list --file=MYBACKUP.tar

MacBook Pro
OBT
cli apps
geek-world

Comments (0)

Permalink

erlang

For some reason, the Gentoo install of erlang put the man pages into man sections that ended in “erl”. For example, instead a directory named man3 for the 3rd man page section, it’s man3erl.

I wrote a quick alias erlman that only searches these erlang man page sections.

~/.bashrc

Code (bash)
  1.  
  2. alias erlman="man -S 1erl:3erl:4erl:6erl"
  3.  

Gentoo
cli apps
erlang

Comments (0)

Permalink

Creating stream-able video

I spent much to much time trying to figure out the right combination of video/audio encodings that would would from an RTSP streaming server (went with a RealServer demo, for now) to a variety of clients (QuickTime Player, VLC, various phones, etceteras.)

First, VLC is a champ. Every time I tried a new streaming server, VLC could play the stream with video and audio. QuickTime Player was not so kind. Even the phone we were streaming to — the Nokia N95 (tech specs) — could play streams that QuickTime Player could not.

I tried a variety of tools, from the venerable ffmpeg to QuickTime Player’s export functionality to create stream-able videos (mainly for QuickTime, since it was being very picky). The tools I used were the following:

Here is a simple bash loop I made to iterate over .mov’s in the current directory and create MPEG4 video, MPEG4 audio (AAC LC), in an MPEG4 container that was hinted. You should set FRAMERATE and SIZE (as “WxH”) as environment variables. Note that the first line has -ac 1 which sets the audio to mono. Also, edit the -qscale to your liking (or remove it).

Code (bash)
  1. for i in `ls *mov –color=never`; do
  2.   ffmpeg -i $i -ac 1 -vn "$i.wav"
  3.   faac –mpeg-vers 4 –tns -o "$i.aac" "$i.wav"
  4.   ffmpeg -re -i "$i" -pass 1 -passlogfile "${i}pass" -vcodec mpeg4 -r $FRAMERATE -s $SIZE -qscale 8 -an "$i.m4v"
  5.   rm -f "$i.m4v"
  6.   ffmpeg -re -i "$i" -pass 2 -passlogfile "${i}pass" -vcodec mpeg4 -r $FRAMERATE -s $SIZE -qscale 8 -an "$i.m4v"
  7.   mp4creator -c "$i.m4v" -optimize -rate=$FRAMERATE "$i.mp4"
  8.   mp4creator -hint=1 "$i.mp4"
  9.   mp4creator -c "$i.aac" -interleave -optimize "$i.mp4"
  10.   mp4creator -hint=3 "$i.mp4"
  11.   mp4creator -list "$i.mp4"
  12. done

OBT
QuickTime
cli apps

Comments (0)

Permalink

spamassassin: make it work!

I emerged spamassassin, which installed the spamd server, and the spamc client, with which to talk to the server.

However, the logs were complaing TELL commands have not been enabled. It seems that SPAMD_OPTS in /etc/conf.d/spamd is missing the -l (–allow-tell) option.

Adding the above -l to SPAMD_OPTS allowed spamc to talk to spamd and make it start learning.

Gentoo
cli apps

Comments (0)

Permalink

mutt: sending via multiple accounts with esmtp

I found it much easier to set up multiple smtp accounts for mutt using esmtp than anything else. It’s actually completely straightforward — just make esmtp do all the work …

  • install esmtp
  • create your ~/.esmtprc file
    • man esmtprc — seriously, it’s easy
  • add the following to your ~/.muttrc
set sendmail=”/usr/bin/esmtp”
set use_envelope_from

cli apps

Comments (0)

Permalink

rxvt-unicode: options I use

These are the most common options I use as a default terminal.

option purpose
-rv Reverse video — black->white, white->black;
changes the behavior of progams that care about dark and light terminals
-fade 75 When the terminal window looses focus, this setting fades to the paramenter’s percentage of brightness
-ls Start the shell as a login shell
+sb Turn off the scrollbar
-bc Blink the cursor
-ip (or -tr) Turn off inheriting parent window’s pixmap … or “make transparent”
-tint [color] Tint the window a color — useful when you use -tr and have many, many, many terminals

e.g.

urxvtc -rv -fade 75 -ls +sb -bc -ip -tint brown

cli apps

Comments (0)

Permalink

rxtv-unicode: daemonize and use client for faster loads

“rxvt-unicode” is a really nice terminal. You can increase loading speed and memory using, if you tend to use multiple terminals, by using the urxvtd daemon and the urxvtc client.

First, you need to launch urxvtd. This is as easy as adding a line like the following to your ~/.xinitrc:

urxvtd &

Once the daemon is running in the background, you can connect to it with urxtvc. Then a terminal launches, and you are ready to it as usual.

cli apps

Comments (0)

Permalink

Topic - Command Line Apps

I’m going to try to keep things I’ve learned about different command line apps here.  I tend to move between more heavy desktop environments and lighter (and more interesting) window managers like ion3 or wmii.

This time, I’m going to actually keep notes of the different programs I use.  This will include programs like rxvt-unicode, my terminal of choice, and mutt, which is arguably the best (or simply most popular) cli mail client.

cli apps

Comments (0)

Permalink