Friday, March 27, 2009 (Yet another one)

I have posted two versions of my script. (The one that checks if I have been disconnected from the net and reconnects)

Here's the latest one. It is now capable of checking if one instance is already running, and won't start another one unnecessarily:

#echo "Going Online..."
#/usr/local/bin/ > /dev/null
trap "{ echo $0 removing lock; rm -f $LOCKFILE; exit 255; }" SIGINT SIGTERM
if [ -f $LOCKFILE ]; then
echo "$0: already running, exiting..."
exit 1
while true; do
ping -c 2 -W 120 > /dev/null

if [ "$?" = "0" ]; then
echo "You are connected"
/usr/local/bin/ > /dev/null
echo "Disconnect detected at `date`, reconnecting" >> /home/akshay/logs/keeponline.log
sleep 10m

There is no real use for this script, since SuperSify provides this feature. But I found that my version has less number of false positives when the bandwidth is completely choked. Besides, I just wanted to learn how to use traps :)

Thursday, March 26, 2009

How I increased sound volume in ubuntu

Ever since I upgraded my machine, I got very low sound volume in Ubuntu. In windows, the volume was nice and loud enough. After digging around a lot, I tried something on my own and it worked! (Yes, I had tried playing around with all the volume controls in alsamixer)

I have an NVidia nForce 630i board and I'm using the onboard sound card:

00:0a.0 PCI bridge: nVidia Corporation MCP73 PCI Express bridge (rev a1)

For some strange reason, I see four mixer devices:

I use pulseaudio as my default sound server. Here's what I did:

Under System > Preferences > Sound, I changed my Default Mixer Tracks to Playback: ALSA PCM on front :0 (ALC662 Analog) via DMA (PulseAudio Mixer)

Right clicked on the volume control applet in the panel > Preferences. Here, I could choose the default device and track to control. I chose the same: Playback: ALSA PCM on front :0 (ALC662 Analog) via DMA (PulseAudio Mixer). (There's only a master track).

Finally, I made all the other relevant volumes 100% in all the other devices (except capture devices). Don't forget to click on the "Preferences" button to see all the tracks

I'm essentially using only the Playback: ALSA PCM on front :0 (ALC662 Analog) via DMA (PulseAudio Mixer) for controlling my volume. I don't know why or how this works, but it works for me...

The only problem is that it won't remember my volume levels after I reboot.