···
 Code 
···

Within the Code category we have the following:


  
···
 Generate HEX Keys 
···

October 17th, 2008 ··· andarius

It was asked recently how to generate a random HEX key for something like WEP. A bash one liner can do this for you using the following:

string=0123456789ABCDEF && for i in $(seq 1 32); do pos=$(($RANDOM%15)) && key=${key}${string:$pos:1}; done && echo $key
Read the rest of this entry »

Code ··· No Comments »


  
···
 noxmms & patch 
···

December 10th, 2007 ··· andarius

I recently had need of a cli player that would play streams as well as local files. I had used noxmms previously so i figured to use it again. It is basically xmms with the GUI stuff stripped out. I ran into an issue trying to build it related to a static declaration in one of the source files. A quick search on Google yeilded a fix of course.

Since I had done the work to get a Slackware package done I figured I would share. The files to build a package from source can be found “HERE”. Enjoy.

Code ··· No Comments »


  
···
 Handling Images 
···

May 27th, 2007 ··· andarius

I get pretty lazy when it comes to processing close to a hundred images for placement on a web site. First I need to make sure they are turned the right way. Then I need to make a thumbnail. Then I need a scaled down version for main display. To finish things off the thumbs need to be in the thumbs directory and the originals need to be in hi-res. Gahh that is a lot of work.

Read the rest of this entry »

Code ··· No Comments »


  
···
 Starting Web Services 
···

April 4th, 2007 ··· andarius

I needed a way to start httpd (apache) and mysqld (MySQL) easily and I did not want them running all the time. I use them on my desktop and laptop for web development and testing. Since I don’t work on web stuff all the time it would be senseless to run them all the time. It was just easiest to create a start-stop script to use when I needed it.

Read the rest of this entry »

Code ··· No Comments »


  
···
 Shell Script Timing 
···

March 7th, 2007 ··· andarius

It took me a little time to find a way to get the amount of time it took for a shell script to execute. Every time I looked for it on the web I would get all kinds of other wild stuff. Well I had come across a way to time PHP execution times and after reading that figured how different could it be?

Using basic principals the following was derived. It takes a start time and an end time, gets the difference and then formats that difference using the date command. Thats right, date will format a string for you based on certain input data.
Read the rest of this entry »

Code ··· No Comments »



bottom img