I document my adventures and problems so that I remember my mistakes, and perhaps you may learn something.
I'm not a programmer, nor a computer expert.
I'm just a tinkering guy in Milwaukee with a store and three kids to keep me busy.
Monday, February 8, 2010
Using a US DOD CAC Card with Ubuntu 9.10
Adding a CAC Card reader and using a CAC card with Ubuntu used to be bloody hard. Getting the hardware recognized, getting the add-ons to Firefox and Evolution, installing the certificates, what a pain!
Well, I tried agin, using the Ubuntu help center instructions at https://help.ubuntu.com/community/CommonAccessCard
Result: I can log into AKO using my CAC Card! After four years of hoping. Hooray!
Friday, November 27, 2009
Quick and Easy CD-ripping
Ripping a CD to add to my music collection using the command-line application abcde.
To install abcde, use sudo apt-get abcde
To rip a CD, insert the CD and use the terminal. This will rip the CD to FLAC (lossless) format, and eject the CD when complete:
cd Music abcde -x -o flac
Sunday, November 15, 2009
Linux converter for Microsoft .lit files
To install epub-utils and fbreader, use sudo apt-get epub-utils fbreader
To convert a book file, use lit2epub /path/to/book.lit
To read a converted book, open fbreader and point it to /path/to/book.epub
Monday, July 13, 2009
Video, photos, and music sharing with my phone
I have a snazzy new geek-phone, a Shuttle from Virgin Mobile. It has a 4GB MicroSD slot so files can be exchanged with my Xubuntu system.
- Phone Video is in .3G2 format. The video plays in Totem, but the sound doesn't. YouTube properly uploads and converts the .3G2 videos (no need to share by e-mail). I plan to archive the .3G2 videos in their original format. This command successfully converts the .3G2 to a .avi for viewing by totem:
$ mencoder media/disk/my_flix/inputfile.3g2 -ovc lavc -lavcopts vcodec=msmpeg4v2 -oac mp3lame -lameopts vbr=3 -o Videos/outputfile.avi
- Computer Video Haven't figured out the right command to convert movies to .3G2 yet.
- Phone Pictures are in .jpg format. Xubuntu's standard Image Viewer is very effective for weeding through them.
- Computer Pictures Large pictures take a long time to show up - a 2.4 MB image froze the phone for 30 seconds. The following script uses Imagemagick to resize the photos to a smaller size:
$ convert Pictures/filename -size 320x240 /media/disk/my_pix/filename.jpg
- Computer Music My FLAC music needs to be converted to .mp3 to play on the phone. Soundconverter does it, but some results refuse to play...haven't figured out the pattern yet.
Important information- UUID=5D18-F276 # The 4GB MicroSD Card's UUID. Find using syslog after plugging it in /media/disk # Default mount point /dev/sdb1 # Device location /dev/sdb1 /media/disk vfat rw,nosuid,nodev,uhelper=hal,utf8,shortname=winnt,uid=1000 0 0 # /etc/mtab entry for the disk /media/disk/my_flix /media/disk/my_music /media/disk/my_pix # Available folders Camera Resolutions: 1280x960 1024x768 640x480 320x240 176x144 160x120 Video Camera Resolution: 176x144 Screen Resolution: 220x176, 262k colors
Thursday, July 9, 2009
Installing Xubuntu 9.04 on an emachines E625-5192
What went well: I created a set of Restore DVDs (in case I want Windows back), then removed windows and installed Xubuntu 9.04 full-disk. Copied over my old /home directory, and installed all my favorite apps. E-mail, web, games, .bashrc, most dektop settings, etc. transferred without a hiccup. Recreated my crontab. Wireless networking and video work great. Built-in card reader reads all cards from my cameras and phone. Machine is noticeably faster. FN-key brightness control works. FN-key multimedia controls work.
Solved Problems:
/etc/modprobe.d/alsa-base.conf
somwhat improved speakers and fixed the headphone jack.# Added by me on <date> while troubleshooting audio options snd-hda-intel model=6stack
Unsolved Problems: No built-in webcam. Keyboard is different, and will take time to get used to - many typos in the meantime.
Monday, July 6, 2009
Creating Custom color palletes using The GIMP
My spouse wants to create art using carefully-arranged Rubik's Cubes. She needs a tool to do it: She needs to manipluate images to the right color and pixellation to look cube-ready (Solving them to the displayed configuration is another issue).
So let's set up The GIMP to do it.
Preparation: GIMP needs to know what colors to use, so let's create a custom color pallette. (This only needs to be done the first time)
- Find an image or two with cube colors (Google is handy for this). Copy the images to your clipboard.
- Import the image to GIMP:
File -> Create -> From Clipboard - Create the new color palette:
Image -> Mode -> Indexed -> Use Custom Palette -> Open The Palette Selection Dialog -> New Palette - Select the six colors: Use the color-picker tool to change the foreground color, then right-click in the palette-editor to add each color.
- Save the new palette with a name you will remember, like 'Cube Colors'
Changing an image
- Import the image into GIMP
- Reduce the image to the six cube colors -
Image -> Mode -> Indexed -> Use Custom Palette -> Cube Colors - Reduce the image to manageable size with
Image -> Scale ImagePick a small size that is a multiple of 3 (3 rows/colums on each cube) - NEED a way to split the image into 3x3 (blown up to 9x9) squares for each cube.
Scripting for batch-resizing: This looks possible using Imagemagick - see "using pre-defined color maps" for an easy way to get Imagemagick to reduce the colors.
Saturday, July 4, 2009
Batch converting photos using Imagemagick
Our store has a 7-inch photo frame, with a 2GB stick in it. So we can just drag-and-drop lots of photos onto the stick.
But how can we use Imagemagick, the command-line photo editor, to batch-resize a whole bunch of images...perhaps as part of a script?
Here's one way to resize a single photo:
$ mogrify -sample 480 foldername/filename.jpg
Here's one way to resize a whole directory of files from 4000 x 3000 to 400 x 300.
$ mogrify -sample 400 foldername/*.jpg
This resizes the original(s). Making copies (before the resize) is a separate command:
$ mkdir copies $ cp original/image.jpg copies/ $ mogrify -sample 400 copies/image.jpg $ mv copies/image.jpg stick/