Posts Tagged ‘Recipes’

fixing sound in debian

Monday, September 22nd, 2008

I’m running debian lenny/sid with  kernel 2.6.26-1 on my workstation and for a while, my audio hasn’t been working in most applications (I was most annoyed by the lack of sound in flash), though it has been working in amarok.  I was getting error messages like this when trying to do audio playback.  These particular messages are from Ekiga:

ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'defaults.namehint.extended'
ALSA lib conf.c:3513:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:3985:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM plughw:0
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'defaults.namehint.extended'
ALSA lib conf.c:3513:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:3985:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM plughw:0
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'defaults.namehint.extended'
ALSA lib conf.c:3513:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:3985:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM plughw:0

I finally looked into this and was able to fix it with the simple command

 $ sudo asoundconf reset-default-card

Dual Headed X11 setup with GeForece 8400 GS on Debian lenny/sid

Thursday, May 22nd, 2008

Having a job at the university means that I have access to hardware that I can’t afford to buy for myself.  My coworker was getting a new video card for his workstation and they just ordered me one too.  The card is an Nvidia GeForce 8400 GS PCI Express card manufactured by Chaintech.

Downloading the Driver

I have zero experience with post AGP video cards or dual head setups, so I just went off of my corworkers recommendation that I use the non-free Nvidia driver.  I downloaded it from this page:

http://www.nvidia.com/object/linux_display_ia32_169.12.html

Installing the Driver

I ran the driver installer with the command:

sh NVIDIA-Linux-x86-169.12-pkg1.run

and it told me that it needed to be run as root and after X was shut down, so I had to switch to a console, kill X and su to root.

The installer told me that it couldn’t find any precompiled drivers for my kernel, so I would have to build them.

The installer also told me that the compiler that it found (gcc-4.2) was different than the one used to build my running kernel (gcc-4.1), so I had to set my CC environment variable to /usr/bin/gcc-4.1:

export CC=/usr/bin/gcc-4.1

It then told me that it couldn’t find the kernel source or kernel headers for my kernel (at the time 2.6.24-1).  To get the headers, I followed some of the directions for building out-of-tree kernel modules:

apt-get install linux-headers-2.6.24-2-686

Finally, I reran the driver installer, specifying the location of my kernel headers:

sh NVIDIA-Linux-x86-169.12-pkg1.run –kernel-source-path=/usr/src/linux-headers-2.6.24-1-686/

and the installation completed without a hitch.

Configuring X (for this card with dual heads)

This was the easy part because my coworker kicked me this config file:

# xorg.conf (X.Org X Window System server configuration file)
#
# This file was generated by failsafeDexconf, using
# values from the debconf database and some overrides to use vesa mode.
#
# You should use dexconf or another such tool for creating a "real" xorg.conf
# For example:
#   sudo dpkg-reconfigure -phigh xserver-xorg

Section "ServerFlags"
    Option "DefaultServerLayout" "layout0"
#    Option "Xinerama" "True"
EndSection

Section "InputDevice"
	Identifier	"keyboard0"
	Driver		"kbd"
	Option		"XkbRules"	"xorg"
	Option		"XkbModel"	"pc105"
	Option		"XkbLayout"	"us"
EndSection

Section "InputDevice"
	Identifier	"mouse0"
	Driver		"mouse"
EndSection

Section "Device"
	Identifier	"nvidia0"
	Boardname	"GeForce 8400 GS"
	Busid		"PCI:1:0:0"
	Driver		"nvidia"
	Screen	0
#    Option "Monitor-" "monitor0"
#    Option		"NoLogo"	"True"
EndSection

Section "Monitor"
	Identifier	"monitor0"
	Vendorname	"Plug 'n' Play"
	Modelname	"Plug 'n' Play"
EndSection

Section "Screen"
	Identifier	"screen0"
	Device		"nvidia0"
	Monitor		"monitor0"
	Defaultdepth	24
	SubSection "Display"
		Depth	24
	EndSubSection
EndSection

Section "Device"
	Identifier	"nvidia1"
	Boardname	"GeForce 8400 GS"
	Busid		"PCI:1:0:0"
	Driver		"nvidia"
	Screen	1
#    Option "Monitor-" "monitor0"
EndSection

Section "Monitor"
	Identifier	"monitor1"
	Vendorname	"Plug 'n' Play"
	Modelname	"Plug 'n' Play"
EndSection

Section "Screen"
	Identifier	"screen1"
	Device		"nvidia1"
	Monitor		"monitor1"
	Defaultdepth	24
	SubSection "Display"
		Depth	24
	EndSubSection
EndSection

