Saturday, May 14, 2011

Install Boxee on Ubuntu 11.04 Natty Narwhal

The Ubuntu package for the current version of Boxee as of this writing, 0.9.22.13692M, does not install on the latest version of Ubuntu.  It throws an error "Dependency is not satisfiable: libxmlrpc-c3"  The problem arises because libxmlrpc-c3 has been renamed to libxmlprc-c3-0.  The solution is to modify the debian package and change its dependencies.  This is easier than it sounds, but you have to know how.  Download the debian installer from the Boxee website, and place it in your home directory and then open up a terminal
dpkg-deb -x boxee-0.9.22.13692.i486.modfied.deb boxee
dpkg-deb --control boxee-0.9.22.13692.i486.modfied.deb boxee/DEBIAN
Now we need to edit the file that lists the dependencies.  Run the first command to do it with a GUI, or the second to use vim.
gedit boxee/DEBIAN/control
vi boxee/DEBIAN/control
Find libxmlrpc-c3 in this file and append -0 to the end of it so that is read "libxmlrpc-c3-0", and save the file.  Now we need to repackage our changes into a new debian package file.
dpkg -b boxee boxee-works.deb
When it is done simply double-click the newly created boxee-works.deb file and install it with Software Center.  Hopefully it will not be too long before the peeps over at Boxee fix the package so that it Just Works™.

Monday, April 25, 2011

cx_Oracle on Ubuntu 11.04 Natty

I used the following to install cx_Oracle on Ubuntu 11.04 for use with Python 3.2, though they should work with any version of Python supported by cx_Oracle.  This will basically involve using alien to convert lots of rpms into debian package.  Go ahead and install alien as well as some other libraries we will need.

sudo apt-get install alien libaio1 python3.2 libpython3.2

Change the above to reflect the version of Python you want to use.

First we need the Oracle Instant Client software.  Go to http://www.oracle.com/technetwork/topics/linuxsoft-082809.html or http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html (for 64-bit) and download either the basic or basiclite rpm.  I did not try the basiclite client, but I think they should both work.  You can also grab sqlplus and whatever other packages you may need while working with Oracle, but only the basic package is needed for cx_Oracle to work.  Once downloaded convert it to a debian package.

sudo alien -d oracle-instantclient11.2-sqlplus-11.2.0.2.0.i386.rpm

Replace the above line with the appropriate version of the instant client that you downloaded.

Now install it.

sudo dpkg -i oracle-instantclient11.2-basic_11.2.0.2.0-2_i386.deb

We need to create a configuration file pointing to the oracle library folder.

sudo vi /etc/ld.so.conf.d/oracle.conf

Depending on the version of the instant client installed you should have a folder like /usr/lib/oracle/11.2/client/lib.  This folder should be the first line to the oracle.conf file we create here.
Finally, for our Oracle client install, we need to define our ORACLE_HOME.  We need to create a new file.

sudo vi /etc/profile.d/oracle.sh

Add the following line, tweaking it as necessary to point to the version of Oracle you installed.
export ORACLE_HOME=/usr/lib/oracle/11.2/client
export LD_LIBRARY_PATH=$ORACLE_HOME/lib

On 64-bit installs then do the following line instead.
export ORACLE_HOME=/usr/lib/oracle/11.2/client64
export LD_LIBRARY_PATH=$ORACLE_HOME/lib

Now that our client software is setup, we can install the python library to connect to Oracle.

Download cx_Oracle from http://cx-oracle.sourceforge.net/  I want the 11gR2 client for my x86 (32-bit) machine, and I want to use it with Python 3.2, so here I download the line labeled CentOS 5 i386 RPM (Oracle 11g, Python 3.2)  Make sure NOT to download the Unicode version unless you know for sure you need it.  Download the version for the version of Oracle and Python that you plan on using.  Usually, regardless of the version of Oracle you plan on using, downloading the latest version will work with any of the older versions of Oracle.

After downloading we use alien again to created a debian package.

sudo alien -d cx_Oracle-5.1-11g-py32-1.i386.rpm
sudo dpkg -i cx-oracle_5.1-2_i386.deb

The way our debian installs cx_Oracle isn't quite what Ubuntu needs, so run the following command to set things right.

cd /usr/lib/python3.2
sudo mv site-packages/cx_Oracle* dist-packages/
sudo rmdir site-packages/
sudo ln -s dist-packages site-packages

If the dist-packages folder does not already exist, you may need to run the following.

