Showing posts with label technology. Show all posts
Showing posts with label technology. Show all posts

Monday, July 1, 2013

Installing Minecraft 1.6 on Ubuntu

I had previously blogged about Installing Minecraft on Ubuntu. As of Minecraft version 1.6 these instructions no longer work because of a newly introduced launcher. The following is updates instructions for version of Minecraft 1.6 and above.

First we need to install Java. The website claims it needs Oracle Java, but the open source Java in the Ubuntu repos works just fine in my experience.
sudo apt-get install openjdk-7-jre
Now we need the launcher
sudo wget https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.jar -O /usr/games/Minecraft.jar
sudo chown root:games /usr/games/Minecraft.jar
sudo chmod 755 /usr/games/Minecraft.jar
Change the vi part in the next section to gedit if you want a graphical text editor.
sudo vi /usr/games/minecraft
The file contents should be as follows.
#!/bin/bash
java -jar /usr/games/Minecraft.jar
And then set the proper permissions on the file
sudo chown root:games /usr/games/minecraft
sudo chmod 755 /usr/games/minecraft
Again, change vi with something else if that is easier for you.
sudo vi /usr/share/applications/minecraft.desktop
And put this in the file.
[Desktop Entry]
Name=Minecraft
Comment=Build your own world
Exec=minecraft
Icon=minecraft
Terminal=false
Type=Application
Categories=GNOME;Applications;Game
Keywords=minecraft;Game
StartupNotify=true
The last piece we need is an icon. There are many good Minecraft icons at http://www.rw-designer.com/icon-detail/5547 I like http://www.rw-designer.com/icon-image/5547-256x256x32.png as it gives us the highest resolution available. Replace the URL of the icon you prefer to use in the following command.
sudo wget http://www.rw-designer.com/icon-image/5547-256x256x32.png -O /usr/share/pixmaps/minecraft.png
Now you should be able to play Minecraft by simply typing minecraft in the command-line, in the Unity dash, the KDE prompt, or by browsing to the games menu in the applications menu in your desktop environment of choice. It is also available to all users of your desktop.

You also do not need to do anything to update. Minecraft updates itself each time you start it.

BONUS

I've got one more neat trick up my sleeve. If a CraftBuntu spin sounds good to you, here's how you can setup Ubuntu to just run Minecraft when you sign in. It assumes you have already done the above.
sudo cp /usr/share/applications/minecraft.desktop /usr/share/xsessions/
Now Minecraft is an available option when you select your desktop environment. This works best if you set Fullscreen in the Minecraft options.

You could do a number of things with this setup. You could setup a minimal Ubuntu installation that has no desktop environment, or other desktop-related software installed. You could also allow guests to play Minecraft without touching any of your stuff by them selecting the Ubuntu guest account and setting Minecraft for the login. I have even found that on my struggling laptop this setup allows Minecraft to run more smoothly as there is no other desktop cruft running in the background.


UPGRADING FROM 1.5

If you had already followed my instructions back in the days before 1.6, the following will get you updated to 1.6
sudo rm /usr/games/minecraft.jar
sudo wget 
https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.jar -O /usr/games/Minecraft.jar
sudo chown root:games /usr/games/Minecraft.jar
sudo chmod 755 /usr/games/Minecraft.jar
Change the vi part in the next section to gedit if you want a graphical text editor.
sudo vi /usr/games/minecraft

The file contents should be as follows.

#!/bin/bash
java -jar /usr/games/Minecraft.jar

Thursday, January 17, 2013

Installing Minecraft on Ubuntu

UPDATE: As of Minecraft 1.6 these instructions no longer work. I have posted updated instructions at Installing Minecraft 1.6 on Ubuntu.

This post is for anyone who wants to install Minecraft on Ubuntu and have it feel like any other game installed via the Ubuntu Software Center. It assumes you have already purchased Minecraft and provides full Unity integration, though Unity is not needed for this to work. In fact, I suspect it should work for any Linux distribution that has a desktop environment.

We are going to do this via the command-line because copy-and-pasting commands from this tutorial is easier and more fool-proof than following a long list of screen shots. It's also easier for me to write it that way as there are fewer steps.

