Oh Yeah

Posted in Uncategorized on December 3rd, 2008 by Ronald Prettyman

This is getting sad, I’ve gotten to the point where conf files are beginning to seem like something to look forward to. I seriously need a job, not just to pay the bills, cause I can always figure out a way to pay the bills but just to have something to do. My minimalistic nature is getting the best of me.

But on a bright note, I actually had a purpose for making a script on my own with out any outside direction of purpose or design. Now granted it wasn’t that complicated, but my usual script consist of

#!/bin/bash
command
#end script

So for a personal script its big. Now right now its just functional not very scalable but I’m going to fix that. I just can’t distribute it, because it only accepts two values 1 or 2. But I think I can simplify it even more then i have and take about 5 or 6 lines off and make 5 or 6 more lines in comments.

Essentially what the script does is it takes the input of 1 or 2 (0 exits) and increases the dB at the port my headphones are hooked up to. I just didn’t want to have to install gui to control the volume and typing a 30 character string over and over again was pointless so I created the script, then I mapped the script to function keys on my keyboard so one key out put 1 to the script and another key out puts 2 and the volume changes as set.

Now granted I did still the import function from the Mysql service script but I would i been reading though manuals for hours trying to figure out that

grabs the string after the script is called, in Mysql’s case it grabbed Start Restart stop etc.

So for write now I have this. I do see where i can simplify it and add functionality for erroneous import and a mute button and dynamic conl.

#!/bin/bash
adT=”${1:-”}”
avol=`amixer sget ‘Analog Front’ | grep ‘Front Left:’ | cut -d’ ‘ -f6`
con1=5
if [ $adT -eq 0 ]; then
exit 0
fi
#Volume Goes up if 1
if [ $adT -eq 1 ]; then
nVol=$((avol+con1))
echo 1 If
fi
#Volume Goes Down if 2
if [ $adT -eq 2 ]; then
nVol=$((avol-con1))
echo 2 If
fi

amixer sset ‘Analog Front’ $nVol
end script

UPDATE

#!/bin/bash
#
#
#
#
#
#
######Ron’s Alsa Volume Script########
#
#This script can be controlled with what ever keyshortcut command you want, or by hand
#to activate script simple type out the name ./vol.script (argument)
#Positive Numbers increase the Volume
#Negative Numbers decrease the Volume
#Mute toggles the Mute
#the mute toggle is stored in your home directory default /home/$USER/.unmute
#
#This script uses amixer, we are assuming that you are using the Analog Front for your audio output.
#If your using a different audio output update the AVOL line as applicable
#
#Argument Passed to Variable
CONL=”${1}”
#Current Volume Passed to Variable
#IF YOUR AUDIO IS COMING OUT OF ANOTHER PORT OTHER THEN ‘Analog Front’ replace it below
AVOL=`amixer sget ‘Analog Front’ | grep ‘Front Left:’ | cut -d’ ‘ -f6`
echo $CONL
#if Null
if [ -z $CONL ]; then
echo Null
exit 0
fi

#if mute MUTE AGRUMENT
if [ $CONL = mute ]; then
#if unmute IF VOLUME=9
if [ $AVOL -eq 0 ]; then
UNMUTE=`cat /home/$USER/.unmute`
echo $UNMUTE
amixer sset ‘Analog Front’ $UNMUTE
RES=1
UNMUTE=0
echo UNMUTE
exit 0

else
#ELSE MUTE
echo `echo $AVOL >> /home/$USER/.unmute`
amixer sset ‘Analog Front’ 0
RES=2
echo MUTE
cat /var/log/unmute
exit 0
fi
fi
#if argument VOID
if [[ $CONL != [0-9]* ]]; then
#Void
echo VOID
fi
#if volume increase POSITIVE ARGUMENT
if [[ $CONL = [0-9]* ]]; then
#Add Augument to Current Volume
RES=4
let VOL=$(($AVOL+$CONL))
amixer sset ‘Analog Front’ $VOL
echo UP
fi
#if volume decrease NEGATIVE ARGUMENT
if [[ $CONL < [0-9]* ]]; then
#Add Augument to Current Volume
RES=4
let VOL=$(($AVOL+$CONL))
amixer sset ‘Analog Front’ $VOL
echo DOWN
fi
#end script

I changed it to make it more accessible. It is now controlled as follows, positive arguments increase the volume, negative arguments decrease the volume, and the mute argument toggles mute. Might come in handy for someone, works great for me.

Tags: , ,

I give up

Posted in Uncategorized on December 2nd, 2008 by Ronald Prettyman

Well I give up, I’m not about to upgrade all my hardware just to run windows 2008. So i blew it away and installed Ubuntu Server, it’s minimal. Well I’ve got it up and running I installed xorg shortly after my first boot and installed flux, its running nicely I even managed to find a kernel module for my webcam. I had to compile a half dozen version before I found the right one. I probably would of saved some time if I had just written down the pid.

Now to setup the domain controller and try to have minimal impact on the rest of my network.

Tags: , ,