Checking Ubuntu Version Number via the Command Line
When creating dev and staging environments based on an existing production environment (I know, right) it is useful to get the version of Linux you are running. In Ububntu, just fire up your terminal and type:
lsb_release -a
This will output something similar to:
Distributor ID: Ubuntu Description: Ubuntu 9.10 Release: 9.10 Codename: karmic
Woot.
Install Drush on a Server You Don't Have Admin Rights To
I've been working with quite a few Drupal sites in the past couple years and recently one of my favorite tools to use has become drush. For those of you who aren't aware of it, drush is a command line utility (drush = DRUpal SHell) that makes management of a Drupal site much more bearable. Drush is a great tool to use and is quite simple to install on your system when you have admin rights to the box but what about those of us on shared hosting systems? For us, we have no admin rights but if you've picked a good hosting company, you'll have command line access and a .bashrc file (or similar e.g. bash_profile depending on your server distro).
Once you have command line access, create a directory on the server where you'll keep any programs you choose to install. I created a "bin" directory in my user's home.
mkdir bin
Once you've created that directory, use wget and the link to the latest drush version to download the tarball.
wget http://ftp.drupal.org/files/projects/drush-All-versions-3.0-beta1.tar.gz
Once it downloads, extract it.
tar xzvf drush-All-versions-3.0-beta1.tar.gz
cd into the newly created directory and make sure the drush* file is executable. If not,
chmod u+x drush
Now you have drush on your system but it would be quite cumbersome to have to type the full path to the executable as well as as the drush options. In order to alleviate this we have two choices: we can either export our PATH or setup an alias in our .bashrc file. I choose the latter, but I'll show you both options. First, however, you'll need to know the full path to the drush executable. Inside your ~/bin/drush directory, execute the following:
pwd
So your full path will be something like: /home/mysite/bin/drush/drush
Onto setting up the shortcuts to only have to type 'drush'
PATH option:
export PATH=$PATH:/home/mysite/bin/drush/drush
.bashrc option:
vi .bashrc
Inside the file, you'll add an alias (press 'i' to enter insert mode)
alias drush='/home/mysite/bin/drush/drush'
then save the file (type :wq)
The downside to using the .bashrc option, however, is that you'll have to start a new terminal session to begin using the alias (or type the same alias in the command line so you can use it this session then any other session you start it reads from the .bashrc). So exit then fire up your terminal again.
From here you can execute the entire suite of drush commands simply by using the word 'drush' followed by any drush options just like you would in a normal drush install.
To recap, simply:
- open a terminal on your server
- create a bin directory
- download and extract drush into the bin directory
- ensure drush is executable
- get the full path to the executable then either
- 1) add the full drush path to your PATH variable
- 2) alias drush to the full drush path and restart you terminal session
or
*note: instead of executing a pwd to get the path to your drush install, you could use ~/bin/drush/drush if indeed your bin is in your home directory but I think it's best practice to use full, human readable paths to alleviate any ambiguity.
PostgreSQL and MySQL: Comparing Licensing, Functionality, and Reliability
There is much debate about which open source database management systems (DBMS) is the best to use. For this paper, I will attempt to objectively compare the benefits of MySQL and PostgreSQL which are arguably two of the most widely adopted open source DBMS's. The scope of this paper is to compare the licensing, features, scalability, and reliability of the two DBMS's. While this paper is not intended to provide a complete analysis of all things MySQL and PostgreSQL, I will provide enough analysis of each DBMS to inform the reader of the particular advantages of using each system.
Each DBMS will be given and overall proportional amount of analysis in order to strike and objective balance but some sections may be lengthier than others if a particular topic is more well documented than another. In general, I have noticed that more data and conversations can be found concerning MySQL than there is for PostgreSQL but that is in no way a testament to its worth.
Ninja!Ninja!Ninja!Zombie!
Ninja!Ninja!Ninja!Zombie! from Steven Jackson on Vimeo.
The premise of the game is that you are the sole surviving Zombie and that it's your duty to once again reclaim the Earth in the name of Zombiedom but watch out for those deadly Ninjas!



