Tuesday, March 25, 2008

latex images

found a neat little tool for producing pngs from latex: pytexipng. fast, simple, and python. can't beat that. great for making equations for presentations. try to mangle that, powerpoint!

Tuesday, March 18, 2008

pycrypto

i found a recipe that gives a simple example of how to use pycrypto. Here's the important part:
import os, sys
from random import randrange
from Crypto.Cipher import Blowfish
from getpass import getpass
import getopt

class BFCipher:
    def __init__(self, pword):
        self.__cipher = Blowfish.new(pword)
    def encrypt(self, file_buffer):
        ciphertext = self.__cipher.encrypt(self.__pad_file(file_buffer))
        return ciphertext
    def decrypt(self, file_buffer):
        cleartext = self.__depad_file(self.__cipher.decrypt(file_buffer))
        return cleartext
    # Blowfish cipher needs 8 byte blocks to work with
    def __pad_file(self, file_buffer):
        pad_bytes = 8 - (len(file_buffer) % 8)                                
        for i in range(pad_bytes - 1): file_buffer += chr(randrange(0, 256))
        # final padding byte; % by 8 to get the number of padding bytes
        bflag = randrange(6, 248); bflag -= bflag % 8 - pad_bytes
        file_buffer += chr(bflag)
        return file_buffer
    def __depad_file(self, file_buffer):
        pad_bytes = ord(file_buffer[-1]) % 8
        if not pad_bytes: pad_bytes = 8
        return file_buffer[:-pad_bytes]

Friday, March 14, 2008

wireless measurements

right now, with one of the default whip monopoles, i get about 30 yards range outside my house for my wap. i'd like to go about 10 times that in one direction. so that would be 10 dbi gain needed for an antenna. that should be doable with a homebrew.

Friday, March 7, 2008

grandcentral

so, google bought grandcentral.com and is now letting people into a free beta. but they don't have any numbers available in my area. i wonder if that's because other people here already took them or if they haven't put any in yet. i guess i'll check it later, just in case.

homebrew wifi antennae, aircrack

i found a few good links on homebrew directional wifi antennae. this one gives a comparison between different designs and shows that soup can wave guides beat pringles cans. bottom line: nalley 40oz 'big chunk' beef stew wins, with a 16 dbi gain. here's a design for a helical, also advertised at 16 dbi. maybe i could make it better by increasing the length, but if it's the same gain as the soup can, i might as well make the easier one (which costs practically nothing considering i can eat the soup). some dish designs might do even better, but that means i have to buy a usb wifi and set up network bridging with the server. either of the other two can connect directly to the wap, after i remove one of the built-ins. speaking of which, that means i'll need to pick up a RP-TNC connect at radio smack. on a related subject, here's a tutorial on using aircrack. no, i don't plan to use these together, and neither should you.

linux blogging... ugh

i am sorely disappointed by the state of linux blogging clients for blogger 2 (atom). the only one that even claims to support it is drivel, and this in svn only (not in any stable release). checking out was easy enough: svn checkout http://svn.gnome.org/svn/drivel/trunk then, autogen.sh, configure, make, make install. but it crashes when i try to connect to http://www.blogger.com/api. maybe i'll try drivel again if it gets more work. but it looks like i'll be using the !@#$% browser for the foreseeable future.

Wednesday, March 5, 2008

pure python ib i am eager to try out the pure puthon interface to interactive brokers. ibpy on google code has almost everything i need. profitpy provides a login_helper script to send x events to the java tws window, which i'm currently doing with the klunky external perl guitest. login_helper is meant to be a command-line script, but i could use it as a module by putting together an options object and calling login_helper.main(). login_helper needs the guitest module from enthought. the link in the docstring seems to be old, but it's not hard to find on the enthought site. the ib_tws script (also in the bin dir) shows a good way to start the java tws, though for some reason it's a bash script instead of python. shouldn't be hard to translate.

Tuesday, March 4, 2008

just started using BloGTK. we'll see how it goes.

Monday, March 3, 2008

mach64 on gentoo

i think i finally found a way to get accelerated video on my ancient laptop with an ati rage mobility p/m (mach64). i'll give it a try and see if i can use that thing for some kind of multimedia use.

blog client apps

looks like the big names in non-browser blog editors for linux are gnome-browser and BloGTK. gnome-browser is the only one that specifically claims to work with blogspot, and they both appear to be primarily python. i'm having problems with both of them right now because it seems to be linking some stuff with python 2.5, even though i'm using 2.4.