Sam's Homepage

This is Sam's (a.k.a. Peabody's) homepage. Send me mail at peabodyenator AT gmail.com. I'm interested in meeting new people, especially those who come by here. I'm surprised anyone would bother. I'll especially love you if you find a grammar or spelling misake mistake (and tell me about it).

Table of Contents

  1. Unix Notes
    1. Subversion
    2. ssh,scp,ssh-keygen
    3. rsync
    4. wget
    5. Linux LVM
    6. dpkg
    7. Emacs
  2. Games

What's Here?

Stuff. I mostly only place pictures, musings, and pointless programs I write. I tire of maintaining links since I write all my html in Emacs. Sorry about the long page.

What's New?

I got straight A's again at UC Davis (spring quarter 2008)!

Old Stuff

I finally found a really good article on configuring Emacs PSGML mode with document type definitions. PSGML mode is what I use to edit this homepage.

Other Pages

I gruadually add other things when I feel like it. I have regular expressions page an editor wars page and a netpbm page.

Sam's Long Random List of Unix Notes

I've used Unicies of various kinds and my trouble is my memory's spotty. So when I come across something in the Unix world I like, I try and jot it down here. I also jot down other notes and craziness regarding things less Unix centric, such as Python notes or Firefox notes.

Organization's not my strong point. Good luck readin' this. I hope you find it useful.

Shell Magic

Rename the extension on a group of files -- ls *.ext | while read item; do mv "$item" `echo '$item' | sed 's/\.ext/.newext/'`; done

Downcase all the filenames in a folder -- ls * | while read item; do mv $item `echo "$item" | sed 's/.*/\L&\E/'`; done

Subversion

I've been trying to move anything I type to version control. It hasn't happened yet though (I'm lazy).

ssh,scp,ssh-keygen

Rsync

Find

Find is quite possibly the most important utility in any Unix admin's toolbox. I've listed some examples below. Read the man page for more information.

Notice I've appended | tee ~/find.log to the end of each command below. It isn't necessary, but I really prefer to do this so that my search results get saved to a file I can work with later.

In fact, a fun way to work with find is to create a shell function so that this always happens:

function find {
  /usr/bin/find "$@" | /usr/bin/tee ~/find.log
}

One last point...because of fuse, my home folder has recently become home to network and encrypted filesystems. Making -xdev the first option of the search expression avoids searching these filesystems.

Wget

Linux LVM

In a rescue system, to access lvm drives try vgscan, vgchange -ay, vgmknodes. mount drives before the chroot and then chroot target. You may have to also mount -t proc proc /proc to make some utils happy.

dpkg

I used to run Fedora, but I've switched to Ubuntu. Now everything uses dpkg so this is here to remind me how to investigate packages.

Vim

This section coming soon. I've been playing around with Vim lately. I'll be adding a section here shortly.

Emacs

I use GNU emacs where I can get away with it. It's hard sometimes, it often won't come on small bootable Linux systems of which I find myself in from time to time, in which case it's often Nano or vi (yes, I have to use sometimes). My problem is I often forget the emacs-lisp incantations I like to keep in my .emacs file, so here's my safe, simple, emacs file in case I need it, as well as my Elisp libraries I use, and here's a list of common emacs lisp settings I can't live without and can't often remember. I usually to spend time tweaking GNU emacs when I load it up for the first time on a system. I've set this place up as my cheat sheet.

I can't emphasis enough how useful the Emacs Wiki is. It's invaluable.


Games

That Block Game

A simple Tetris clone I wrote in Pygame. For free as in beer and in freedom under the GPL v2.

Hangman

What computer isn't complete without a game of hangman? Written in C++, uses getopt.h, so it might not compile on windows.

hangman.cpp

My speed tests for my comcast connection. Not bad if I do say so myself.

Valid CSS! Valid HTML 4.01 Transitional