sudo mkdir dist-packages

Now you should be able to import the cx_Oracle module into Python and start creating connection.

david@fink:/usr/lib/python3.2$ python3.2
Python 3.2 (r32:88445, Mar 25 2011, 19:28:28) 
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cx_Oracle

Profit!

Friday, March 18, 2011

Connect to MySQL database from LibreOffice Base on Ubuntu

LibreOffice's Base program can provide a quick easy way to access a MySQL database and write some reports against data.  The following outlines how to easily setup LibreOffice Base to connect to MySQL.  It assumes that you already have LibreOffice Base installed.  It works just as easily for OpenOffice Base.

First we need to install the JDBC driver for MySQL
sudo apt-get install libmysql-java
Next open up any LibreOffice program and then click on Tools->Options.  Expand LibreOffice and then click on Java.  Click on the Class Path button on the right followed by Add Archive.  Browse to /usr/share/java/mysql-connector-java.jar  Click Ok and choose to restart LibreOffice.

Now open LibreOffice Base and choose to Connect to an existing database.  In the drop-down menu choose MySQL, and connect using JDBC.  Click on the Test class button to make sure the JDBC driver loads successfully.  If it doesn't, then check that you followed the previous steps properly.  If it does load then simply enter the settings as it relates to your MySQL database.

If you get the JDBC driver to load properly, but you cannot connect to your MySQL database, then I would recommend installing the mysql client and making sure you can connect from the MySQL client first.  If the JDBC driver loads properly, and you can connect to your database with the MySQL database, then you should not have any problem connecting with LibreOffice.

Sunday, March 6, 2011

Installing Oracle 11gR2 on Ubuntu 10.04 Lucid Lynx 32-bit

I did this install in a virtual machine, which I would strongly suggest you do first before doing it on a physical install that you intend to use.
Start off by logging in as the user you created during the install.  This user should have sudo powers.  First we need to install the libraries needed.
sudo apt-get install unzip build-essential x11-utils rpm ksh lsb-rpm libaio1
Ubuntu 10.04 comes with libstdc++6, but we need libstdc++5_3.3.6.  Browse to http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-3.3/ and find the latest version.  When I wrote this it was 5_3.3.6-21.  Let's download and install it.
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-3.3/libstdc++5_3.3.6-21ubuntu1_i386.deb
dpkg-deb -x libstdc++5_3.3.6-21ubuntu1_i386.deb ia32-libs
sudo cp ia32-libs/usr/lib/libstdc++.so.5.0.7 /usr/lib/
sudo ln -s /usr/lib/libstdc++.so.5.0.7 /usr/lib/libstdc++.so.5
Next, we need to setup the oracle users and groups.
sudo addgroup oinstall
sudo addgroup dba
sudo useradd -g oinstall -G dba -p password -d /home/oracle -s /bin/bash oracle
sudo mkdir /home/oracle
sudo chown -R oracle:dba /home/oracle
sudo ln -s /usr/bin/awk /bin/awk
sudo ln -s /usr/bin/rpm /bin/rpm
sudo ln -s /usr/bin/basename /bin/basename
sudo mkdir /etc/rc.d
for i in 0 1 2 3 4 5 6 S ; do sudo ln -s /etc/rc$i.d /etc/rc.d/rc$i.d ; done
sudo mkdir -p /u01/app/oracle
sudo chown -R oracle:dba /u01
Various configuration files need to be modified.  Next we back up the original configuration file and add the configurations.

sudo cp /etc/sysctl.conf /etc/sysctl.conf.bak
echo 'fs.file-max = 6815744
fs.aio-max-nr = 1048576
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 1048576
net.core.wmem_max = 1048576
net.ipv4.ip_local_port_range = 9000 65535
' | sudo tee -a /etc/sysctl.conf > /dev/null
sudo cp /etc/security/limits.conf /etc/security/limits.conf.bak
echo 'oracle soft nproc 2047
oracle hard nproc 16383
oracle soft nofile 1023
oracle hard nofile 65535' | sudo tee -a /etc/security/limits.conf > /dev/null
sudo sysctl -p

Now it is time to log out, and then log back in as our new oracle user.  As the oracle user download the software from oracle.com  You should be able to find it at http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
Open a terminal and change into the directory where you downloaded both files.  And then run the following to unzip and run the installer.