You use the arrow keys to move about and the keyboard keys to set your settings. There are four setting levels: Easy, Medium, Hard, and Ludicrous. Easy gives you 5 lives, 1 initial Ninja to avoid, and requires 2 levels to win the game. Ludicrous is 1, 6, and 10. The rest, of course, fall in between.
I got the Zombie sprites from http://www.panelmonkey.org/. I drew the ninja and shrunk some brain I found on images.google.com. The background image is Disney World.
The sound is from http://www.freesound.org/.
My favorite part of the project was building the showScreen method in such a way that I could pass a title and an array of elements and it would build the screen. My least favorite part was figuring out how to implement the sound. Most of you know I don't care much for Java but in this case it was actually kind of fun.
I also programmed in a cheat code (type 'n' at the Title Screen). It reverses game play and story. Now you are a ninja and have to defeat zombies. There are zombie heads instead of brains. No frames of animation for the Ninja because 1) they are stealthy and 2) I am lazy.

Here are the links to all my files:
Source:
FINAL
ALL ITERATIONS
Video. You should be able to view the video in your browser. However, if you are using Windows, you may need to install the XVID codec. It plays fine for me in Ubuntu 9.10 and Fedora 11. To download the files instead of having them play in your browser, right-click the link and choose "Save Link As" or something to that effect depending on which browser you are using.
AVI
MPEG
I converted the video files from my JVC Everio .mod files using ffmpeg. THe embed is hosted by VIMEO.
Presentation:
ODP
Install Oracle 10g Express on Ubuntu
Brief overview:
- Download and Install the .deb
- Run sudo /etc/init.d/oracle-xe configure
- Run /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/./oracle_env.sh
- If language errors, edit the /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/nls_lang.sh file
- Add . /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh to your .bashrc
- Start a new terminal session
- sudo chmod 6755 oracle in the $ORACLE_HOME/bin directory
- sqlplus system
Now for the details!
=============
GUI SETUP
=============
First, download the 10g Express version that you require. If you are in a western, English speaking country then I recommend Oracle Database 10g Express Edition (Western European).
http://www.oracle.com/technology/software/products/database/xe/htdocs/102xelinsoft.html
You'll need to sign up for a free account with Oracle to download the software. After getting the package, install it via your favorite method. Double clicking the file works well enough for this application. Once the package is installed you'll see the Oracle software in Applications -> Oracle Database 10g Express Edition.
Unfortunately, the installer doesn't automatically setup the initial components and this is when I ended up combing through search engine results. The setup is really quite simple. Just fire up a terminal session and type:
sudo /etc/init.d/oracle-xe configure
You'll then be prompted for what ports to run the web client and database on as well as whether or not you want the database to run at boot. Most importantly (at least to me) this is where you setup the SYS/SYSTEM password.
Here's what my output looks like:
Oracle Database 10g Express Edition Configuration ------------------------------------------------- This will configure on-boot properties of Oracle Database 10g Express Edition. The following questions will determine whether the database should be starting upon system boot, the ports it will use, and the passwords that will be used for database accounts. Pressto accept the defaults. Ctrl-C will abort.
Specify the HTTP port that will be used for Oracle Application Express [8080]:
Specify a port that will be used for the database listener [1521]:
Specify a password to be used for database accounts. Note that the same password will be used for SYS and SYSTEM. Oracle recommends the use of different passwords for each database account. This can be done after initial configuration: Confirm the password:
Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]:y
Starting Oracle Net Listener...Done Configuring Database...Done Starting Oracle Database 10g Express Edition Instance...Done Installation Completed Successfully. To access the Database Home Page go to "http://127.0.0.1:8080/apex"
Sweet. Now I can connect to Oracle via the Web Client in Applications -> Oracle Database 10g Express Edition -> Go To Database Home Page or just bookmarking http://127.0.0.1:8080/apex
I already had apache installed and I don't know if it's required. If, for some reason, you can view the page, do a:
sudo apt-get install apache2
then (if apache isn't running)
sudo /etc/init.d/apache2 start
You can now login to the browser GUI and do what your need to do. Most of us want the next steps too.
===========
RUNNING VIA COMMAND LINE
===========
I have Oracle setup on one box and ssh into it so I need to run it command line to do it. SQLPLUS is used to access it but I ran into some problems. Here's how to fix it and get it running. First, trying to run sqlplus will generate errors:
sqlplus sys as sysdba sqlplus: command not found
It's already on your system but you need to run the oracle_env.sh script:
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/./oracle_env.sh /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/nls_lang.sh: 114: [[: not found /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/nls_lang.sh: 114: [[: not found
Bummer. I took out the if statements around line 114 (:set number in vi to view line numbers) and just left the line 'locale=$LANG' by doing:
sudo vi /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/nls_lang.sh
That fixed my language error and so I just reran
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/./oracle_env.sh
I also added . /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh to my .bashrc file.
Now when I try sqlplus sys as sysdba I get:
steven@MDW1003461:/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/bin$ sqlplus sys as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Nov 3 11:58:58 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Enter password: ERROR: ORA-09925: Unable to create audit trail file
GRRRRRR.
Further digging let me know I had to set the setuid bit on the Oracle executable.
So, close your terminal session then start a new one to load your environment variables. CD to $ORACLE_HOME (mine is /usr/lib/oracle/xe/app/oracle/product/10.2.0/server) then go into the bin directory and do a
sudo chmod 6755 oracle
Let's try to connect again:
sqlplus system
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Nov 3 12:13:12 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Enter password:
Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
SQL>
VOILA!
So, to recap:
- Download and Install the .deb
- Run sudo /etc/init.d/oracle-xe configure
- Run /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/./oracle_env.sh
- If language errors, edit the /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/nls_lang.sh file
- Add . /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh to your .bashrc
- Start a new terminal session
- sudo chmod 6755 oracle in the $ORACLE_HOME/bin directory
- sqlplus system
YOU'RE IN!
Superkill - A Quickie Script for Killing All Instances of an Application
steven 7885 1 0 09:57 ? 00:00:08 evolution --component=mail steven 7894 1 0 09:57 ? 00:00:00 /usr/lib/evolution/evolution-data-server-2.22 steven 7918 1 0 09:57 ? 00:00:00 /usr/lib/evolution/2.22/evolution-exchange-storage steven 7931 1 0 09:57 ? 00:00:00 /usr/lib/evolution/2.22/evolution-alarm-notify steven 11346 7715 0 11:12 pts/1 00:00:00 grep evoI then proceeded to kill each process manually. It's only 4 but it was enough to bring out my inner programmer and solve a repetitive task programatically. So I decided to add a couple more pipes. I looked at the results from the grep'd ps and noticed that all process IDs are in character slots 10-14 so I cut -c 10-14 the processes that were piped in. That printed out as expected so I fed that to kill via xargs and, voila!, all those processes were killed. Not content to have to type all the pipes every time I wanted to do it, I threw the pipe in a BASH script that I lovingly call 'superkill' and take the first argument as the string to grep and kill the returned processes. The code is below:
#!/bin/bash
prog=$1
#echo ${prog}
ps -ef | grep ${prog} | cut -c 10-14 | xargs kill
Simple enough but quite powerful. I then threw the script in my /usr/bin directory so my PATH would pick it up. Now I can just superkill evolution (sounds like a creationist book, I know) and have all the processes ended. Here is the file. Just extract it (tar xzvf superkill.tar.gz) and put the resulting file in your /usr/bin directory. Then superkill away!
Of course this code comes with no warranty and you assume all risks. Before you run the script you may want to call a ps -ef | grep <processname> before doing superkill <processname> so you make sure there are no unexpected results. I could echo the resulting process and ask for confirmation, I suppose. Hold for that version (depends if I get feedback it works well enough for my purposes).
Behavioral Advertising Sans Consent - An Open Letter to Congress
Good Day,
I'm a Computer Scientist in the 10th Congressional District of Georgia. A lobbying group will address Congress in the next few weeks to persuade our political leaders to pass legislation that would change the current preference of an opt-in policy for behavioral advertising to an opt-out version. This legislation would dangerously infringe on an individual's right to privacy.
The main issue with an opt-out behavioral advertising method is that it assumes the end user will have knowledge of the tracking software, and that they know how to opt-out of being followed. When will the user be notified that they are being tracked? Will the information be in some small print or in an absurdly long End User License Agreement (EULA)? What method does the end user take to opt-out? Is the opt-out guaranteed? And, most importantly, why is the burden place on the private citizen?
The practice of allowing companies to track private citizen's behavior without prior, explicit consent is reprehensible and irresponsible. What is the scope of the behavioral targeting i.e. where does the tracking begin and where does it end?
Behavioral advertising is industry-friendly language for spyware.
For individual companies perhaps the spyware will be limited to surfing habits within their own site e.g. a newspaper site user may view mostly sports statistics and rankings and the end user would be targeted with sports-based advertising. This, however, does not require behavioral advertising but rather can rely upon contextual advertising.
What is most likely is that the scope of the tracking will be across multiple sites and search engine queries. The user will be followed from site-to-site, trending their browsing habits: what they view and when, their navigation habits, what topics do they frequently search, etc. Upon capturing this citizen's data, companies will be able to deduce sex, age range, children they may have, pay scale, and many other private areas that the individual may not wish to disclose – a disclosure that is without knowledge or consent.
Behavioral advertising will be required to be put into practice and sold to other companies by very large corporations. The sheer amount of data collected per individual across an entire nation or even the world will require vast amounts of computing resources to process the behavioral targeting algorithms and store the resultant data sets. This would leave out any competition from smaller software businesses and instead requires the computing services of extremely large corporations like Google, Microsoft, and Yahoo!. These companies already form the largest search engine providers and internet advertising sellers. With the passing of opt-out based behavioral advertising spyware, these corporations (who already hold an exorbitant amount of power) will be able to effectively spy on private citizens in order to provide their corporate partners with a little bit of (perhaps) increased revenue.
Being a Computer Scientist requires me to think logically and pragmatically. As it currently stands, the benefits do not outweigh the cost. Private citizens' rights to privacy will be infringed upon in order to provide marketing that can be achieved with proper contextual advertising. The amount of data collected unwittingly from private citizens will be stored in vulnerable computer systems. The levels of security involved to protect this process is immense. No server architecture is invulnerable to corruption or attack and given that this spyware will likely be implemented using cookies on end-user machines -machines which are notoriously vulnerable- the tracking cookies will be very accessible to internet attackers and information harvesters.
I implore you, in the interest of American citizen's 1st, 4th, and 5th constitutional amendment rights to oppose legislation that acts in the interest of corporations by means of treading upon individual rights. Our privacy of beliefs, privacy of the person and possessions as against unreasonable searches, and privacy against self-incrimination are much more important than a slight increase in the probability of selling us a new television.
Thank you for your time and I trust you'll make the right decisions.
Sincerely,
Steven C Jackson
You can find your Senators, Congressman, and Legislators at: http://www.usa.gov/Contact/Elected.shtml
Kindle Swindle
I absolutely love the idea of having a library of books with me wherever I go. I love the choice of reading whatever book wherever I want, whenever I want and not have to search out a bookstore to purchase a book. Amazon provides this service very well.
The problem with the Kindle is its restriction on user freedom. When I 'purchase' and ebook from Amazon, I do not own the book in the same way I own a physical book. I am not free to read it wherever I want (on any device I choose) nor can I give it away, share it with my friends, donate it or sell it. The user is entirely at the mercy of the distributor.
Recently, Amazon invaded users' Kindles and removed books that the publisher decider they no longer want published. It would be a public outrage if your house was invaded and your beloved books were torn from your shelf because the publisher decided your time was up for ownership so why do we allow this to happen in the digital realm?
I really look forward to owning an ereader but I'm not going to trade my freedoms for 'sexy'.
Mono Position Statement
Scott James Remnant wrote on behalf of the Ubuntu Technical Board today defending Ubuntu's inclusion of Mono in it's default shipped package. The entire text can be read here: https://lists.ubuntu.com/archives/ubuntu-devel-announce/2009-June/000584.html
I recognize that they are in full rights to include whatever software they choose to include (as long as any licensing requirements are fulfilled) and Mono is free software. We all, at some level of understanding, realize this. The problems that arise most frequently are the patents concerning the .Net technologies. Scott Remnant addresses these concerns in the position statement.
It is common practice in the software industry to register patents as protection against litigation, rather than as an intent to litigate. Thus mere existence of a patent, without a claim of infringement, is not sufficient reason to warrant exclusion from the Ubuntu Project.
While this may be true on a grand scale, it is widely accepted that there have been problems and dire consequences with using patented technologies on open source platforms. If it were not for this precedence, Mono might be much more accepted.
My stance is that I feel that Mono should not be bundled with GNU/Linux distributions just as a precaution against litigation (again, Mono is free software but the technologies it supports is patented). I do think, however, in the pursuit of freedom, that developers must have the choice to develop software using Mono in order to bring .Net technologies to GNU/Linux. Choice is an essential freedom that mustn't be denied. This may sound contradictory to my statement that distributions should leave Mono and Mono-dependent software out of its default install. I state it this way because I feel its up to the individual to take the risk of using software based on patented technologies (that perhaps may lead to future litigation). It is much more preferable for the individual to choose to waive their rights than for a platform they depend on to choose to do so for their entire user base. This is especially important if the owner of the patented technology does choose to enforce their patent and litigate because many users will have grown accustomed to the patented technology and a void will be left, where, conversely, no void will be left if the technology wasn't initially present. My position is for protection of the users as a whole so that each user of a distribution isn't unknowingly reliant on software based on patented technologies because it came bundled with an operating system.
In short: don't bundle it, but make it available.



![[FSF Associate Member] [FSF Associate Member]](http://www.ossolutions.org/lores/img/fsfMember.png)
Subscribe to this Feed