First we need to install Java. The website claims it needs Sun Java, but the open source Java in the Ubuntu repos works just fine in my experience.
sudo apt-get install openjdk-7-jre
Now we need the actual game
sudo wget https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft.jar -o /usr/games/minecraft.jar
sudo chown root:games /usr/games/minecraft.jar
sudo chmod 755 /usr/games/minecraft.jar
Change the vi part in the next section to gedit if you want a graphical text editor.
sudo vi /usr/games/minecraft
The file contents should be as follows.
java -Xmx1024M -Xms512M -cp /usr/games/minecraft.jar net.minecraft.LauncherFrame
And then set the proper permissions on the file
sudo chown root:games /usr/games/minecraft
sudo chmod 755 minecraft
Again, change vi with something else if that is easier for you.
sudo vi /usr/share/applications/minecraft.desktop
And put this in the file.
[Desktop Entry]
Name=Minecraft
Comment=Build your own world
Exec=minecraft
Icon=minecraft
Terminal=false
Type=Application
Categories=GNOME;Applications;Game
Keywords=minecraft;Game
StartupNotify=true
The last piece we need is an icon. There are many good Minecraft icons at http://www.rw-designer.com/icon-detail/5547 I like http://www.rw-designer.com/icon-image/5547-256x256x32.png as it gives us the highest resolution available. Replace the URL of the icon you prefer to use in the following command.
sudo wget http://www.rw-designer.com/icon-image/5547-256x256x32.png -o /usr/share/pixmaps/minecraft.png
Now you should be able to play Minecraft by simply typing minecraft in the command-line, in the Unity dash, the KDE prompt, or by browsing to the games menu in the applications menu in your desktop environment of choice. It is also available to all users of your desktop.

You also do not need to do anything to update. Minecraft updates itself each time you start it.

BONUS

I've got one more neat trick up my sleeve. If a CraftBuntu spin sounds good to you, here's how you can setup Ubuntu to just run Minecraft when you sign in. It assumes you have already done the above.
sudo cp /usr/share/applications/minecraft.desktop /usr/share/xsessions/
Now Minecraft is an available option when you select your desktop environment. This works best if you set Fullscreen in the Minecraft options.

You could do a number of things with this setup. You could setup a minimal Ubuntu installation that has no desktop environment, or other desktop-related software installed. You could also allow guests to play Minecraft without touching any of your stuff by them selecting the Ubuntu guest account and setting Minecraft for the login. I have even found that on my struggling laptop this setup allows Minecraft to run more smoothly as there is no other desktop cruft running in the background.

Tuesday, May 29, 2012

ssdownloader

I recently purchased some electronic media from Simon & Schuster.

Apparently the technology guys at Simon & Schuster believe in "Java Over Functionality." Unlike most companies that sell DRM-free digital media, I was not given a link to download zip file containing the contents of my purchase.

Instead, I was given a JNLP file, which is nothing more than an XML file. A little Googling revealed that these files should be openable by javaws, a Java Web Starter application. After getting the file to successfully run, I was greeted with a custom download manager. This is great because why offer a simple download that will be managed with my browser's download manager when I can have some half-rate, custom download manager to fudge things up?

So the download manager asked me where I would like to save the file, downloaded each file individually for about twenty minutes, and then told me it was done. There was a big problem, my files where not in the location I specified. In fact, a hard drive search revealed they didn't exist anywhere on my machine.

I tried again, no dice.

So, if Mother Necessity if the driver of invention, then welcome her new baby, ssdownloader. I wrote this Python app up in a little over an hour. It was a good chance to strengthen my weak command of Python, and to actually get the stuff I paid for.

It simply parses the JNLP file to find the other XML file that defines where the actual downloads are. It then loops through that file, grabbing each file and saving it locally. If anyone out there gets frustrated trying to make good on their Simon & Schuster purchases, feel free to use this to make your life happy.

Tuesday, January 10, 2012

Copy and paste from the system clipboard with vim

Often, when using vim, highlighting text in the terminal to copy-and-paste it around is plausible.  This is definitely true when on a true terminal.  I use the rnu option so that I have relative line numbers on each line.  So copying multiple lines with the mouse grabs the line number with unwanted indentation.  When I need to move code around it is annoying to have to manually remove the numbers.

To understand how to get vim's clipboard to match your system's you need to understand vim registers.  On a computer we usually only get one clipboard.  Every time we ctrl-c, the contents of the clipboard are discarded and replaced with whatever is highlighted.  We don't have any option to copy multiple objects and then paste them around.  However vim has multiple "registers" where text can be copied and pasted from.  To see the registers type :reg in command mode.