unzip linux_11gR2_database_1of2.zip
unzip linux_11gR2_database_2of2.zip
cd database
./runInstaller
From here it is up to you which options you want to choose.  I used all the defaults and supplied 'password' for my passwords, since it is just a test install.
Last, we just need to setup our system paths.

sudo echo '
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_SID=orcl
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$PATH
export EDITOR=/usr/bin/vi' >> /etc/profile
Your install is ready to go.  You should be able to log in with sqlplus, or any other IDE you want to use, based on the setup you chose during the install.
Now, we need Oracle to start up on each reboot.  To do this we need to create an init script.  As root, create a file at /etc/init.d/oracledb with the following contents.

#!/bin/bash
#
# /etc/init.d/oracledb
#
# Run-level Startup script for the Oracle Listener and Instances
# It relies on the information on /etc/oratab
# these are the paths for our base installation
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.1.0/dbhome_1
export ORACLE_OWNR=oracle
export PATH=$PATH:$ORACLE_HOME/bin
if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
then
    echo "Oracle startup: cannot start"
    exit 1
fi
case "$1" in
    start)
        # Oracle listener and instance startup
        echo -n "Starting Oracle: "
        su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"
        su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
        touch /var/lock/oracle
        echo "OK"
        ;;
    stop)
        # Oracle listener and instance shutdown
        echo -n "Shutdown Oracle: "
        su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"
        su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
        rm -f /var/lock/oracle
        echo "OK"
        ;;
    reload|restart)
        $0 stop
        $0 start
        ;;
    *)
        echo "Usage: `basename $0` start|stop|restart|reload"
        exit 1
esac
exit 0

Now we need to make it bootable and tell Ubuntu to run it on bootup.

sudo chmod a+x /etc/init.d/oracledbsudo update-rc.d oracledb default
Use dbca to create and manage databases, and use netca to create and manage listeners.

Saturday, March 5, 2011

Aurora's first manga

Today we went to Borders so Aurora could spend a gift card she got for there.  I picked up a Python book and thumbed through it for a while.  Then Kim needed me to watch Aurora because she wanted to go look at books in places other than the kids section, where Athena and Arianna wanted to hang out.
Aurora had already picked out a book, but was still looking around.  We went over to the history section for a while a checked out what was in store there, and then started heading back to the kids section.
On our way back we ran into the manga section, and I made a comment to Aurora about how I'd like for her to try manga to see if she liked it.  She started talking about putting her book back and I told her that she needs the book she wants to buy, not the one I want her to buy.
She asked me what manga was about, so I randomly picked up a book that looked like it may be something in her area and showed her the first page.  I showed her how the first page is what we normally think of as the last page.  I then put the book back and started looking for something that I thought was closer to what she may like when she asked me for that same book back.  I explained it was just a book I randomly selected, not necessarily anything I thought she would like.
While I looked around she thumbed through the book and declared she wanted to put her other book back and get the one I had shown her.  It is called Neko Ramen.  It is about a cat named Taisho who owns a Ramen shop and comes up with ridiculous ideas about how he can sell Ramen, such as using spaghetti noodles and calling it Italian Ramen.
I double checked she really wanted to get this book I just randomly grabbed off the shelf instead of the one she had already picked out.  She assured me she was, so she ended up buying it.
On the way home she read through the book and thought it was really funny.  She thought it was really weird how the excited faces look.  I explained that it is part of the manga art style.  It took us both a while to realise that you ride from top-right, down, then move to the top of the next panel to the left.  We started off thinking you started at the top-right, moved left, and then down, until we realised why the panels sometimes made no sense.
I hope Aurora takes to this manga thing.  Aurora and I have didn't interests in books.  She likes non-fiction and historical fiction type books.  I prefer science fiction and fantasy.
I have been able to get her into the Narnia series.  We have finished The Magician's Nephew and The Lion, the Witch, and the Wardrobe.  At first she did not like The Magician's Nephew, but she gave it a second shot and started to get into it.  We are presently taking a break from the Narnia series and reading James and the Giant Peach.
So, if this trend continues, Aurora and I will have more things to do together.  Plus, it has been nice reading good children's books that I would otherwise not put any interest into.
As for me, I'm reading a chapter a day of an eleven-hundred plus page book on programming in Python, which is followed by another Python book that covers more advanced topics on the language and is equally as large.  Fun times.

Tuesday, February 22, 2011

Rebuilding invalid indexes in Oracle

