Fun with SAY

Sometimes it's the simple things that amaze people and leave them thinking you are some type of computer genius. My daughters have grown up with computers, and I mean hardcore. Their first computer was a SUSE Linux machine; they've worked on Windows and OS X boxes and they know their way around them all. At 10 years old, they've taken over the IT tech support duties for my wife. Next, I am going to install a phone line in their room so other family members can call them when they need help. What I am trying to say is, their Dad's vast knowledge of computers doesn't impress them. Whenever I think I'm showing them something new and cool on the computer, they have an attitude of "huh, I just didn't know how to do it, now I do and its not that cool".

I myself get kind of like that too, I am pretty hardcore geek and bells and whistles on computers don't really impress me. I typically look at things on a much deeper level. That's why when I read an article sometime back called "Having fun with the SAY command in your Terminal" I thought to myself, "Cute" and filed it away in the back of my mind thinking I will never have a use for that command.

The SAY command on OS X is a Speech Synthesis Manager. If you own an OS X machine, open a terminal window and type "man say" (minus the quotes) for more information, or just type "say Hello. do you want to play a game" and start having fun with it.

One day, one of my daughters and I were having somewhat of a disagreement on if it was more important for her to clean her room or finish watching TV; guess which side I was on. As privileges started to get stripped away, right after "no more pool time" but before "no more Playstation3 time", she stomps off into her room. Knowing she wasn't in her room doing what was asked of her, and knowing I was probably too mad myself to try to talk to her, I sat at my laptop tapping the space bar. Then it dawned on me; I fired up a terminal session on my Ubuntu laptop and made a ssh connection to my daughter's computer in her room and proceeded to test out that SAY command. It went something like this;

say Why are you so mad

I hear a deep synthetic voice mumble come from behind my daughters' door followed by a somewhat confused sounding voice of a little girl.

say Didnt your dad ask you to clean your room? I like a clean room

Some more little girl mumbles. Is she arguing with the computer now?

say Your dad is probably the smartest man I know, and may be the smartest man on earth, you should listen to him

OK, that last one might have been too much and may have tipped her off. I hear her door open and she yells, "I don't know how you are doing that but you better show me"

Anyways, SSH with SAY and you can have all sorts of fun with co-workers, family, and friends. Further more they will think you are truly 1337.

Backup files with tar

I don't remember where I got this article from but it is full of some good information

TAR is the Unix Tape ARchive utility. It can be used to either store data on a streaming tape device like a DAT drive, or store files in what is commonly called a tarball file- somewhat like a pkzip file, only compression is optional.

[The basics]

In these examples, I will use the following file structure: a top level directory called DIR1 containing the files picture.jpg, document.doc and database.db.


[Creating a tarball]

If we were in the directory DIR1 and wanted to backup all the files to a tarball called backup.tar, we could issue this command:

$ tar cvf backup.tar .
tar: backup.tar is the archive; not dumped

c=create (an archive)
v=verbose (just because)
f=filename (the name of our tarball)
.=current directory (what's going to be backed up)

Also worth mentioning is that by default tar is recursive- meaning it will back up all files and subdirectories recursively unless you otherwise specify with the n flag (non-recursive)

[Displaying the Contents of a Tarball]

The current directory will now contain a file called backup.tar. To display the contents of the tarball file, we could issue this command:

$ tar tvf backup.tar
drwxr-xr-x root/gci 0 Jun 29 10:10 ./
-rw-r--r-- root/gci 1 Jun 29 10:10 picture.jpg
-rw-r--r-- root/gci 1 Jun 29 10:10 document.doc
-rw-r--r-- root/gci 1 Jun 29 10:10 databse.db
Continue reading Backup files with tar