The register that we are interested in is register +.  To test it out, copy some text from another application then run :reg and see the contents displayed in register +.

So now we just need to know how to access the contents of register +.  Register access is done with ".  To paste from they keyboard we type "+p  To copy, for example an entire line, into the system clipboard we type "+yy  To delete the current line and store it in the system clipboard we type "+dd

We can also use registers with visual mode.  If we wanted to copy the line underneath the cursor we would type V"+y  We could copy the next three lines into the system clipboard by typing Vjj"+y

To sum it up, to use the system clipboard to copy and paste in vim simply do what you would usually do in vim, then prepend "+ to your y (yank) or p (paste) command.

Update:
Depending on the version of vim you are using, the register for the clipboard may work differently. In some cases the * and + registers are the same register. If you want to find out which register is for your system clipboard, simply copy some text from anywhere into your clipboard, then run :reg. Whichever register has the text you copied is the register that holds the contents of your clipboard.

Saturday, August 6, 2011

Fix flickering in Boxee with ATI graphics card

I recently installed Boxee on a new computer I got for my daughter.  It was running Ubuntu 11.04 and I used this fix to get it to install.  Unfortunately, like many in the comments section of the fix blog post, was getting too much flickering in the application to be able to use it.  It took me a little Googling, but I finally found a fix after following a link that suggested I follow another link, which finally took me to instructions that hinted at how to fix it.  Apparently the problem exists when using an ATI card with the open source driver and Compiz enabled, but don't quote me on that.
To fix it, one simply needs to turn off vsync.  To do this open up the guisettings.xml configuration file and change vsync from 2 to 0.
First, lets backup the file.
cp ~/.boxee/UserData/guisettings.xml ~/.boxee/UserData/guisettings.xml.bak
Now we need to edit the file.  Run the first command to do it with a GUI, or the second to use vim.
gedit ~/.boxee/UserData/guisettings.xml
vi 
~/.boxee/UserData/guisettings.xml
Find vsync in this file and change the 2 to a 0, and save the file.  It should be line 551 in the file.  Lines 546  through 552 should look like this initially.   
    <videoscreen>
        <guicalibration></guicalibration>
        <resolution>11</resolution>
        <testpattern></testpattern>
        <testresolution></testresolution>
        <vsync>2</vsync>
    </videoscreen>
After the change they should look like this.
    <videoscreen>
        <guicalibration></guicalibration>
        <resolution>11</resolution>
        <testpattern></testpattern>
        <testresolution></testresolution>
        <vsync>0</vsync>
    </videoscreen>
Now if you start boxee it no longer flicker.

Sunday, July 10, 2011

Features needed in Thunderbird to replace Evolution