I wrote many moons ago a post on finding invalid indexes in an Oracle database.  I have since written a script to go through all the invalid indexes and attempt to rebuild them, going down to the partition or subpartition level.  I have used this script many times and it appears to work as advertised.
It uses the all_indexes, all_ind_partitions, and all_ind_subpartitions so that it can interrogate all indexes it has permissions to view.  It will attempt to rebuild the invalid indexes, and will report on any indexes it could see, but not rebuild.  If run as a DBA account, it should be able to rebuild all invalid indexes in the system.

DECLARE

schema_name all_tab_partitions.table_owner%TYPE;
table_name all_tab_partitions.table_name%TYPE;
index_partition_name all_tab_partitions.partition_name%TYPE;

CURSOR invalid_indexes IS
SELECT owner,
index_name,
table_owner,
table_name,
status,
partitioned
FROM all_indexes
WHERE owner NOT IN ('SYS', 'SYSTEM')
AND status != 'VALID'
AND
(
status != 'N/A'
OR index_name IN
(
SELECT index_name
FROM all_ind_partitions
WHERE status != 'USABLE'
AND
(
status != 'N/A'
OR index_name IN
(
SELECT index_name
FROM all_ind_subpartitions
WHERE status != 'USABLE'
)
)
)
);

CURSOR tab_partitions IS
SELECT partition_name,
subpartition_count
FROM all_tab_partitions
WHERE table_owner = UPPER(schema_name)
AND table_name = UPPER(table_name);

CURSOR tab_subpartitions IS
SELECT subpartition_name
FROM user_ind_subpartitions
WHERE partition_name = index_partition_name;

successful_rebuilds NUMBER := 0;
unsuccessful_rebuilds NUMBER := 0;

BEGIN

FOR invalid_index IN invalid_indexes
LOOP
DBMS_OUTPUT.PUT_LINE('Rebuilding ' || invalid_index.owner || '.' || invalid_index.index_name);
IF invalid_index.partitioned = 'NO' THEN
BEGIN
EXECUTE IMMEDIATE('ALTER INDEX ' || invalid_index.owner || '.' || invalid_index.index_name || ' REBUILD');
successful_rebuilds := successful_rebuilds + 1;
EXCEPTION
WHEN OTHERS THEN
unsuccessful_rebuilds := unsuccessful_rebuilds + 1;
DBMS_OUTPUT.PUT_LINE('Unable to rebuild ' || invalid_index.owner || '.' || invalid_index.index_name || '.  ' || SQLERRM);
END;
ELSE
schema_name := invalid_index.table_owner;
table_name := invalid_index.table_name;
FOR tab_partition IN tab_partitions
LOOP
IF tab_partition.subpartition_count = 0 THEN
BEGIN
EXECUTE IMMEDIATE('ALTER INDEX ' || invalid_index.owner || '.' || invalid_index.index_name || ' REBUILD PARTITION ' || tab_partition.partition_name || ' COMPUTE STATISTICS');
successful_rebuilds := successful_rebuilds + 1;
EXCEPTION
WHEN OTHERS THEN
unsuccessful_rebuilds := unsuccessful_rebuilds + 1;
DBMS_OUTPUT.PUT_LINE('Unable to rebuild ' || invalid_index.owner || '.' || invalid_index.index_name || ', for partition ' || tab_partition.partition_name || '.  ' || SQLERRM);
END;
ELSE
index_partition_name := tab_partition.partition_name;
FOR tab_subpartition IN tab_subpartitions
LOOP
BEGIN
EXECUTE IMMEDIATE('ALTER INDEX ' || invalid_index.owner || '.' || invalid_index.index_name || ' REBUILD SUBPARTITION ' || tab_subpartition.subpartition_name);
successful_rebuilds := successful_rebuilds + 1;
EXCEPTION
WHEN OTHERS THEN
unsuccessful_rebuilds := unsuccessful_rebuilds + 1;
DBMS_OUTPUT.PUT_LINE('Unable to rebuild ' || invalid_index.owner || '.' || invalid_index.index_name || ', for subpartition ' || tab_subpartition.subpartition_name || '.  ' || SQLERRM);
END;
END LOOP;
END IF;
END LOOP;
END IF;
END LOOP;

DBMS_OUTPUT.PUT_LINE(successful_rebuilds || ' indexes successfully rebuilt.');
DBMS_OUTPUT.PUT_LINE(unsuccessful_rebuilds || ' indexes could not be rebuilt.');

END;

