In Loki We Trust The many projects of Lokkju, Inc


MobileSaver selected for Banking the Unbanked prize

MobileSaver, a little app I wrote pro-bono for CASA of Oregon at a local hackathon, has been selected as the winner for the "Banking the Unbanked" category of AT&T & OneEconomy's Applications For Good contest.

More Here

Filed under: Uncategorized No Comments

Installing Scapy via PIP

it looks like the pypi entry for Scapy is significantly out of date, so instead you can use this command to install Scapy via pypi:
pip install hg+

Filed under: Uncategorized No Comments

Flashing a bricked HP Mini 1000 (1151NR)

Note: This worked with a 1GB USB stick, but not a 8GB one. YMMV.

Update: working rom image now available - this works at least on the 1151NR

You'll see many places around that tell you how to recover from a bad AMI BIOS flash or how to flash a custom BIOS, but it works a bit different on the HP Minis that use AMI. Before trying this, please make sure you have a known good ROM to flash back to if your modified one doesn't work.

As usual, the AMI BIOS will allow you to reflash via an AMIBIOS.ROM file on a USB stick - but it must be DOS bootable, and you must use the *right* control key.


  1. make a bootable DOS USB stick (google for it, there are some tools)
  2. copy any ROM image for your machine model to it (in the case of the 1151NR, a ROM from many of the other HP Mini 1000 models will work).
  3. rename the ROM file to AMIBOOT.ROM
  4. while holding the right ctrl+left arrow key, power on the system
  5. within 10 seconds, you should see the AMI update utility start to do an update, and some dots going across the screen. It may take a couple tries to work.
  6. if you computer didn't automatically reboot, remove the battery and power, then plug it back in and turn it on. You should see "CMOS checksum bad" once, and then it should boot normally.
Filed under: Uncategorized 8 Comments

CivicApps Hackathon – Mobile Apps for Education

Quite a productive event at P.I.E. today, with two very interesting applications being built.

The first is a team SMS application for teachers to send text messages to all their students. It still has some major feature enhancements on the way, including an administration layer for school administration to send out an SMS to all students using the service, but it was working - and a cool demo it was too! You can check it out at

The second app, which I worked on with a team of 5-6 others, is a youth activities calendar aggregator based on the calagator platform. It is intended to be a single place to not only post events (and import events from other sources), but only a resource for posting jobs that are targeted at youth. It is currently fully up and ready to use, and formatted for ease of use on mobile devices, but future improvements include event list exportation in multiple formats, multiple themes - each targeted at a difference type of client device, and possibly event reminders. It is currently at I personally don't like the name, so taking suggestions!

TheStreamPDX was chosen as the day's "winner", and we (the team behind it) will be receiving a Web Visionaries Award.

Filed under: Uncategorized No Comments

MobileSaver: an Applications For Good contest entry

MobileSaver was first concieved of as an idea during a discussion about challenges to the successful completion of IDA programs. A basic design mockup was done prior to the Portland code camp. At the code camp, the UI design was greatly improved, the python code and templates were written, and by the end of the day it existed as a working, usable, application.

MobileSaver is currently a fully working web application, with complete support for iOS, Android, and similar devices. It falls back to basic HTML on more limited mobile browsers, and while not as nice looking is still fully functional. In the future, we'd like to add device capability detection, and specially format the output for some older devices, such as classic Nokia or Motorola browser equipped cell phones. In addition, deposit reminders and notifications; and a communications portal to ask questions of the program manager are in the works.

Voting/Project Page:
Presentation (Including demo video):
Demo Video:
Source Code Link:
Live Beta Link (Outcome Tracker account required):


Accessing Facebook Fan Page Video tagging settings

If you run a fan page, you probably already know you can allow your fans to tag photos you post (and also control if they can post pictures to your page). But did you know you can do the same for Videos? You can, but it is hidden.

Steps to access your video settings:

1) go to your Facebook Page
2) Click the "Edit Info" link near the top of the page
3) Click the "Apps" item on the left hand menu
4) Click "Go To App" under the "Photos" section
5) (this is the trick) - look at your URL bar - you should see a section that says "aid=2305272732". Replace it with "aid=2392950137", hit enter... and now you can manage the ability of your fans to tag and post Videos.


New wordpress plugin published