As most know by now, Ubuntu 11.10 is looking to replace the Evolution mail client with Mozilla Thunderbird.  Evolution has long been problematic.  I have found it to crash pretty often, fail to display mail messages, and just generally be quirky.  Over the last two years it has really shaped up a lot, but still remains pretty quirky as of Ubuntu 10.04 LTS.
To produce a quality Linux desktop, shipping a quirky e-mail client can be a turn off for many, and that's what's lead to talk about replacing Evolution with Thunderbird.  Despite it's problems, Evolution does many things right.  Syncing Evolution with your cloud services, especially Google services, is especially easy.  Evolution also comes with native Exchange support, with some exceptions.  The Exchange server must provide Webmail for the Exchange support to work.  However when it does work, users can send/receive e-mail, view and mail contacts, and integrate with their Exchange calendar, all in one application, almost as if they where using the Microsoft Outlook.  This can be a real savior for people like myself who run Ubuntu in a corporate environment deeply tied to Microsoft products.
All Calendar integration in Evolution comes with the benefit of desktop integration.  Any calendar configured in Evolution shows up in Gnome calendar panel, allowing the user to easily see what's scheduled without having to fire up Evolution.
All-in-all Evolution has a very solid feature set, and great usability and integration.  It's just those nasty quirks that pop-up from time to time that keep it back.  It seems to me that the best thing the Ubuntu community could do is go through the Evolution bug list and start applying some fixes.  A change of client seems rather drastic, but at this point, inevitable.
In this light, I have installed the Oneiric release client and kicked the Thunderbird tires.  Here's what I've seen so far.
Setting up Gmail is very easy.  I simply put in my Gmail login and password and that was it.  Thunderbird recognized the @gmail.com and did the rest of the configuration.  Evolution will auto-populate the Google server information, but Thunderbird doesn't even show you the server configuration options.  It simply notifies you it knows what to do from here and finishes.
After it downloaded all the message headers, I had one new e-mail, I received a desktop notification about the new e-mail.  However, Evolution also turns the mail notification icon in the menu green.  If you click on it, you will see the new e-mail in your inbox.  Thunderbird provided no such desktop integration.
Thunderbird does not include any sort of Calendar integration by default.  Instead, I had to manually install the Lightning plugin, which provides the calendar support.  However, this was not enough, as Lightning does not provide any remote calendar syncing.  To get Google Calendar support I had to install the "Provider for Google Calendar" plugin.
Even still, it was not as intuitive to setup Google Calendar support.  I had to log into Google Calendar in my browser to get the iCal URL of the calendar I wanted to support, and copy-and-paste this into Thunderbird.  With Evolution I simply provide my calendar credentials and it will give me a list of calendars in my Google Calendar account, and then syncs the one I selected.
Finally, the calenders do not integrate with the Gnome calendar.
I hope that 11.10 has the Lightning and Google Calendar plugins installed by default, but even still, this is a step backwards.  Showing people the tight integration between cloud calendar services and Ubuntu has been a point of impression for many users in my experience.
Next is the contact syncing.  Again, setting up Evolution to sync with your Google Contacts is very easy.  With Thunderbird I had to install the "Google Contacts" plugin.  After that I selected my existing Google account and my contacts where in Thunderbird.  I really liked that I didn't need to reenter my Google credentials.  This is a move forward from Evolution, and a feature I'd like to see replicated in the Google Calendar plugin.
Thunderbird has no Exchange support.  For those of us in a corporate environment, this is a loss.  If your Exchange server supports IMAP, one can still check their e-mail in Thunderbird, but there will be neither contact or calendar support.
Others thoughts.  Thunderbird does not store its connection information in Seahorse, leaving the connections unavailable to other applications that would like to integrate.  I don't think the icons are coming from the Gnome theme.  Minimizing to tray can be accomplished via an extension, but I'd like to see something similar to how Rhythmbox and Banshee can be minimized to the sound menu.  Neither of these are possible in Evolution either, so ...
So where does this leave us?  I believe we need to have the Lighting, Google Calendar, and Google Contacts plugins installed by default.  A custom plugin needs to be written to bring the Lightning calendars into the Gnome calendar menu.  This will bring most users into having all of their existing Evolution functionality in Thunderbird.  An Exchange plugin for Thunderbird should be started.  Thunderbird needs to be extended to act like an application that was written to be part of the Linux desktop, not an application that just happens to also run on the Linux desktop.
Finally, I wonder how much the mail client really matters.  I don't know many people who use thick mail clients.  Everyone seems to be happy using their providers webmail.  The only reason I use Evolution is to have an offline backup of my e-mail, and for the desktop notifications about new e-mail and calendar events.  When I receive these I then go to the webmail interface and respond accordingly.
I wonder what KDE users think about how it looks, feels, and integrates for them.

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.

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.

Wednesday, October 20, 2010

Migrating from subversion to git

At work we have been migrating from subversion to git.  The projects that we still have in subversion I check out using git-svn.  This allows me to use much of the git happiness while we make the transition.  It also performs another very nice function; it allows us to migrate our repositories to git keeping our full version control history.
What follows demonstrates, from a Linux machine, to migrate a repository from http://svn.foo.com/bar to ssh://git.foo.com/repos/bar.git.  This assumes you already have git, subversion, and git subversion installed.  It also assumes that you have read access to the subversion repository, and a git repository you have direct access to.

git svn clone http://svn.foo.com/bar/trunk bar

Next we need to log into the machine hosting our git repository.  We do this over ssh.

ssh foo.com
cd ~/repos
mkdir bar.git
cd bar.git
git init --bare

Back on our machine.

cd bar
git remote add origin ssh://git.foo.com/repos/bar.git
git push origin master

