This script adds an "autocorrect" definition inside of a text file. The def will look like:
COMPLETE: 1 CASE: 0 BAD: misspelling GOOD: fixed_spelling
|
This helps prevent typos in Gaim. If you want to access the script from directly within gaim, you can use the gaim-slashexec plugin (this is the src tarball; the guifications site is down) and just use the /exec command from inside gaim.
BASH:
-
#!/bin/bash
-
# will add a def to dict file (for gaim autocorrect)
-
PROGN=gaim_add2dict
-
# script takes 2 args, BAD word followed by GOOD word
-
# where is your dict?
-
GAIM_DICT_FILE=/path/to/my/dict/file
-
-
if [ $# -ne 2 ]; then
-
echo "error: $PROGN: I need 2 args, please..."
-
exit 1
-
else #exactly 2 args
-
BADWORD=$1
-
GOODWORD=$2
-
BAD_EXISTS_TEST=`grep -cx "BAD $BADWORD" $GAIM_DICT_FILE` # 1 if line exists
-
if [ $BAD_EXISTS_TEST -ne 0 ]; then
-
echo "error: $PROGN: BAD $BADWORD already exists in $GAIM_DICT_FILE"
-
exit 1
-
fi
-
echo -e "\nCOMPLETE 1\nCASE 0\nBAD $BADWORD\nGOOD $GOODWORD\n" | cat ->> $GAIM_DICT_FILE && echo 'the definition has been added (does this message make it thru?'
-
fi
-
exit 0
January 5th, 2007
I joined last.fm about a week ago; I'm desimo.
January 2nd, 2007
Before I forget, allow me to download the contents of my brain pertaining to sharing one's iPod via the www.
Here is an outline of the steps necessary.
1. Transfer iPod contents to computer
2. Rename files / clean up ID3 tags
3. Make artist directories
4. Set up Apache webserver
5. Install Apache module mod-musicindex
6. Install Icecast streaming server
Transfer iPod contents to computer. I did it like this:
BASH:
-
# go to directory on iPod where music is stored
-
cd /media/ipod/iPod_Control/Music
-
# cp the contents of folders inside music directory to webroot/mp3
-
cp {F0,F1,F2,F3,F4}{0,1,2,3,4,5,6,7,8,9}/* /var/www/mp3
Rename files / clean up ID3 tags. I did it like this:
BASH:
-
# debian's package management system; use your equivalent
-
sudo apt-get install mp3info mp3rename
-
# check your tags out
-
# set a var for mp3info cmd to print a tab separated list of title, artist,
-
# album and newline
-
mp3infocmd=`mp3info -print '%t\t%a\t%l\t\n'`
-
-
#**** Refer to this list and edit your ID3 tags - see man mp3info for details ****#
-
-
# find all mp3s (ignoring single quotes, newlines, etc.)
-
find /var/www/mp3 -name '*.mp3' -print0 | xargs -0 $mp3info
-
# rename according to your perfect tags
-
# set default filename scheme
-
mp3rename -s '%a&l&t'
-
# rename!
-
mp3rename /var/www/mp3
Make directories for artists for easier browsing.
BASH:
-
#!/bin/bash
-
-
########################################
-
# mp3_sort.sh
-
# note: anyone is free to use this script as I am about to post it online
-
# it has no error checking, and will almost definitely break, so it is
-
# distributed with no implied merchantability or fitness for a specific
-
# purpose
-
########################################
-
srcDir=/var/www/mp3
-
destDir=/var/www/mp3/sorted
-
-
cd ${srcDir}
-
# disregard case
-
find ${srcDir} -type f -iname \*.mp3 | while read f; do
-
-
# get artist
-
ARTIST=`mp3info -p '%a' "${f}"`
-
-
# make sure artist tag defined
-
if [ "noart$ARTIST" = "noart" ]; then # ARTIST undefined
-
echo "some artist tag missing";
-
else
-
# destination exists?
-
if [ ! -d "${destDir}/${ARTIST}" ]; then
-
# no? then make it
-
mkdir "${destDir}/${ARTIST}" \
-
|| echo "cannot make dir \"${destDir}/${ARTIST}\"."\
-
>/dev/stderr
-
fi
-
# mv file to newly made directory
-
mv -f "${f}" "${destDir}/${ARTIST}"
-
case "$?" in
-
# 0) echo "\"${f}"\" -> \"${destDir}/${ARTIST}\";;
-
0) echo "a file was moved";;
-
*) echo "could not move \"${f}\".">/dev/stderr;;
-
esac
-
fi
-
done
-
exit 0
Set up Apache webserver.
See apache.org for details.
Install Apache module mod-musicindex
BASH:
-
sudo apt-get install libapache2-mod-musicindex
-
# the REAMDE file has all the instructions on setting the Aliases to whatever
-
# directory your music files are in
Install IceCast2
BASH:
-
sudo apt-get install icecast2
-
# listens on port 8000 by default; allow tcp through in your router or firewall
November 28th, 2006
I decided I wanted to to listen to my ipod at work. But I can't be bothered to carry around the device. I needed to stream my music over a network.
Basically, I use IceCast and a module for apache libapache2-mod-musicindex.
When I get a chance, I'll post some of the scripts I used to go from iPod to youPod...
My IP at home is dynamic, and I only update it twice per hour, so don't be surprised if the server's down for periods of about 30 min.
Here is what I have up:
sextrivium.net/anybody/listings.csv
sextrivium.net/anybody.listings.csv.odt (easier to read version)
Here is where you go:
sextrivium.net/mp3
November 27th, 2006
I've decided I want to back up my DVD collection. But I don't want all this extraneous shit on my discs: previews, deleted scenes, actor commentary, subtitles (excepting foreign flicks), captioning, menus. Also, I think I'd like to remove any region-codes, dma encryption, and of course they need to fit on a standard, single-layer DVD you might buy at Wal-Mart for $1.
A few notes in case I need to refer or rerefer or rererefer to them:
Strangely enough, the ripping is easier in Windows. I had originally tried to install handbrake-0.7.1, but it involved too many steps and wasn't working for me. I knew that there was a robust Windows program called DVDdecrypter that had the DeCSS embedded and a whole host of options for using it.
I read about a program called DVDShrink, which would cut the size of your file down to the size of a single-layer disc. Much of my information came from Doom9.net, which truly is the definitive DVD Ripping / Burning resource (at least, for Windows users).
So I fired up WINE (v. 0.9.9), installed DVDdecrypter and DVDShrink. No native Windows DLLs were necessary for either program.
Getting DVDdecrypter (under WINE compatibility layer) to recognize your DVD burner
A guide I discovered.
1. Use winecfg to set dvddecrypter.exe as running under WindowsNT4.0.
2. Make a symbolic link from your cdrom mountpoint(mine is /media/cdrom0) to /home/username/.wine/dosdevices/d:
BASH:
-
#while inside ~/.wine directory
-
ln -s /media/cdrom0 -s d:
3. Create a symlink from your burner(mine is /dev/hda) to /home/username/.wine/dosdevices/d::
BASH:
-
#while inside ~/.wine directory
-
#note the double-colon
-
ln -s /dev/hda -s d::
4. Inside DVDdecrypter settings, search for drives automatically (you might also try restarting the program).
DVDShrink is basically self-explanatory. There is a tutorial (where else?) at Doom9.net. The program works nicely with DVDdecrypter or Nero, as there is an option to send the DVD files (basically the VIDEO_TS directory) to either program for direct burning. In its simplest form, it is no more than a three step process:
1. Decrypt.
2. Shrink (including removing extraneous data).
3. Burn.
>One more note: If you are using WINE, it is safe to ignore the error messages about DVDdecrypter being unable to lock the DVD drive for unique access. This would appear to be a bug in WINE.
October 17th, 2006
PERSONAL
What is your name? No Comment.
How old are you? No Comment.
What is your birthday? No Comment.
What is your mother's maiden name? No Comment.
What is your dogs name? No Comment.
What street were you born on? No Comment.
Name any pet you ever had? No Comment.
FUNNY STUFF
What is your bank account number? No Comment.
What does your social security number spell on a touchtone phone? No Comment.
How about your pin? No Comment.
LOVE LIFE
What is your wife..s maiden name (if you're married)? No Comment.
Do you own a paper shredder? No Comment.
How many times have you moved in the last five years? No Comment.
What is your credit score, in semaphore? Haha.
RIGHT NOW
Where are you sitting? No Comment.
In what room? No Comment.
Are you by a window? No Comment.
Are you alone? No Comment.
Is the door locked? No Comment.
Can I come over? No Comment.
EITHER / OR
Apartment / House? No Comment.
Cable / DirectTV? No Comment.
Cable / DSL? No Comment.
Turkey / Tofurkey? No Comment.
SUV / Bug? No Comment.
Mac / PC? PC (Debian Linux)
Internet Explorer / Firefox? No Comment.
Morning person / Night owl? No Comment.
Cat / Dog? No Comment.
Information in one place is information in many places...
October 17th, 2006
I'm starting a list of bookmarks on del.icio.us. You, my friends, are all welcome to see where I've been browsing lately.
A full review of del.icio.us will follow.
Current score: Unreviewed
March 25th, 2006