Category: software

orinoco monitor mode

Posted by – August 29, 2009

Edit: This is an old article (circa 2006)

My main linux distribution of choice is Slackware Linux. I recently installed it on my Thinpad 600X. I have a classic Orinoco wireless card that is pretty cool, of course, it doesn’t compare to the Senao cards. Anywho, I wanted to run kismet on this laptop, but Slack uses the orinoco 0.13d drivers. These drivers do not support monitor mode (also called promiscuous mode) which allows for scanning passively. Thus, I had to update the drivers. I have yet to find a site that has complete directions on how to do this, though the shmoo group developed the driver, their directions are not simple for *nix n00bs.

Below you will find how to easily install the patches to enable monitor mode for Orinoco cards so that you can use kismet, tcpdump, etc

Step 1. What we’re going to do is patch the original driver. To do this we need the original driver. You can obtain it from orinoco driver homepage. You will want to get version 13e. Alternatively, you can grab it from my site here

Step 2. Now that we’ve got the driver, we need the monitor mode patch. This is just a *.diff file from the shmoo group. The patch (orinoco-0.13e-patch.diff) can be obtained from their site here http://airsnort.shmoo.com/orinocoinfo.html or alternatively, from my site here.

Step 3. Now you can go ahead and grab the patch to improve channel changing. This patch is from the kismet wireless homepage. This is the orinoco-0.13e-dragorn3.diff patch. I’ve got a local copy of it as well located here.

Step 4. We can now begin the installation of the driver and patches. First you will untar the orinoco driver using

$ tar zxpvf orinoco-0.13e.tar.gz

Step 5. You can begin patching the code now. Change into the directory just created

$ cd orinoco-0.13e

Step 6. And now apply the patch

$ patch -p1 < ../orinoco-0.13e-patch.diff

Step 7. Now apply the performance patch

$ patch -p1 < ../orinoco-0.13e-dragorn3.diff

Step 8. After everything is patched, you need to compiled the driver using

$ make

Step 9. When it is done compiling, you will need to be root to install it

$ su

Step 10. You can now install the driver

$ make install

Step 11. If you haven’t received any errors (which you shouldn’t have), everything has worked fine. You can now plug in your wireless card to see if it worked with the iwpriv command.

how to make hdr photographs

Posted by – August 16, 2009

First off, I’m no photographer. I own a cheap-ish point and shoot digital camera. But I also want to make some cool looking photos, or at least try.

HDR (High Dynamic Range) is a set of techniques that allows a greater dynamic range of luminances between light and dark areas of a scene than normal digital imaging techniques. It makes really cool looking photos.

Here’s how I did it using HDRsoft’s Photomatix.

More…

write on images with php

Posted by – March 23, 2009

I recently had a client that wanted to generate those dynamic images with text on them. I know you’ve seen them all over. The ones with the nude chicks holding signs saying “Alberto wuz here” or whatever. Truth is, these fan signs are really easy to make.

For this example I’m gonna use this image:

sign.jpg

In order to write on images, you’re gonna need the GD library installed in your server. Most of the time this is already done if you’re using shared hosting or if you’ve already got a working webserver.

Save and upload that image into a dir on your server, and we’ll begin working.

We want to be able to input any string of text so we’re going to make a form for submission. Create a form using:

<form action="img.php" method="get">
<input type="text" name="line1" />
<input type="submit" name="submit" value="Do it!" />
</form>

As you can see, it’s not fancy, but it works.

Lets start off with the “Hello World” example. Save this as img.php

<?php
$string = $_GET['line1']; // lets get the text from the form
// define what image we want to write on
$im = imagecreatefromjpeg("sign.jpg");
// define the text color, red, green, blue
$textcolor = imagecolorallocate($im, 61, 61, 61);
$font = imageloadfont('Brigitte.gdf'); // tells it what font to use
imagestring($im, $font, 175, 395, $string, $textcolor); // line o'text
// header to tell the browser it's an image
header("Content-type: image/jpeg");
imagejpeg($im); // creates the image with text
imagedestroy($im); // destroys the image in the memory
?>

Let’s take a look at whats going on here. From the comments you can tell whats going on for the most part, but I can expand.

Line 1 of the code is using the GET method from the form we created to store the text in a variable called $string.

imagecreatefromjpeg() PHP function tells PHP that we want to use a JPEG image. PHP has functions for GIF, PNG and strings, BMP, XBM, XPM, and from GD itself.

We then allocate the colors we want to use for the text. imagecolorallocate() uses RGB values to do this.

imageloadfont() loads our font for writing. It can be a bit tricky to find a font suitable for writing on images and I’ve included a few in the download at the end of this article with the rest of the code. There is, however, a great program that allows you to take any Windows font and turn it into a GD font. You can get this program from here: http://www.wedwick.com/wftopf.exe

The fifth line of code is where PHP does the writing. It takes the image, font, X and Y coordinates, the string (your text), and finally the text color and writes on the image.

The header() is basic PHP to tell the browser what kind of content it is viewing, in this case an image.

PHP then creates the image, and destroys the temp image in memory. You should now have something like this:

Afterthoughts: You can create a form that does POST instead of GET for a bit more “security” through obsecurity.

You could use one page for all the code, but I used two to help newbies.

Download archive with project files here: php-gd.rar

Here is the script in action: http://riscit.info/dynamic_image/input.html

stream audio continously

Posted by – March 23, 2009

I recently installed shoutcast on one of my VPS accounts and wanted to stream music even when I don’t have the DNAS program (or any other dj program).

What I did was download a couple podcast shows and wanted to play them. There is a program the shout cast guys developed called sc_trans. It transcodes files to the shoutcast server.

The download link on the shoutcast site doesn’t link to the right place so its a bit trivial. I’ve included the link at the end of this post.

You will need to generate a playlist of the files you want to play and can do that with:

# find /Mp3 -type f -name "*.mp3" > /opt/shoutcast/playlists/playlist.lst

Which will make a playlist from all the mp3s in the /Mp3 dir and save it in /opt/shoutcast/playlists/

There are quite a few options in the sc_trans.conf file you will want to look at.

sc_trans will only play the files with the same sample rate. You’ll have to resample all your mp3s to the same rate :(

For example, in the sc_trans.conf if you specify

SampleRate=32000

It will only stream files with 32Khz sample rate. You can use the lame program to re-encode your files by doing the following (this re-encodes into 44Khz):

lame --resample 44.1 InputFile.mp3 OutPutfile.mp3

If you want to re-sample an entire directory of mp3s, you can use a shell script:

#!/bin/sh

for i in *.mp3; do
lame --resample 44.1 ${i}
done

Save that as lame.sh, chmod + x lame.sh and then ./lame.sh

Here is a overview of some of the settings of sc_trans and shoutcast itself. It is an excellent guide. Streaming Radio with Shoutcast

Download sc_trans from Shoutcast.com here

Top 10 Best Linux DVD Ripping and Encoding Software

Posted by – March 16, 2007

A mighty good list.

http://assente.altervista.org/top_10_best_linux_dvd_ripping_and_encoding_software/

Linux Software

Posted by – February 19, 2006

These are the programs that I would like to see have Linux alternatives:

Photoshop – > Gimp? (this is confusing to use, we need something better)
InDesign – > Scribus? Doesnt have near the amount of features that InDesign has.
FlashFXP – > Kasablanca. This is the closest in the linux world that I could find. Still isn’t the greatest.
Sony Vegas or Adobe Premiere – > Kino or Cinerella. Haven’t used Cinerella, but I don’t think its close to what either Sony or Adobe have put out.

I think those are the only programs that are keeping me with a Windows install, besides games of course.