Friday, October 30, 2009

Append authorized_keys the lazy way

*update.  No-no, THIS is the lazy way:  man ssh-copy-id

ssh root@server "cat >>~/.ssh/authorized_keys" <~/.ssh/id_rsa.pub

Sunday, September 13, 2009

normalize all your movie audio on-the-fly with ALSA

I have a pretty large collection of ripped dvd movies.  Invariably, they all have different volumes, which can be very annoying.  I was just about to use mencoder to re-encode all the audio with normalized audio... and then I thought there must be a better way.  Sure enough, there is: http://alsa.opensrc.org/index.php/FAQ#Is_there_an_alsa_plugin_I_can_use_to_compress_or_normalize_my_audio_output_volume.3F

So I copied the section below into /etc/asound.conf:

pcm.ladcomp {
      type plug
      slave.pcm "ladcomp_compressor";
  }
 pcm.ladcomp_compressor {
      type ladspa
      slave.pcm "ladcomp_limiter";
      path "/usr/lib/ladspa";
      plugins [
          {
              label dysonCompress
              input {
                  #peak limit, release time, fast ratio, ratio
                  controls [0 1 0.5 0.99]
              }
          }
      ]
  }
 pcm.ladcomp_limiter {
      type ladspa
      slave.pcm "plughw:0,0";
      path "/usr/lib/ladspa";
      plugins [
          {
              label fastLookaheadLimiter
              input {
               #InputGain(Db) -20 -> +20 ; Limit (db) -20 -> 0 ; Release time (s) 0.01 -> 2
               controls [ 20 0 0.8  ]
              }
          }
     ]
  }
These plugins need to be installed though: apt-get install swh-plugins 
Now the tricky part, getting your programs to actually use this stuff. You have to tell your program to use the ladcomp alsa device. Mplayer and Xine are pretty easy, you can just type it in a box in the gui. However, Gnome's Movie Player (Totem) is a bit trickier. Google to the rescue: http://www.mail-archive.com/gnome-list@gnome.org/msg02589.html

Basically open Configuration Editor and change
system -> gstreamer -> 0.10 -> default) changing the key "musicaudiosink" from "alsasink" to "alsasink device=ladcomp"

All my movies seem to be nearly the same volume now. I setup xine to use it as well, and played a DVD and it seemed to be just a bit louder than movie files, so I'll have to look more into exactly what this filter is doing, maybe it is not reducing loud volume, but just cranking up low volume?

Tuesday, September 8, 2009

smp usb flash-on-root corruption issue

I suspect (but can't really confirm) that having this 3-processor phenom chip and booting to USB flash, combined with suspend-to-ram seems to somehow result in an extremely corrupted filesystem. Booting with kernel option "nosmp" seems to completely resolve the problem... so, that is good and sucky at the same time. Aha! Hot-plug to the rescue! I just stuck this script in /etc/pm-tools/sleep.d/99cpu

#!/bin/sh
. "${PM_FUNCTIONS}"

case "$1" in
hibernate|suspend)
echo 0 > /sys/devices/system/cpu/cpu1/online
echo 0 > /sys/devices/system/cpu/cpu2/online
;;
thaw|resume)
echo 1 > /sys/devices/system/cpu/cpu1/online
echo 1 > /sys/devices/system/cpu/cpu2/online
;;
*)
;;
esac



We'll have to see if it solves the problem, but it does indeed remove my 2 processors before suspend and then adds them back again after everything is back up. Kinda sad but I don't feel like upgrading my kernel or messing around this more than I have to :-)

Debian Lenny
Kernel 2.6.26-2-686 #1 SMP

Sunday, September 6, 2009

Linux Wireless Fun

LinkSys WPM54G PCI wireless card:

apt-get install firmware-ralink
it should work now

edit /etc/pm/config.d/defaults
and add/change:
SUSPEND_MODULES="rt61pci"

now you should be able to suspend the computer and not hang on resume

Saturday, August 29, 2009

Harbor Freight Wood Carving Tools

I know Harbor Freight has cheap tools, but they are usually at least functional-- for a little while anyway. In the case of the 11 piece Wood Carving Set, however, my recommendation would be to steer clear. At $5.99, that comes out to less than 50 cents per tool. How can you possibly make a tool for "The Finest Wood Carving Applications" for only 50 cents?!?








Don't look so bad huh? Well, just wait until you try to carve something with them.











Ummmm is this a U-gouge?












How is this supposed to work?












These are going back. $6 bucks, yeah-- they aren't worth their weight in iron.












This is what a real V-Gouge tool should look like. Sigh...

Monday, July 27, 2009

fix f-spot downgrade version crash database