You should now have a central git repository at ssh://git.foo.com/repos/bar.git  You can create your branches, and do whatever git-style version controlling that you wish.  The final step, of course, is to remove the old subversion repository so that others do not accidentally make changes that never find themselves in the real copy of the code.
One limitation is that this process does not import any branches or tags from the subversion repository.  I'm not sure if there is a clean way to do this.

Thursday, October 14, 2010

Shuffling cards in PHP

The following demonstrates what I believe to be an efficient means of shuffling a deck of cards, using PHP.




$cards = array(array('suit'=>'Spade', 'rank'=>'01'), array('suit'=>'Spade', 'rank'=>'02'), array('suit'=>'Spade', 'rank'=>'03'), array('suit'=>'Spade', 'rank'=>'04'), array('suit'=>'Spade', 'rank'=>'05'), array('suit'=>'Spade', 'rank'=>'06'), array('suit'=>'Spade', 'rank'=>'07'), array('suit'=>'Spade', 'rank'=>'08'), array('suit'=>'Spade', 'rank'=>'09'), array('suit'=>'Spade', 'rank'=>'10'), array('suit'=>'Spade', 'rank'=>'11'), array('suit'=>'Spade', 'rank'=>'12'), array('suit'=>'Spade', 'rank'=>'13'), array('suit'=>'Spade', 'rank'=>'14'),
               array('suit'=>'Club', 'rank'=>'01'), array('suit'=>'Club', 'rank'=>'02'), array('suit'=>'Club', 'rank'=>'03'), array('suit'=>'Club', 'rank'=>'04'), array('suit'=>'Club', 'rank'=>'05'), array('suit'=>'Club', 'rank'=>'06'), array('suit'=>'Club', 'rank'=>'07'), array('suit'=>'Club', 'rank'=>'08'), array('suit'=>'Club', 'rank'=>'09'), array('suit'=>'Club', 'rank'=>'10'), array('suit'=>'Club', 'rank'=>'11'), array('suit'=>'Club', 'rank'=>'12'), array('suit'=>'Club', 'rank'=>'13'), array('suit'=>'Club', 'rank'=>'14'),
               array('suit'=>'Diamond', 'rank'=>'01'), array('suit'=>'Diamond', 'rank'=>'02'), array('suit'=>'Diamond', 'rank'=>'03'), array('suit'=>'Diamond', 'rank'=>'04'), array('suit'=>'Diamond', 'rank'=>'05'), array('suit'=>'Diamond', 'rank'=>'06'), array('suit'=>'Diamond', 'rank'=>'07'), array('suit'=>'Diamond', 'rank'=>'08'), array('suit'=>'Diamond', 'rank'=>'09'), array('suit'=>'Diamond', 'rank'=>'10'), array('suit'=>'Diamond', 'rank'=>'11'), array('suit'=>'Diamond', 'rank'=>'12'), array('suit'=>'Diamond', 'rank'=>'13'), array('suit'=>'Diamond', 'rank'=>'14'),
               array('suit'=>'Heart', 'rank'=>'01'), array('suit'=>'Heart', 'rank'=>'02'), array('suit'=>'Heart', 'rank'=>'03'), array('suit'=>'Heart', 'rank'=>'04'), array('suit'=>'Heart', 'rank'=>'05'), array('suit'=>'Heart', 'rank'=>'06'), array('suit'=>'Heart', 'rank'=>'07'), array('suit'=>'Heart', 'rank'=>'08'), array('suit'=>'Heart', 'rank'=>'09'), array('suit'=>'Heart', 'rank'=>'10'), array('suit'=>'Heart', 'rank'=>'11'), array('suit'=>'Heart', 'rank'=>'12'), array('suit'=>'Heart', 'rank'=>'13'), array('suit'=>'Heart', 'rank'=>'14'));
$shuffled_cards = array();
while (sizeof($cards) != 0)
{
  mt_srand((double)microtime()*1000000);
  $card = mt_rand(0, sizeof($cards) - 1);
  $shuffled_cards[] = $cards[$card];
  unset($cards[$card]);
  $cards = array_values($cards);
}
print_r($shuffled_cards);


