Saturday, January 26, 2008

ubuntu disable hardware

I had a second sound card that kept getting picked up by apps under ubuntu as my primary audio device. In windows I sometimes use the game port on this pci sound card, but in general I don't even care if Linux detects it.

In ubuntu gnome, under System->Preferences->Sound
I had something like this:

In an unrelated effort, I had only recently discovered an important linux command - lsmod

The command list modules will display information about all loaded kernel modules. Kernel modules are dynamically loaded kernel functions, such as a device driver.

When I looked through the list of loaded kernel modules on my system:
lsmod | less
I found this:

snd_ens1370 21536 0
gameport 16776 1 snd_ens1370
snd_ak4531_codec 9856 1 snd_ens1370
snd_pcm 80388 5 snd_ens1370,snd_intel8x0,snd_ac97_codec

There was no doubt in my mind - I needed to stop the kernel from loading the module snd_ens1370.

I had considered just deleting it all together:

$ locate 1370

But it turns out there is a more elegant way.

To disable hardware in ubuntu - blacklist the module.

Take a look at, /etc/modprobe.d/blacklist

To disable my Ensoniq sound card in ubuntu - I added the following lines:
# disable my PCI ensoniq sound card
blacklist snd_ens1370

then just reboot...

Wednesday, January 16, 2008

how does bash work

When evoked the Borne Again Shell can launch one of two different types of interactive shells, login or non-login.

These descriptions are based on my experiences with a variety of Debian & Fedora based environments - each has their own peculiarities in their implementation of bash. I'll do my best to be "generic"

When you login via tty, ssh, or su --login - your $SHELL is launched for you. This is called a "login" shell, and it will automatically source the following files:
1) /etc/profile
2) ~/.profile or ~/.bash_profile
(but generally not both, one will take "precedence")
When you launch /bin/bash by some other means (xterm, konsole, su, or even typing /bin/bash) it is considered non-login and it WILL source .bashrc

It is VERY common for ~/.profile (or ~/.bash_profile) to source ~/.bashrc by either:
. ~/.bashrc
source ~/.bashrc
You can use source either way - in both interactive and non-interactive shells.

/etc/profile may source lots of other files. Sometimes /etc/bashrc (or /etc/bash.bashrc) and sometimes even ~/.bashrc - so watch out!

Your system may not have all these files - or they may have different names. Try:
ls -al /etc/ | grep bashrc
ls -al /etc/ | grep profile
ls -al ~ | grep bashrc
ls -al ~ | grep profile
to get some different ideas.

the command "su -" is short hand for "su --login root" or "switch user to root and launch a login shell"
it is NOT "switch to super user and load environment variables" (even if that may be the case on some systems)

Saturday, January 5, 2008

3RLOD Error 0020 X Clamp Replacement

And so, it was my turn:

For a used 360, I'm actually pretty happy it lasted as long as it did. Manufacture date was 2/06 - so there's nothing holding me back now.

Funny thing, this is actually how my FIRST xbox got modded. When it broke, it was out of warranty, so I had nothing keeping me from opening it up. XBMC is the best thing I ever did for my entertainment center.

In this case the interwebz says I need an X-Clamp Replacement - so you know... whatever.

I went with RBJ's MKIII method. Which is extremely well documented, so I didn't really take many pictures. (Update: Last I checked RBJ had taken down his tutorial, which is too bad - I sent him a message. Lamma has a good one up, which is essentially the same thing. However, it should be noted I did NOT buy the kit he's selling - although I'm sure it's worth every penny - you can get the parts anywhere. It's the work of removing the x-clamp, not the tools/equipment you use, that fixes your xbox.)

I used the following hardware from Lowe's:
2 packs - M5-.8x20mm - Oval Head Phillips - Sales # 138573 - $.92 each pack (Qty:2)
2 packs - M5-.8x16mm - Oval Head Phillips - Sales # 138566 - $.68 each pack (Qty:2)
5 packs - 5mm Flat Washers - Part # 138319 - $.56 each pack (Qty:10)

I spent probably more time than I should have cleaning the old thermal paste off the chips & heat sinks. Goo-Gone and 99% alcohol. Then I used a razor to spread a very thin even layer of some generic thermal paste on the CPU and GPU. I just used what I had lying around instead of the "artic silver" stuff everyone talks about.

Drilling the holes in the case was surprisingly pretty easy - I used a 1/4" bit for a pilot hole, then opened it up to 3/8's. Using the tape to hold the bolts in place while I got the board in place also went pretty smooth.

I accidentally screwed the CPU head sink down backward on my first try putting things back together (heat tube AWAY from the GPU) - but once I got everything screwed down... It booted up on the first try - green lights all around.

Been running great for 3 days - posted success.

BTW, I start the new job @ Rackspace on Monday.