Sunday, August 29, 2010

Compost Recipe #18: Pickles!

10-12 ripe organic cucumbers from your garden
1/2 gallon apple cider vinegar
5 pounds sugar
1 entire tin of mustard seeds
1 perfectly good onion
1 rather expensive green pepper
1 tsp turmeric powder

Slice cucumbers into 1/4" rounds and arrange in jars along with chopped onion and green peppers.  Heat vinegar, sugar and remaining ingredients and pour the hot solution into the jars, fully covering the contents.  Seal and refrigerate the jars for up to one week before transferring to your compost bin.

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?