Saturday, August 29, 2009

Edit:  She finally did return my call.  We spent a couple of weeks talking things through.  I'm not saying things are perfect yet.  But she did come home.  I believe that with good communication we can work things out.  To quote one of my favorite movies - "Stuffs gettin better, stuffs gettin better all the time"


Yesterday my world came crashing down on me. I came home from work and found an empty house. My beautiful wife had packed what she could in the Accord and left with all three boys. I'm not saying that I was suprised. This is the second time she left in two months. Just... well unexpected. We had dinner plans. I am not the perfect husband, by any means. But, I try very hard. We fight, sometimes more than others. But doesn't every couple? We have been trying to communicate better lately. But, i guess, not enough.

So far she has been gone about 30 hours. I don't know if she made it to where she was headed. She won't answer text or voice messages. Neither will her sisters or mother. I don't even know how my sons are. My oldest just started first grade. He was trying very hard to make some knew friends. The other two have been through so much in the last two months that they are showing signs of seperation anxiety.

I just wish i knew if they were ok.

Friday, August 7, 2009

Script for updating chrome on Vector Linux and Slackware

I wrote an update script to go along with my install script. This one hits the Google Chrome Linux repo to get the latest released version. Doesn't handle dependencies. Doesn't create any simlinks. This one assumes Chrome has already been installed and just replaces the parts that need updated. You can find my install-chrome script here.

Originally published here


Code:
#!/bin/bash
# Title: update-chrome
# Author: BroknDodge
# License: BSD
# Version: 0.0.1

# http://dl.google.com/linux/deb/dists/stable/main/binary-i386/Packages.gz
# http://dl.google.com/linux/deb/dists/pool/main/g/google-chrome-unstable/google-chrome-unstable_3.0.196.0-r22005_i386.deb

#----------------------------------------#
# Settings

url="http://dl.google.com/linux/deb/"
tmp="/tmp"

#----------------------------------------#

#----------------------------------------#
# Testing the Environment

if [ $UID != 0 ];then # test for root
echo "You must run this script as root."
exit 0
fi

if [ ! -d "$tmp/update-chrome" ]; then
# Will enter here if dir doesn't exist
mkdir $tmp/update-chrome
fi

cd $tmp/update-chrome

if [ -f "Packages" ]; then
#checking to see if Packages exists
mv Packages Packages.installed
fi

#----------------------------------------#