Have you ever downgraded F-Spot from Debian Unstable to Stable, only to find that the moment you create a "version" of a photo, your entire F-Spot gallery becomes hosed?

The solution is to fix your database to not include the new fields that came with whatever that new version of F-spot was, and make it like it was back in F-Spot 0.4.4. F-Spot might even be nice and move your "broken" database to the root of your home folder. Never fear! Open up the file "photos.db" (which may be at ~/.gnome2/f-spot/) in your favorite SQL Lite editor (apt-get install sqlitebrowser). Now, modify the photos and the photos_versions table to remove the md5sum field. That's it!

They must have added md5sum because it was a good idea, but didn't consider all of us that might downgrade to a version that didn't know about this field!

Here are the errors you may see:

Starting new FSpot server

Unhandled Exception: Mono.Data.SqliteClient.SqliteExecutionException: SQL logic error or missing database
at Mono.Data.SqliteClient.SqliteCommand.ExecuteStatement (IntPtr pStmt, System.Int32& cols, System.IntPtr& pazValue, System.IntPtr& pazColName) [0x00000]
at Mono.Data.SqliteClient.SqliteCommand.ExecuteStatement (IntPtr pStmt) [0x00000]
at Mono.Data.SqliteClient.SqliteCommand.ExecuteReader (CommandBehavior behavior, Boolean want_results, System.Int32& rows_affected) [0x00000]
at Mono.Data.SqliteClient.SqliteCommand.ExecuteNonQuery () [0x00000]
at Banshee.Database.QueuedSqliteCommand.Execute () [0x00000]




Starting new FSpot server
Exception in Gtk# callback delegate
Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception.
System.NullReferenceException: Object reference not set to an instance of an object
at FSpot.Utils.UriUtils.UriToStringEscaped (System.Uri uri) [0x00000]
at FSpot.ThumbnailGenerator.ThumbnailPath (System.Uri uri) [0x00000]
at FSpot.Widgets.IconView.DrawCell (Int32 thumbnail_num, Rectangle area) [0x00000]
at FSpot.Widgets.IconView.DrawAllCells (Rectangle area) [0x00000]
at FSpot.Widgets.IconView.OnExposeEvent (Gdk.EventExpose args) [0x00000]
at Gtk.Widget.exposeevent_cb (IntPtr widget, IntPtr evnt) [0x00000]
at GLib.ExceptionManager.RaiseUnhandledException(System.Exception e, Boolean is_terminal)
at Gtk.Widget.exposeevent_cb(IntPtr widget, IntPtr evnt)
at Gtk.Widget.exposeevent_cb(IntPtr , IntPtr )
at Gtk.Adjustment.gtk_adjustment_value_changed(IntPtr )
at Gtk.Adjustment.gtk_adjustment_value_changed(IntPtr )
at Gtk.Adjustment.ChangeValue()
at FSpot.Widgets.IconView.ScrollTo(Int32 cell_num, Boolean center)
at FSpot.Widgets.IconView.ScrollTo(Int32 cell_num)
at MainWindow.JumpTo(Int32 index)
at MainWindow.LoadPreference(System.String key)
at MainWindow.HandleIconViewReady(System.Object sender, System.EventArgs args)
at Gtk.Widget.SizeAllocatedSignalCallback(IntPtr arg0, IntPtr arg1, IntPtr gch)
at Gtk.Widget.SizeAllocatedSignalCallback(IntPtr , IntPtr , IntPtr )
at Gtk.Application.gtk_main()
at Gtk.Application.gtk_main()
at Gtk.Application.Run()
at Gnome.Program.Run()
at FSpot.Driver.Main(System.String[] args)

Wednesday, April 8, 2009

USAA Deposit at Home on Linux *It works now!!!*

*update 10/12/11* IT WORKS!!  Thanks to Garrett, and Mr. Brown from USAA, you no longer need to use any special software to trick the website into letting you post your deposits.  A message on the site reads: "Your system does not meet the minimum system requirements. You may choose to continue, but we recommend using a supported system".  No problem, click next and you are on your way.   Thanks for listening, USAA!!


*update* Thanks to Dave for the idea,
*update* Thanks Garrett, see his comment below.  We may all be wise to send USAA a suggestion via the feedback link.  Just remember to be nice.  The last thing we need is for USAA to decide to implement better browser detection to specifically block linux.  Or worse, implement Silverlight.  In the meantime:

Just set your user agent using a firefox addon to:

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; sv-SE; rv:1.9.0.8) Gecko/2009032608 Firefox/3.0.8

