Skip to content

Category Archives: Unix / Linux

things that relate to unix or linux

Releasing Maven Artifacts to Central Repository through Sonatype

22-Mar-11

I have released my first Maven artifacts to the Central Repository through Sonatype’s Open Source Nexus Server. You have to jump through some hoops to get everything just right to be able to release to the Sonatype Nexus repository, and I could not find all the information I needed in one place so I will [...]

How to install the Offical Oracle JDK on Centos 5.5 and add select it as the default JDK

02-Nov-10

Here’s the command to install an alternative installation of Java: I installed JDK 6u22 from the executable rpm.bin file from the Oracle site. Then I ran this command to add it to the alternatives program. alternatives –install /usr/bin/java java /usr/java/jdk1.6.0_22/bin/java 99 then you just run alternatives –config java There are 3 programs which provide ‘java’. [...]

Get the PID of a running Java process using only BASH tools

22-Jul-10

I need to get the PID of a running Java process, in this case Glassfish 3 to see if it is running before I run some asadmin commands. ps -ax | grep "java -cp /opt/bmam/glassfish" | grep -v "grep" | cut -d " " -f 1 26306

SpiderMonkey in Xcode 3.2.3

28-Jun-10

I am working on a Desktop Application project that will need scripting support, specifically scripting support for people familiar with web development. Even though I have prior experience successfully embedding both Lua and Python in server side applications, I have picked Javascript for this project. Mainly for the low barrier to entry for web developers, [...]

How to determine how many threads you can create from Java

19-May-10

I was getting Out of Memory Error: can’t create native thread errors on a server, and it was definately not running out of memory, so I hacked this little program together to tell me how many threads I should be able to create. 64K is the minimum stack size that Java will allow on an [...]

Python Remote SSH with Paramiko

10-Feb-10

I am using Paramiko to do some remote ssh work and could not figure out how to change directories and execute a script with the SSHClient.execute_command() function. I finally figured out that .execute_command() is basically a single session, so doing a .execute_command(‘cd scripts’) and then executing the script with another .execute_command() reverts back to your [...]

Erlang Native Implemented Functions – NIF

07-Dec-09

Erlang has long had a love hate relationship with external code. There is now “experimental” code in the latest R13B03 release that has support for what they are calling Native Implemented Functions. It is a very basic interface with only 4 functions required to be implemented and a struct and macros for defining your public [...]

My Favorite PS1 Prompt Definition and Aliases

12-Oct-09

Here are a couple of aliases I create on a fresh OSX machine. alias dir=’ls -AlGh’ alias spot=’mdfind -onlyin . $1′ The dir alias is all the most useful ls options all at once. mdfind is the command line interface to the Spotlight service on OSX. You can use the option -name to restrict the [...]