Friday, January 7, 2011

How to sync your Facebook calendar to Evolution

It looks like Facebook provides some very weak, but better than nothing, webcal support, that can be used to have your Facebook events show up in Evolution, and thus, on your Ubuntu desktop calendar.

  1. Log in to Facebook and then browse to http://www.facebook.com/?sk=events
  2. At the bottom, find the links that says, "Export Events"
  3. Right-click the webcal link and copy the link address.
  4. In Evolution, go to the Calendar section.
  5. Click on New->Calendar.
  6. Under Type, choose On The Web.
  7. Paste the link you copied from Facebook into the URL field.
  8. Give the calendar a name, like "Facebook", and put your Facebook username in the Username field.
  9. Click OK and then supply your Facebook password when prompted.
  10. Profit.
This webcal is read only, so you cannot add Facebook events through Evolution, and invites won't be synched back to Facebook either.

Thursday, December 16, 2010

How to compile mame in Ubuntu 10.04 Lucid Lynx

UPDATE: A newer guide is available at Compiling Mame on Ubuntu 14.04 Trusty Tahr.

Using the following instructions you should be able to compile Mame on Ubuntu 10.04 Lucid Lynx, though it should also work in most any other version of Ubuntu too.
  1. Download the latest source from http://mamedev.org/release.html Grab the .zip version. The following command will grab the latest source as of the time I wrote this tutorial.
    wget http://mamedev.org/downloader.php?file=releases/mame0140s.zip --user-agent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6" -O mame_source.zip
    Here we change the user/agent string, because the server is set to prevent robots, like wget, from programmatically downloading the file.
  2. Unzip the file, and then unzip that file. Place it anywhere you like, perhaps your home directory.
    mkdir mame
    unzip mame_source.zip
    unzip mame.zip -d mame
    rm mame.zip
  3. Next we install all the libraries and dependencies necessary to build mame.
    sudo aptitude install build-essential libgtk2.0-dev libgnome2-dev libsdl1.2-dev
  4. Finally, lets get to building it.
    cd mame
    make
  5. Let's setup a rom folder and get some roms.
    mkdir roms
    cd roms
    wget http://mamedev.org/roms/sidetrac/sidetrac.zip --user-agent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"
  6. Now that we have legally obtained an arcade ROM, let's play it!
    cd ..

Once you know what libraries to install, compiling Mame from source is quite easy in Ubuntu. Drop me a line in the comments if this is helpful, or if you run into any problems or have any suggestions.

Ubuntu Up and Running Book Review