I've just released a small wordpress plugin for showing paypal funds received vs a target amount (with time periods, so, monthly for instance).

You can find it here


Configuring a Ubuntu 10.04 VPS from scratch

In my last post, I mentioned I recently picked up a cheap VPS. Though the UFW configuration worked, I quickly decided it was overkill for what I wanted to do - I'd rather do my own iptables rules. So, here is a *from scratch* set of commands to configure your new server. It will change your hostname, set up a new (sudo capable user), and set up basic ssh and http firewall rules.

Anywhere you see "[HOSTNAME]" replace it with your hostname.
Anywhere you see "[USERNAME]" replace it with your selected new username.

echo -e "\t[HOSTNAME]" >> /etc/hosts
echo [HOSTNAME] > /etc/hostname
hostname [HOSTNAME]

useradd -d /home/lokkju -U -G sudo -m -s /bin/bash lokkju

passwd [USERNAME]

echo "*filter" > /etc/iptables.rules
echo ":INPUT ACCEPT" >> /etc/iptables.rules
echo ":FORWARD ACCEPT" >> /etc/iptables.rules
echo ":OUTPUT ACCEPT" >> /etc/iptables.rules
echo "-A INPUT -i lo -j ACCEPT" >> /etc/iptables.rules
echo "-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT" >> /etc/iptables.rules 
echo "-A INPUT -i eth0 -p tcp -m tcp --dport 22 -j ACCEPT" >> /etc/iptables.rules
echo "-A INPUT -i eth0 -p tcp -m tcp --dport 80 -j ACCEPT" >> /etc/iptables.rules
echo "-A INPUT -m limit --limit 5/min -j LOG --log-prefix \"iptables denied: \" --log-level 7" >> /etc/iptables.rules
echo "-A INPUT -j DROP" >> /etc/iptables.rules
echo "COMMIT" >> /etc/iptables.rules

iptables-apply /etc/iptables.rules

echo -e "\tpre-up iptables-restore < /etc/iptables.rules" >> /etc/network/interfaces
Filed under: Configuration No Comments

OpenVZ, Ubuntu 10.04, and UFW

I've recently gotten a new VPS ($9/mo, 256MB RAM, 300GB Disk, 10Mbps/unmetered) from FDC Servers. It's running OpenVZ for it's containers, and the first step, as always, is to get the firewall up and running... which can be a pain under OpenVZ.

So, lets do another walkthrough:

  • Install ufw:
    apt-get install ufw
  • Edit /etc/ufw/after.rules
    # don’t log noisy broadcast
    #-A ufw-after-input -m addrtype --dst-type BROADCAST -j ufw-skip-to-policy-input
  • Edit /etc/ufw/ufw/before.rules
    # if LOCAL, RETURN
    #-A ufw-not-local -m addrtype --dst-type LOCAL -j RETURN

    #-A ufw-not-local -m addrtype --dst-type MULTICAST -j RETURN

    #-A ufw-not-local -m addrtype --dst-type BROADCAST -j RETURN

  • “Fix” modprobe
    mv /sbin/modprobe /sbin/modprobe_disabled
    ln -s /bin/true /sbin/modprobe
  • “Fix” sysctl
    mv /sbin/sysctl /sbin/sysctl_disabled
    ln -s /bin/true /sbin/sysctl
  • Fix logging
    apt-get -y purge rsyslog
    apt-get install -y syslog-ng
  • Edit /etc/init/ufw.conf
    start on startup
    #console output
  • Enable ssh & ufw
    ufw allow ssh
    ufw enable

You're Done! now you can safely add more ports for inbound access - but use the port number, not the service name.

Thanks to bodhi.zazen for some of the information above.

Filed under: Configuration 1 Comment

Making jQuery-UI work in the Django Admin

Problem: Django's Admin moves the jQuery namespace into a custom one, django.jQuery, to prevent conflicts. But what if you want to use the provided jQuery, with jQuery-UI? jQuery-UI, and many other jQuery plugins, expect there to be a "jQuery" namespace.

Quick Fix - lets move it back to the jQuery namespace:

<script>(function($){jQuery = $.noConflict(true);})(django.jQuery);</script>
<script type="text/javascript" src=""></script>

And that's it!

Filed under: Uncategorized 2 Comments