We start by initializing our deck of fifty-two cards.  Each member of our array is an associative array holding the suit and rank of each card.  We then initialize a blank array where we will store our shuffled cards.
The while loop will execute until all of the cards have been popped out of our initial array.
At the beginning of each iteration we start a new pseudo-random seed.  Then, we get a random number between zero, and the number of cards we have left to shuffle, minus one (because arrays are zero indexed.)  Next, we append the randomly selected card to our shuffled array and remove it from our cards array.
When we remove a card from our numerically indexed array, the array becomes sparse.  So if the random number was four, then we are left with indexes one, two, three, five, six and so on.  If we hit four through another iteration, there would be no value to add to our shuffled array.
To make our array dense again, we can simply call the array_values function on our cards array and assign it back to cards.
This solution buys us a few niceties, compared to other solutions I have come across.  First, at any given time a card is only in one array (except the split moment that we are doing the move).  The second is that we don't have to worry about our random number being the same as a previously picked random number, and thus waste time picking another number until we hit a unique number.
Finally, this solution is really just an exercise in efficiently shuffling an array.  In a real application I would not use this solution at all.  PHP comes with a nice little function named, easy enough to remember, shuffle().  So let's take a look at how one should really implement the solution.


$cards = array(array('suit'=>'Spade', 'rank'=>'01'), array('suit'=>'Spade', 'rank'=>'02'), array('suit'=>'Spade', 'rank'=>'03'), array('suit'=>'Spade', 'rank'=>'04'), array('suit'=>'Spade', 'rank'=>'05'), array('suit'=>'Spade', 'rank'=>'06'), array('suit'=>'Spade', 'rank'=>'07'), array('suit'=>'Spade', 'rank'=>'08'), array('suit'=>'Spade', 'rank'=>'09'), array('suit'=>'Spade', 'rank'=>'10'), array('suit'=>'Spade', 'rank'=>'11'), array('suit'=>'Spade', 'rank'=>'12'), array('suit'=>'Spade', 'rank'=>'13'), array('suit'=>'Spade', 'rank'=>'14'),
               array('suit'=>'Club', 'rank'=>'01'), array('suit'=>'Club', 'rank'=>'02'), array('suit'=>'Club', 'rank'=>'03'), array('suit'=>'Club', 'rank'=>'04'), array('suit'=>'Club', 'rank'=>'05'), array('suit'=>'Club', 'rank'=>'06'), array('suit'=>'Club', 'rank'=>'07'), array('suit'=>'Club', 'rank'=>'08'), array('suit'=>'Club', 'rank'=>'09'), array('suit'=>'Club', 'rank'=>'10'), array('suit'=>'Club', 'rank'=>'11'), array('suit'=>'Club', 'rank'=>'12'), array('suit'=>'Club', 'rank'=>'13'), array('suit'=>'Club', 'rank'=>'14'),
               array('suit'=>'Diamond', 'rank'=>'01'), array('suit'=>'Diamond', 'rank'=>'02'), array('suit'=>'Diamond', 'rank'=>'03'), array('suit'=>'Diamond', 'rank'=>'04'), array('suit'=>'Diamond', 'rank'=>'05'), array('suit'=>'Diamond', 'rank'=>'06'), array('suit'=>'Diamond', 'rank'=>'07'), array('suit'=>'Diamond', 'rank'=>'08'), array('suit'=>'Diamond', 'rank'=>'09'), array('suit'=>'Diamond', 'rank'=>'10'), array('suit'=>'Diamond', 'rank'=>'11'), array('suit'=>'Diamond', 'rank'=>'12'), array('suit'=>'Diamond', 'rank'=>'13'), array('suit'=>'Diamond', 'rank'=>'14'),
               array('suit'=>'Heart', 'rank'=>'01'), array('suit'=>'Heart', 'rank'=>'02'), array('suit'=>'Heart', 'rank'=>'03'), array('suit'=>'Heart', 'rank'=>'04'), array('suit'=>'Heart', 'rank'=>'05'), array('suit'=>'Heart', 'rank'=>'06'), array('suit'=>'Heart', 'rank'=>'07'), array('suit'=>'Heart', 'rank'=>'08'), array('suit'=>'Heart', 'rank'=>'09'), array('suit'=>'Heart', 'rank'=>'10'), array('suit'=>'Heart', 'rank'=>'11'), array('suit'=>'Heart', 'rank'=>'12'), array('suit'=>'Heart', 'rank'=>'13'), array('suit'=>'Heart', 'rank'=>'14'));
shuffle($cards);
print_r($cards);