Note: This is a review of the O'Reilly book Ubuntu: Up and Running.  I received this book through O'Reilly's Blogger Review Program.  When I received this book I was already in the middle of Machine of Death, and JavaScript: The Definitive Guide.  So it took me a little longer than I expected to finish this book, and finally, get around to writing this review.
This book touts itself as "A Power User's Desktop Guide."  This rather accurately defines the target audience of the book.  It is not for your average user, but for a technically inclined user who is interested in getting his or her hands dirty with Ubuntu.
This book is very thorough, going step-by-step through each process, often times in what can be grueling detail for someone if such detail is not necessary.  I committed myself to not skipping any parts, and that made some parts of this book very hard to read, as it went through each and every single little click to perform certain tasks.  However, this attention to detail and verbosity probably makes this a very good read for the person who needs to be taken all the way to the finish line to understand the concepts being taught in this book.  This level of detail also makes it a good read for those who may not consider themselves all that technical literate, but are willing to put in the time and effort needed to really learn Ubuntu.  The first chapter of the book introduces the reader to Ubuntu, Linux, and the whole FOSS movement.  It lets the reader know that Ubuntu is more than just an operating system, but it is the leader in a movement that has been fighting the good fight for over thirty years.  After finishing this chapter, the reader should have a good idea of common open source idioms, such as free as in beer versus free as in freedom, and be familiar with some of the leaders in the open source movement including RMS, Torvalds, and Shuttleworth.
With the history out of the way, the second chapter goes into installing Ubuntu.  Here the level of detail this book goes through is revealed.  Installing Ubuntu is a trivial task.  I've given disks to non-technical people, and they where able to get Ubuntu installed without any hand-holding.  However, this book doesn't just cover a vanilla install.  It covers dual-booting, an installing in VirtualBox, and installing through Wubi, as well as upgrading from a previous version.
For each type of install, this book goes step-by-step, screen-by-screen, explaining everything along the way.
I did feel that this book should have stressed the advantages of doing a real hard-disk install over a Wubi or virtual installation.  In my experience the other types of installations provide a significantly reduced experience over a real HD install.
I also felt like there where some areas covered that where really unnecessary, and could give the impression that Ubuntu may be harder to get up and running than it really does.  This includes going over the different Function Key Options.  I feel that for the sake of brevity, and being relevant, these areas could be skipped.  A person who is likely to use these areas of the installer is unlikely to need this book anyhow.
The book then moves on to configuring your installation, and then covers areas of use such as chapters devoted to multimedia, OpenOffice, etc.  I did feel that the order of chapters could have been laid out better.
After getting the user to install Ubuntu, it probably would have been best to have an introduction to the desktop, going over the basic features of the Gnome interface, including the Menu Bar, the different widgets in the top-right, and the default folders in the home folder.  This would make the user comfortable with the basics of Gnome, and would encourage the user to discover the other features, such as web browsing, multimedia, etc. on their own.
I believe Chapter 7, which covers the command line, should have been moved to the back.  It makes more sense, I believe, to cover all the tools that have been developed so that Linux users no longer have to master the command line to perform your usual tasks.  This could help dispel the fear that many users come in with, that if they don't master the command line, then Linux is not for them.
While the true power-user, be they a Linux user, or otherwise, will spend a good deal of time on the command-line, I think it is important to stress to new users that the most important tasks can be performed through point-and-click.
It also would have been helpful if this book had waited for Ubuntu 10.04 to come out, and spent more time focusing on the features of 10.04, since it is an LTS release, and would make this book more relevant over the next three years that this version of Ubuntu will be supported.  10.04 also alleviates some of the problems this book mentions such as the immaturity of the Empathy IM client in Ubuntu 9.10, making the suggestion of trying Pidgin somewhat more mute.  It could have also covered in better the Ubuntu One music store, if it had spent more time focusing on Ubuntu 10.04.  While this book says that it covers Ubuntu 9.10 and 10.04, it really covers 9.10, with some mentions of 10.04 enhancements.
With all that said, I would stay give this a book a "would recommend" as it is very detailed, and can go a long way in taking the interested reader from being interested in Ubuntu, to reasonably well versed in Ubuntu.
The chapter covering the command line is thorough and clear.  In fact, I learned a few things that I didn't about using some CLI tools installed in Ubuntu.
I look forward to future versions of this book covering newer versions of Ubuntu, and hopefully, through the Blogger Review program, is touched up in some of its rough edges.
I already have some friends and acquaintances lined up to borrow this book, as they have an interest in getting their feet a little more wet with Ubuntu.

Monday, November 1, 2010

Introducing Git-Notifier

This evening I finished the preliminary base code for a project I have been working on called Git-Notifier.  Inspired by Gitifer for OSX, Git-Notifier provides pop-up notifications for updates of a remote git repository using libnotify in Ubuntu.
As it stands, the program is currently a bash script, and configuration is a manual process.
To get started, download the come from http://github.com/maxolasersquad/Git-Notifier/archives/v0.1 in either tar.gz or .zip format.  Extract the .gitnotifier folder to your home directory.  Extract the gitnotify.sh file to wherever you would like to execute it from.  I keep this file in my home directory as well.
Next cd into the ~/.gitnotify directory and clone the remote repository using the -n switch.  For example, to get notified of updates to the Git-Notifier application, do the following
cd ~/.gitnotify
git clone -n git://github.com/maxolasersquad/Git-Notifier.git
Finally, edit the file ~/.gitnotify/gitnotify.ini file.  To the right of repos=, list out each git project you have cloned.  Using the same example from above, the line would look like this.
repos=Git-Notifier
If you have cloned any more repositories, simply list them all in the repos line, separated by a space.
Finally you can change how often the program looks for updates, and the pretty style to display the results. To see the different options for the pretty styel, run man git show.
Once you have cloned the directories you want, with the -n switch, and you have configured the ini file appropriately, simply run the gitnotify.sh script.  As commits are made to the remote repository, you should get notifications on your deskop.
The code could probably use some love, and a few more features would be nice as well.  Once I am happy with how this script works, I'd like to port it over to python.  I'd also like to have better support for non-Ubuntu flavors of Linux, though I'm not sure what other notifications are out there that can be easily programmed from Bash.
Any bugs, fixes, improvements, etc. would be appreciated on the github site.