Affiliations





[FSF Associate Member]

Coder's Wasteland

Syndicate content
To provide free and open programming solutions, snippets, and some original research. All original information on this site is CC Attribution-Noncommercial 3.0 Unported. All code is distributed under the GPLv3. The content on this site is code for use on GNU/Linux distributions unless otherwise noted.
Updated: 15 weeks 5 days ago

Ninja!Ninja!Ninja!Zombie!

Mon, 11/16/2009 - 15:29
This is my final product for my Game Programming class at Kennesaw State University. It was written using Java in a Netbeans environment first in Fedora 11 and then moved to Ubuntu 9.10. I used git for version control. It's approximately 800 LOC in 2 files.

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
PDF
Categories: Linux

Install Oracle 10g Express on Ubuntu

Tue, 11/03/2009 - 18:41
I've had some trouble initially setting up Oracle 10g Express on Ubuntu and ended up going through search engine results, blogs, and message boards. I've finally gotten it working so now I want to post all directions in one place.
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. Press to 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!
Categories: Linux

Superkill - A Quickie Script for Killing All Instances of an Application

Thu, 10/15/2009 - 15:30
Evolution crashed on me this morning and I kept getting an error message: "Evolution appears to have exited unexpectedly...". Every time I started the application, it provided that message then locked so I went to my trusty command line. I did a ps -ef | grep evo and saw that several evolution-based processes were running: 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 evo I 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).
Categories: Linux

Behavioral Advertising Sans Consent - An Open Letter to Congress

Wed, 09/16/2009 - 15:11

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
<!--break-->

Categories: Linux

Where My Nerds At?

Fri, 09/11/2009 - 18:41

Categories: Linux