If you have trouble adding that user agent, here is what I did after you install the add-on above:
Tools-->User Agent Switcher-->Options-->Options
Useragents-->Add
Description: Firefox Macitosh Intel for USAA (or whatever you want)
Useragent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; sv-SE; rv:1.9.0.8) Gecko/2009032608 Firefox/3.0.8
OK
OK

Make sure you switch to that user agent before even going to USAA.

And make sure you have the java plugin and you are good to go! Thank you macintosh for having a marketshare to help us linux fools get stuff working. The macintosh java client allows you to simply select pre-scanned checks with your choice of software. Nice!

Note: This assumes you can get your scanner to work in linux which is assuming quite a bit :-)

Sunday, March 29, 2009

sleeping your computer

Sounds easy, right? You go into Power Management and set it to sleep after 30 mins. Done deal. Well what if you've enable fast user switching? Now all-of-a-sudden your computer goes to sleep because your wife is idle on VT8 while you are active on VT7. Dammit!

Here is a work-around: don't use X to sleep the computer. Disable sleep for each profile, then:
apt-get install sleepd
edit /etc/default/sleepd
mine looks like:
PARAMS="-U 1800 -u 1800 -i 22 -i 23 -s \"s2ram -f\""

The default is to hibernate which is silly for a diskless desktop, so I s2ram instead. The interrupts to watch can be discovered by:

watch -n1 cat /proc/interrupts

Now wiggle the mouse and hit keys on the keyboard to discover which interrupts increment when you do that.

Monday, February 9, 2009

multiseat 3D. denied (for now)

So I've been trying to figure out a way to let my daughter play the "duck game" (or at least watch the penguin drift aimlessly down the hill) while I do whatever else I am doing that is so damn important. Naturally, the first thing a normal person thinks to do is hook up another monitor, keyboard, and mouse to their existing computer. Right? Everyone does this? No.

This is basically the dream. However, to get there from here you need TWO video cards. I have an PCI-Express Nvidia card. So I needed another PCI video card that can do 3D. In case you don't know, PCI is kind-of getting obsolete for video cards these days so it isn't easy to find one. My brother kindly gave me an ATI Radeon PCI something or other. Great! Plug it all in and I'm ready to roll.

Wait. Nvidia ships with proprietary OpenGL libraries. ATI ships with proprietary OpenGL libraries. Damn! You can't mix the two! So I spend $50 on a Sparkle brand Nvidia card just like my PCI-Express version and now I have TWO identical cards except for the interface. And now here is where we come so, so close...

I get it all working. Using the config example earlier I get two logon prompts on two monitors. I can log in on one and on the other. OpenGL games work on both! Most importantly, the Duck Game works! I tried Quake3 but it is pretty darn slow, but that might be related to a serious problem: one of my three cpu cores is completely pegged while the second instance of Xorg is running. I had the same problem with the ATI card (using the free non-GL drivers), so it seems to be an Xorg thing.

Another problem is that I cannot switch consoles (seems you must disable this for dual Xorg instances to work). This means no "switch users" functionality (unless you count logging on to the other monitor). So now it is harder to share the computer with my wife, which is ironic since I doubled the seats! Finally, sleep mode doesn't work so well, coming out goes to a blank screen and seems to be crashed.

So maybe I'll post a bug report to Xorg and these issues can be resolved.. but I sort-of doubt it since there is very little demand for this multiseat business...

** Update**

Xorg version 7.4 provides GLX pass-through-- so I should be able to xephyr and not fuss with xorg instances. This might solve everything....

How to Lose Data the Microsoft Way

1. Use File and Settings Transfer Wizard

I should end here, but just for posterity...

2. Uncheck all the options and only select the option to backup specific folder. Specify "C:\Documents and Settings". Chuckle to yourself as you wonder if anyone else was clever enough to use this to transfer multiple user accounts.
3. Watch the backup process succeed in creating a large .DAT file of unknown composition.
4. Assume you know what you are doing.
5. Format, Reinstall, and attempt to restore using the wizard.
6. Stare in bewilderment at all the missing user accounts and lack of data.
7. Cry a little
8. Create all the user accounts and try running the wizard on each account while logged in.
9. Allow a small gasp of hope when you notice all the avatars are restored on the Welcome Screen. It must have restored their data!
10. Cry again when you realize it didn't. At all.
11. Unpack the F.A.S.T archive using some obscure 3rd party program called fastconv.exe.
12. Cry some more after it fails on the translation database and you are left with thousands of arbitrarily named .DAT files. Try it again in WINE and get the same error.
13. Write a script to add extensions to the files based on magic library... and cry again when you realize the small number of files are only related to the user account that was logged on during the initial F.A.S.T migration.
14. Curse the heavens, curse Microsoft, then curse yourself for being such an idiot.
15. Blame the user for not making regular backups.