Keeping PdaNet free on the iPhone

November 19th, 2008 by dave

Starting with PdaNet version 1.40, its author is asking for $30 after two weeks of trial usage. Version 1.33 is free, so here’s how to revert:

First, ssh on to your iPhone. On my network, my phone’s address is 192.168.1.8.

ssh mobile@192.168.1.8

(The default password is: alpine)

Then, become root:

su

(Again, the default password is alpine)

Now, download and install the PdaNet 1.33 package from the modmyi repo. We’ll need wget first. I have PdaNet 1.33 mirrored here if this location is broken.

apt-get -y install wget
wget http://modmyi.com/repo/2debs/pdanet1.33.deb
dpkg -i pdanet1.33.deb

Finally, put the pdanet package on hold, so upgrades on Cydia won’t update versions.

echo com.jft.pn hold | dpkg --set-selections

That does it. For now, Cydia will mark the package as upgradeable but never actually upgrade it. Kind of annoying, but it should the trick.

Dave

iPhone? You Phone.

July 16th, 2008 by dave

I was at DemoCamp last night and, while the demos were generally interesting (congrats DrProject on the neat IRC integration demo), some of the presenters’ sexist humour was difficult at times.

News:

  • I bought a VPS at Linode. If you’d like any hosting, let me know :)
  • I’m going to rework this blog using Django
  • My iPhone comes today :)
  • I promise to write more

Geometry Cometry

April 6th, 2008 by dave

Hi friends,

It’s official. Click here to download a preview build of Geometry Cometry, my new video game.

Thanks,
D. T.

PyCon and PyGame 1.8

March 30th, 2008 by dave

Okay, so I won’t write much about PyCon.

The highlights were spending lovely time with David Wolever and Jeff Balogh and a nice dinner with some Python/GSoC people that was comped. The talks that I attended were well done except for a walker-outer or two.

Guido surprisingly quoted Matz in his keynote, that is “open source needs to move or die.” I liked that.

In other news, PyGame 1.8 is out and has some nice new features.

PyCon

March 19th, 2008 by dave

Well, I was at PyCon 2k8 in Chicago (more to come, I promise). Beyond the people I met, the most important thing that happened was that I finally plunged head first in to PyGame. While what I’m about to show you a sneak peak of won’t be the first game of its kind, I hope it’ll be the best…

Geometry Cometry

Yours,
D. T.

Invasive changes

December 7th, 2007 by dave

Have you checked out Python 3.0?

dave@bozo:~/Desktop/Python-3.0a2$ ./python
Python 3.0a2 (r30a2:59382, Dec  7 2007, 18:14:16)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print "Hello, World!"
SyntaxError: invalid syntax (, line 1)

“You know a language has invasive changes when ‘Hello, World!’ breaks.” -Victor Ng

Fake SMTPd

November 27th, 2007 by dave

So I wrote a fake SMTP server for testing DrProject. Check it out.

Thanks,
Dave

Decorative Python

November 21st, 2007 by dave

In my code for DrProject/REST, I rather like a trivial 2 lines of Python that ever so thinly wraps around property and is used for decoration.


def Property(func):
   return property(doc=func.__doc__, *func())

If it’s not immediately clear what this does, you’re new to Python decorators. Here’s an silly, useless, but otherwise insightful example:


class Test(object):

   def __init__(self, value):
      self.__data = value

   @Property
   def data():
      '''Here is my docstring'''
      def fget(self):
         return self.__data
      def fset(self, value):
         self.__data = value
      def fdel(self):
         raise NotImplementedError, "Cannot delete"
      return fget, fset, fdel

That’s all,
Dave

AJAX Persistent Request Objects API

November 14th, 2007 by dave

reqobj.js - AJAX (XMLHttpRequst) Persistent Request Objects API.
Used for Café Chess (http://play.cafechess.com/js/reqobj.js)

(Note: All functions/variables with an underscore before them are private)

Variables:

unsupported_redirect (string)
Set this to the URL you’d like the script to redirect to if an XMLHttpRequest() object can not be created.

Example:

 

var unsupported_redirect = 'http://www.example.com/nosupport.html';

Functions:

do_req(postdata, url, callback, timeout_interval) (boolean)
Does a single HTTP POST call. Returns true if the call goes through, false if there is already a call in progress.

  • postdata (string) - The data to send.
  • url (string) - The url to post to (should be a relative path or most browsers will throw an error).
  • callback (string) - Just the name (ie: no brackets) of a function that will accept one input parameter (either false or a string) to be called when the request has gone through. The request will call this function with the returned data upon success or false upon failure.
  • timeout_interval (int) - The amount of time (in milliseconds) that the request should wait for a response. After this time, the callback function will be called with false.

Example:

 

function handle_request(data) {

  if (data)

    document.write(data);

  else

    document.write('An error occurred.');

}var response = do_req('post this', 'post.php', 'handle_request', 5000);

if (!reponse)

  alert('Request could not be sent');

p_do_req(callforpostdata, url, callback, interval, timeout_interval) (boolean)
Creates a persistent HTTP POST object that runs in the background. Returns true if the object could be created, false if there has already been an object created.

  • callforpostdata (string) - Just the name (ie: no brackets) of a function that accepts no input parameters and will return a string to use as post data for each call.
  • url (string) - The url to post to (should be a relative path or most browsers will throw an error).
  • callback (string) - Just the name (ie: no brackets) of a function that will accept one input parameter (either false or a string) to be called when the each request has gone through. The object will call this function with the returned data upon success or false upon failure.
  • interval (int) - The amount of time (in milliseconds) that the object will wait after each call (upon success or failure) until the next call.
  • timeout_interval (int) - The amount of time (in milliseconds) that the object should wait for each response. After this time, the callback function will be called with false and the next call queued.

Example:

 

function handle_request(data) {

  if (data)

    document.write(data + '<br>');

  else

    document.write('An error occurred.' + '<br>');

}function get_post_data() {

  return 'post_this';

}

var response = p_do_req('get_post_data', 'post.php', 'handle_request', 1250, 5000);

if (!reponse)

  alert('Object could not be created');

p_kill_req() (boolean)
Attempts to destroy an already active persistent request object. Returns true if one exists and it is destroyed, returns false is there isn’t one to destroy.

Now that’s that,
Dave

(Note that this was imported from my old blog. If the formatting is messy let me know so I can change it.)

Wordprexploit

October 23rd, 2007 by dave

It’s wonderful that I chose WordPress, considering what lovely exploits it seems to have accumulated in the past. How about that for full disclosure?

But I’m not going to switch for a while. I’ve hacked up Kubrik pretty good.