Sunday, October 3, 2010

Updating JOSM in Ubuntu

If you are a contributor to Open Street Map, and you run Ubuntu, then you probably use JOSM from time-to-time.  It has a lot of great tools that are not available in the online editor.  My favorite is the Orthogonalize Shape tool.
Anyhow, I got tired of being told to update each time I started the application.  Plus, I like being up to date.  Since Ubuntu only gets an updated version of JOSM with each new release of Ubuntu, I decided to find out how to cleanly update JOSM in a way that integrates well with the currently installed JOSM.  Here's what I did.

  1. Go to http://josm.openstreetmap.de/
  2. Under the Download section, click on the "tested JOSM" link and save it.
  3. Under a terminal run the following.
    sudo cp ~/Downloads/josm-tested.jar /usr/share/josm/
    cd /usr/share/josm/
    sudo ln -f -s josm-tested.jar josm.jar

  4. Change ~/Downloads/josm-test.jar to the location in which you saved the josm-tested.jar file.
Now when you run JOSM the way you always have, it will load the latest stable version of JOSM.
When you first start JOSM you should go ahead and update your plugins.
This was testing in Ubuntu Lucid 10.04, but should work with any version of Ubuntu, and with any version of JOSM.  If it doesn't for any reason, respond in the comments below.

Friday, September 3, 2010

Listing invalid indexes in Oracle

I have often seen it asked online many times how to get a list of invalid indexes. The information was mostly incomplete, and often contained misinformation. Determined to solve this problem once and for all I wrote a query to get a list of invalid indexes on our Oracle 10g database.

Before we get on to the query, I'd like to note what makes finding invalid indexes so difficult, and how to overcome these obstacles.

Finding invalid global indexes is rather easy. Global indexes are your standard indexes you use and love every day. They are simply an index on a column, or columns in a standard non-partitioned table. Oracle provides a nice little view called all_indexes, which has a column named status. This view will return a list of all indexes that the user running the query has permissions to view. There is also the dba_indexes view and the user_indexes view. The status column can be one of three values, VALID, INVALID, or N/A. Global indexes will never have a status of N/A.

We run into trouble if we try to query WHERE status != 'VALID' if our database has any partitioned tables with partitioned indexes and potentially bring back valid indexes. Partitioned tables, and their indexes, save the lives of millions of babies every year, so we must give them our full respect, and do the necessary extra work that is required to account for the quirks they sometimes bring to our code.

Partitioned indexes will always have a status of N/A in the all_indexes view. Each of these indexes will have a partitioned index, which we can see by querying the all_ind_partitions view. Again, we also have the dba_ind_partitions and user_ind_partitions views available to us as well. This table contains all partitioned indexes, along with a status column. This status column works a little bit differently. Its possible values are USABLE, UNUSABLE, and N/A.

If our index'es partitioned indexes are marked as usable then we know our index is valid. However, we could again run into a case where our status column is marked as N/A. Partitioned indexes can go a level deeper and have their own subpartitioned indexes. Determined, we pick up our shovel and keep digging deeper.

Oracle provides us with a third view named all_ind_subpartitions. Like the above views, we also have user_ind_subpartitions and dba_ind_subpartitions. Again, we have a status column. This time, though, we can only have two possible values, USABLE, and UNUSABLE. At this point, we can determine if our index is valid or not by looking at its partition's subpartition's status.


Okay, so this is all well and good, but what we really need is a query that will give us the name of indexes that need rebuilding. Global indexes do not have partitions, and not all partitioned indexes have subpartitions, yet we want to know all invalid indexes, regardless of their makeup. The following query accomplishes this.

select
 index_name
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'
          )
        )
    )
);

I'll leave dissecting how this query works as a lesson to the reader. Here I am also leaving out the indexes owned by SYS and SYSTEM, but you can remove that line if you need those indexes listed as well.


I do presently have an anonymous block that makes a cursor out of this query, loops through it, and builds all indexes, partitioned indexes, and subpartitioned indexes, as is appropriate. I am still working on making sure that it is battle hardened. After that I'll post about how I accomplish this. Combined they provide an elegant solution to finding all of your invalid indexes and rebuild them.

If you find this helpful, or have some additional information to provide, please do so in the comment section below.



Edit: The script is available at Rebuilding invalid indexes in Oracle