function check-update {
wget http://dl.google.com/linux/deb/dists/stable/main/binary-i386/Packages.gz
gunzip Packages.gz

if [ ! -f "Packages.installed" ]; then
update
fi

version=`grep 'Version:' Packages`
version=${version#*:}
read -rd '' version <<< "$version"

VersionInstalled=`grep 'Version:' Packages.installed`
VersionInstalled=${VersionInstalled#*:}
read -rd '' VersionInstalled <<< "$VersionInstalled"

if [ "$version" == "$VersionInstalled" ]; then
echo Google Chrome is Up to Date
rm Packages
quit
else
echo $VersionInstalled is installed, but $version is available
echo Updating
update
fi

}

function update {

filename=`grep 'Filename:' Packages` # assign grep output to a variable
filename=${filename#*:}
read -rd '' filename <<< "$filename" # remove white space from a variable

mkdir tmp
cd tmp
wget $url$filename

rm -R /opt/google/chrome # get rid of the previous install
# don't worry settings are stored in $HOME dir
cd $tmp/update-chrome/tmp

echo Unpacking the deb file...
ar -x ${filename##*/}
echo Extracting Google Chrome...
lzma -d data.tar.lzma
cd /
echo Updating Google Chrome...

tar xf $tmp/update-chrome/tmp/data.tar
cd $tmp/update-chrome
mv Packages Packages.installed
VersionInstalled=`grep 'Version:' Packages.installed`
filename=${VersionInstalled#*:}
read -rd '' VersionInstalled <<< "$VersionInstalled"
echo Google Chrome updated to version "$VersionInstalled"
rm -R tmp

quit
}

function quit {
exit 0
}

function main {
check-update
}

main
exit

Google Chrome on Vector Linux and Slackware 12.x

I been running Chrome on Ubuntu at work for a couple of months, and I have to say, I'm impressed. I run VectorLinux 6.0 at home. I wanted to give chrome a spin. Unfortunately, my system isn't big enough to build from source. So I had to go with the .deb installation file provided by Google. Not exactly an easy task to install a foreign package on a Slackware based Distro. During the testing I developed a script to automate the process. With the help of some friends on the VectorLinux Forums, I think I've got it working pretty well.

Originally published here
So here it is:

Code:

#! /bin/bash
# Title: install-chrome
# Author: BroknDodge
# License: BSD
# Version: 0.0.5
#
# Special thanks to the following Vectorians for their help and suggestions:
# Daniel stretchedthin uelsk8ts
# hata_ph rbistolfi MOE-lnx
#
# Very Special thanks to the folks at Chromium.org and Google
# without whom there wouldn't be anything to install
#

#------------------------------------------#
# Setting up the Environment

enablePlugins="$1"
tmp="/tmp"

chromeURL="http://dl.google.com/linux/direct"
chromePackage="google-chrome-unstable_current_i386.deb"

nssURL="http://connie.slackware.com/~alien/slackbuilds/mozilla-nss/pkg/12.2"
nssPackage="mozilla-nss-3.12.3-i486-1alien.tgz"

#------------------------------------------#
# Making sure the system is sane

if [ $UID != 0 ]; then
echo "You must run this script as root."
exit 1
fi

if [ -d "$tmp/install-chrome" ]; then # check for and create temp dir
# Will enter here if dir doesn't exist
rm -R $tmp/install-chrome # hope you didn't have anything
mkdir $tmp/install-chrome # stored there
else
mkdir $tmp/install-chrome
fi

#------------------------------------------#

function dotests {

echo Running tests...
#------------------------------------------#
# check for lzma

haveLZMA=`which lzma` # check for and getting lzma
if [ "$haveLZMA" == "" ]; then
slapt-get --install lzma
fi

#------------------------------------------#

#------------------------------------------#
# check for nss = 3.12.3

nssInstalled=`slapt-get --search nss-3.12.3` # I really need to check the version
nssInstalled=${nssInstalled#*=} # as well, but this build seems to
nssInstalled=${nssInstalled%]*} # work best with 3.12.3

if [ "$nssInstalled" != "yes" ]; then
installnss
fi
#------------------------------------------#

#------------------------------------------#
# check for GConf

gconfInstalled=`slapt-get --search GConf-2.22.0` # VL-Light doesn't ship with GConf
gconfInstalled=${gconfInstalled#*=}
gconfInstalled=${gconfInstalled%]*}

if [ "$gconfInstalled" != "no" ]; then
slapt-get --install GConf
fi
return
}
#------------------------------------------#


function simlinks {
cd /usr/lib
if [ ! -f "libnspr4.so.0d" ]; then
ln -s libnspr4.so libnspr4.so.0d
fi

if [ ! -f "libnss3.so.1d" ]; then
ln -s libnss3.so libnss3.so.1d
fi

if [ ! -f "libnssutil3.so.1d" ]; then
ln -s libnssutil3.so libnssutil3.so.1d
fi

if [ ! -f "libplc4.so.0d" ]; then
ln -s libplc4.so libplc4.so.0d
fi

if [ ! -f "libplds4.so.0d" ]; then
ln -s libplds4.so libplds4.so.0d
fi

if [ ! -f "libsmime3.so.1d" ]; then
ln -s libsmime3.so libsmime3.so.1d
fi

if [ ! -f "libssl3.so.1d" ]; then
ln -s libssl3.so libssl3.so.1d
fi

return
}

function installnss {

cd $tmp/install-chrome
wget $nssURL/$nssPackage
if [ ! -f "$nssPackage" ]; then
echo "For some reason wget didnt pull nss from Connies"
echo "slackware site"
exit 1
fi
installpkg $nssPackage

rm $nssPackage
return
}

function installchrome {

cd $tmp/install-chrome
wget $chromeURL/$chromePackage

if [ ! -f "$chromePackage" ]; then # quit running if wget failed
echo "Something went wrong while retrieving" # and kick out a sane error msg
echo "Google Chrome"
exit 1
fi

echo "Unpacking the deb file"
ar -x $tmp/install-chrome/$chromePackage

if [ ! -f "data.tar.lzma" ]; then # quit running if ar failed
echo "Something went wrong while unpacking" # and kick out a sane error msg
echo "the .deb file"
exit 1
fi

echo "Extracting Google Chrome"
lzma -d data.tar.lzma
if [ ! -f "data.tar" ]; then # quit running if lzma failed
echo "Something went wrong while extracting" # and kick out a sane error msg
echo "Google Chrome"
exit 1
fi

cd /
echo "Installing Google Chrome"

tar xf $tmp/install-chrome/data.tar
if [ ! -f "/opt/google/chrome/google-chrome" ]; then # let me know if chrome wasn't
echo "Installation failed while" # installed correctly
echo "moving files"
exit 1
fi

if [ "$enablePlugins" = "--enable-plugins" ]; then
IFS='
'
file=( $( < /opt/google/chrome/google-chrome.desktop ) )
file[5]="Exec=/opt/google/chrome/google-chrome --enable-plugins %U"
echo "${file[*]}" > /usr/share/applications/google-chrome.desktop
echo "Desktop Menu created with Plugin support"
echo "Installation complete"
quit
else
cp /opt/google/chrome/google-chrome.desktop /usr/share/applications/google-chrome.desktop
echo "Desktop Menu created without Plugin support"
echo "Installation complete"
echo
echo "to enable flash type google-chrome --enable-plugins"
quit
fi

}

function quit {
exit 0
}

function main {
echo
echo "WARNING WARNING WARNING WARNING WARNING"
echo "This script may severely damage your system"
echo "Dont say I didnt WARN you"
echo
echo "Are you sure you want me to Monkey with your System? [yes/no]"
echo "[for your safety you must type yes to proceed]"
echo

read YN
if [ "$YN" = "yes" ]; then
if [ -d "/opt/google/chrome" ]; then
echo "Looks like Google Chrome is already installed"
echo "Do you want to remove it and reinstall? [yes/no]"
read yn
if [ "$yn" = "yes" ]; then
rm -R /opt/google/chrome
rm /usr/share/applications/google-chrome.desktop
dotests
simlinks
installchrome
else
quit
fi
else
dotests
simlinks
installchrome
fi
elif [ "$YN" = "no" ]; then
quit
else
main
fi
quit
}

main
exit