Section "ServerLayout"
	Identifier	"layout0"
    Screen 0 "screen0" 0 0
    Screen 1 "screen1" RightOf "screen0"
    Option "CoreKeyboard" "keyboard0"
    Option "CorePointer" "mouse0"
EndSection

Section "Module"
	Load		"glx"
	Load		"v4l"
EndSection

Section "DRI"
    Mode 0667
EndSection

sewing machine timing

Saturday, March 15th, 2008

Chiara’s sewing machine is broken.  The needle seems to collide with the hook.  It looks like the timing and hopefully the internet can save the day on this one.  It costs $60 to repair a sewing machine and I’m sure not much more to buy a new one.

Link to sewusa.com page on adjusting timing.

disabling tap-to-click on synaptic touchpad in ubuntu

Tuesday, March 11th, 2008

I was leant a Dell Latitude D810 that has a Synaptics touchpad.  Eventually, I had to admit that the tap-to-click setting was a little to sensitive and kind of annoying (most frequently, I accidently clicked things in my bookmarks toolbar in Firefox).  I found that I could disable the tap-to-click feature by adding the line:

 Option        "MaxTapTime"        "0"

to the appropriate section of my /etc/X11/xorg.conf file so that it looks like this:

Section "InputDevice"
    Identifier    "Synaptics Touchpad"
    Driver        "synaptics"
    Option        "SendCoreEvents"    "true"
    Option        "Device"        "/dev/psaux"
    Option        "Protocol"        "auto-dev"
    Option        "HorizEdgeScroll"    "0"
    Option        "MaxTapTime"        "0"
EndSection

linux cheatsheet

Tuesday, March 11th, 2008

Search and Replace in Multiple Files

perl -pi -w -e 's/search/replace/g;' *.php

from How to do a search and replace over multiple files

IRSSI cheatsheet

Thursday, February 21st, 2008

Scroll Up/Down: Page Up/Page Down keys

notes for the week of 2007-09-24

Wednesday, September 26th, 2007

Tim says to check out Kaati rolls while I’m traveling.

This wiki page has info on how to configure e-mail integration in eventum which Boxcar uses to handle tech trouble tickets. I wanted to turn off auto issue creation because we get a lot of e-mails that don’t neccessarily want to become issues and then there’s the overhead of closing the issue.

The Allied Media Conference is taking proposals for some web development. Josh asked me about Drupal vs. Joomla, and I’m not that familiar with Joomla. This thread seemed to offer some insight.

kdenlive is the software I started using to play around with video editing on linux.

I’ve long wanted to be able to do a substitution or other command on a visual block. It turns out that there is a vim script called vis.vim to help you do this.

I read mail using a lot of different clients. So, I wanted to seperate my mail filtering rules from my mail client. Imapfilter does the trick and though it’s configuration language is daunting at first glance, it’s not too bad.

I was wondering how to drop all tables in a MySQL DB from the command line:

mysqldump -u username -ppassword –add-drop-table –no-data database | grep ^DROP | mysql -u username -ppassword database

worked fine.

converting mp3 to wav using lame

Friday, May 26th, 2006

The CD burning program that I use under linux doesn’t support burning mp3s to audio cds directly, so I have to convert!

for i in *.mp3; do lame –decode $i `basename $i .mp3`.wav; done

The Linux MP3 CD Burning mini-HOWTO was super-helpful with this.

ripping realaudio to wav using mplayer

Wednesday, May 24th, 2006

$ mplayer rtsp://real.npr.org:80/real.npr.na-central/fa/20060414_fa_01.rm -ao pcm:file=hater.wav -vc dummy -vo null

This page was helpful as a reference.

potshots

Tuesday, March 14th, 2006

When my friend Leanne was passing through town last month, we went for a short hike around Lake Griffey.  While we were hiking, she mentioned that she really liked a comic called Potshots and that she was disappointed that her local paper had stopped carrying the comic.  Luckily, the comics are available on the web.  Leanne isn’t super internet-connected, so I offered to compile some of the potshots and send them to her in the mail.  I used wget to download them, but I needed to find a way to print the images many-to-a-page.

I eventually came upon using ImageMagick’s montage command.  This worked pretty well for me:

C:\Documents and Settings\ghing\Desktop\potshots>U:\ImageMagick-6.2.6-Q16\montag
e.exe -tile 2×5 -adjoin *.gif -geometry 300×190 sheet.png

Then I could just view and print the composite images in firefox, provided I made my margins small and zoomed in first.

Potshots is pretty interesting.  The artist who draws them was once called “history’s only full time, professional published eppigramist.” The black and white illustrations with clever phrases definitely have this feeling of antiquity to them.  The sayings have a strange tone as well, that can be heartfealt but also sarcastic.   So, they come off as a weird hybrid of Family Circle and Edward Gorey.