January 2012
1 post
8 tags
Getting the area of complex polygons →
A great article with code examples on the theory on generating the area of complex polygons in code.
The article includes examples in:
Python
Javascript
C
Java
I have implemented and tested the python code and it works really well but the more points there are the longer it will take to execute.
5 tags
GITHUB: satchmo-apost-satchel-shipping
Just a quick post to let you guys know about my forst shipping module that I have released for the ecommerce module Satchmo for Django.
The module is called satchmo-apost-satchel-shipping and handles shipping calculations based on the fixed price satchels. This module will calculate the maximum amount of satchels required and bill accordingly.
Also as a requirement it will handle free shipping...
October 2011
3 posts
6 tags
Error starting Eclipse Indigo
I have been using eclipse for a few years now for the majority of my development now fr all of my development, recenly I upgraded to the Indigo release of Eclipse. This morning on the train I was presented with a popup directing me to a logfile with the error below:
!ENTRY org.eclipse.osgi 4 0 2011-10-27 07:41:06.158
!MESSAGE Startup error
!STACK 1
java.lang.ExceptionInInitializerError
at...
3 tags
Enable the Facebook timeline →
This is the how-to that I used to enable the new Facebook timeline
September 2011
1 post
August 2011
2 posts
5 tags
Python Yield Statements →
Here is an awesome explaination on what the function of a yield statement is. It also supplies some great examples on using and controlling generator functions.
4 tags
Linking tweets to status updates.
I have been asked a couple of times lately by friends on how to get your Twitter updates to show up in Facebook as status update.
I have tried a couple of solutions and this one has worked the best for me:
Goto https://apps.facebook.com/twitter/ and sign into your account.
Select the “SIgn in with Twitter” button and enter your details
Now all you need to do is go to one place now...
July 2011
24 posts
Httplib examples →
Awesome example code for httplib. Cut Paste and away you go, great shortcut!
Thanks Gregory Mazzola!
5 tags
Disabling user-agent Stylesheets
I have been working on te views for a django web application and was having huge CSS issues with the user agent Stylesheet in Chrome, Firefox and Safari. It was applying styles that were breaking my template.
After searching around the web for a while I found a solution that seems to negate the styles that browsers are trying to enforce on sites.
I found it in the User Foruns of Drupal.org a...
1 tag
Moved House
You may have noticed that we have moved to a new platform with a new look.
This was a necessity as we had some issues with our hosting provider and thought it was better to move to a new platform and provider. We are now using the Tumblr. platform to deliver content so any feedback would be awesome.
This move has its ups and its downs, we have lost all of our 2011 posts which really sucks, but I...
Python Image Library Install OSX
Moving on and starting to develop apps now that I have my Django Dev Environment installed I would get on and do some Django development.
What I did find is that to use the models.ImageFile() field type in an apps models.py you need to have the Python Image library (PIL) in stalled into your python install.
After some Googling round I found a compatible package at effbot.org. This is how to...
Setting up a Django Dev environment on OSX
I have been looking over the past month or so at web development frame works in different languages and decided that Django is the one for me. Not only is it quick and scalable, but it is written in Python and it is a language I am familiar with and even better enjoy coding in.
For this environment we are going to install Django and integrate it with Eclipse.
For eclipse got to...
Apache Dummy Connections Crashing Plesk HTTP...
Been chasing an issue at work the last couple of days where one of the servers has a periods of loading up the server’s CPU with a large percent of processes in a wait state.
Fishing arround I noticed a whole heap of dummy connections from the apache server after the Apache server was trying to scale back down the number of child processes. I was seeing these in the access_log and on the Extended...
Checkout this awesome link to an episode of the Totally RAD Show where they demo the Microsoft Surface.
I was blown away by this and if you weren’t you already have one. Not only was there a multiplayer super sprint clone and Settlers of Catan, but you rolled clear dice on the surface and it tells you the results.
I was inspired to build a multitouch display when I saw the Porta Touch on...
Adding system stats to the desktop
While procrastinating on my home automation code I wanted to get some basic system stats on the desktop to just get an idea of what is going on on my new Macbook.
Now there are a whole bunch of widgets, dashboard and menu apps for OSX but being the way I am these days I wanted to see what I could achieve and this is what I came up with.
The first part of my solution to this is a tool called...
Android Preparing SD Card issue
This morning after plugging my Xperia X10 into my macbook and syncing my daily dose of tech podcasts ready for the commute to work I found that the phone was not mounting the SDCard and the phone kept crashing.
After a reboot there was a notification saying that the system was preparing the SDcard and was checking for errors.
I used ‘Android Terminal Emulator’ by Jack Palevich to connect to the...
Cool Tool: Preyproject
I was watching HAK5 on REV3 last week and they mentioned a tool called the preyroject.
What the prey does is runs a piece of software on your PC/MAC/Linux computer that communicates back to your account at www.preyproject.com so in the event you computer is stollen or lost you can connect to the website and tell your laptop it is lost.
When you set this setting the Prey software starts to send...
Installing google chrome on Fedora 12
I have just installed google chrome via yum on my Fedora 12 Desktop.
This is done by adding a repo file in /etc/yum.repos.d called chromium.repo
This file should contain the following:
[chromium]
name=Chromium Test Packages
baseurl=http://spot.fedorapeople.org/chromium/F$releasever/
enabled=1
gpgcheck=0
Once this is installed run the command yum install chromium and yum will go off and fetch...
Send specific messages from the sendmail mail...
Had to test specific messages from a sendmail mail queue at work today and had to try to work out what was holding up the mail queue.
Here are the commands I was using:
To send messages with a specific message id:
sendmail -v -qI
To send messages with a specific recipient:
sendmail -v -qS
To send messages with a specific sender:
sendmail -v -qR
The substrings can be partial of the information...
June 2011
0 posts
Quick Hack: delete bulk processes reported with...
Having qmail running on multiple machines (I know there are better alternatives) we often have to go in and clean up after a crashed qmail service so it will behave again for a while.
Here is a quick and dirty hack to kill processes up that are there when you do a ps aux | grep
SEARCH='qmail' ; ps -eo pid,cmd | grep $SEARCH | awk '{ print $1 }' | xargs -I pid kill -15 pid
This uses ps and grep...
Mark all messages as Read in Gmail
I have an issue where I get slack with my email and do not stay on top of things. Especially in accounts where I get a lot of mailing list traffic. I wanted to clean out a whole heap of this and found a really quick way to make use of the filters in Gmail to mark the messages.
It is really simple.
Goto ‘Create a filter’ which is next to the search bar.
In the ‘Has the words’ section add in...
Upgrading rdiff-backup from source
I recently had an issue where I was running rdiff-backup on a server that had a different earlier version of rdiff-backup to the one that we are running on our backup server. I was receiving a security violation error.
As the Ubuntu box that I was trying to backup did not have a newer package available for rdiff-backup. I had to update from source which consisted of 4 commands to download that...
Passing a dictionary to a dynamically generated...
Working on some python code for some automation around the house and had the need to be able to pass dictionary object to a function name that was dynamically generated by the input to the script. Normally this is simple using the xmlrpclib module that you can install for python. All you need to do is pass in the dictionary object into the function and make sure that the function that you write...
Sendmail mailq management
Had to clean out a sendmail mail queue that was huge today. Found a couple of geat ways to locate mail that can be removed from the mail queue using awk and xargs. Delete files from mqueue by looking for keywords in the queue file:
grep 'error' qf* | grep -v '' | awk -F: '{print $1}' | awk -Ff '{print $2}' | xargs -I file rm -f dffile qffile
Delete mail from mail queue that had no sender...
Installing yum on Centos-5 VPS
I have been going the way of installing all of the packages on Centos VPS using wget to get the packages. Here is a one line command to install yum:
vzpkg install -p yum
Shell Commands for HTTP access log
I had to do some anayalsis of a clients site and verify if it was actually as popular as the data usage and web statistics said it was. Bellow are some of the shell commands that I have used to analyze the access log on the server the site was hosted on:
Unique IP’s and amount of entries in access_log:
======================================
cat | awk ‘{print $1}’ | sort -n | uniq -c
Amount of...
Johnny Long’s talk at DefCon 17 from Dash Riprock on Vimeo.
August 2009
2 posts
Reading RSS with python
I have been working on a way that I can get my podcasts downloaded and sync’d to my mp3player by my home server and it was interesting how simple it is to do with Python.
I have been using feedparser module which is very simple to get Fedora users are able to simply install this via yum the package is python-feedparser
If you are not on fedora check you package manager or down load the module...
July 2009
3 posts
Find Dell Service Tag from the Linux console
I deployed a Dell server down at the datacentre only to realise that I had not taken down the Service Tag number. A quick look on google and I found a simple way to find your service tag via SSH
dmidecode | grep "Serial Number"
Dmidecode shows heaps of information that I have yet to have a closer look at. The command is located in /usr/sbin
SELinuxTroubleshhoting from the command line.
I love SELinux and think it is a great way to assist you to ensure services and users are not accessing files and directories they should not be.
I have found the sealert GUI tool to be a great help when setting up and troubleshooting issues on a system, but have always struggled at the command line. Until I found a solution.
sealert -a /var/log/audit/audit.log
This outputs the text of the...
3 tags
Plesk: How to count SMTP connections per email...
Found an interesting solution for users of plesk/qmail for how to identify a user who is abusing your authenticated SMTP service.
Running the command:
cat /var/log/messages | grep -i smtp_auth | grep "logged in" | awk {' print $11 '} | awk -F / {' print $6"@"$5 '} | sort | uniq -c | sort -n | tail
or:
cat /var/log/syslog | grep -i smtp_auth | grep "logged in" | awk {' print $11 '} | awk -F / {'...
5 tags
Attachment size filter using MIMEDefang.
I came across for a project that I am working on a great tool managing email passing through a sendmail MTA. It is called MIMEDefang and is highly extensible and flexible utility that can let you do many things to an Email messages as it passes through your MTA. These things include functionality that is available in other mail Utilities (such as Amavis ect.) like spam filtering, anti virus...
June 2009
1 post
We Have moved.
Hey finally PureDistortion has moved to its very own site. It is at www.puredistortion.com. This blog will stay up and have all of the archived posts here from before the move. they will be avaliable at puredistortion.blogger.com and blog.puredistortion.com Dale
November 2008
2 posts
Magic the Gathering resources
Finally the local game store is getting into the Wizards of the coast game Magic the Gathering and stocking some of the cards. For me this is really cool as this is a game that I have always been interested in but no one in my social circles played at all. Also I think it is a game that my wife could really get into as well which would be cool as the continual smackdown I get in card games like...
Army Roster - Armybuilder on the web.
On Dakka Dakka today found a link to a site called armyroster.com. Army Roster is a web based army builder that is now looking for people for Beta accounts to test the site and provide feedback and bugs. I creatd an account on the site and went through and started to build a 1500pt list for my Orc and Goblin Fantasy army (at the moment Warhammer Fantasy lists are all that can be created) and...
October 2008
2 posts
Plesk: How to count SMTP connections per email...
Found an interesting solution for users of plesk/qmail for how to identify a user who is abusing your authenticated SMTP service. Running the command: cat /var/log/messages | grep -i smtp_auth | grep "logged in" | awk {' print $11 '} | awk -F / {' print $6"@"$5 '} | sort | uniq -c | sort -n | tail or: cat /var/log/syslog | grep -i smtp_auth | grep "logged in" | awk {' print $11 '} | awk -F / {'...
"Great Firewall of Australia" ISP spam filter......
With all of the talk going on on the net and in main stream media about the new “Great Firewall of Australia” ISP spam filter I though I should have my say. Firstly I think that this is ridiculous especially when the report that has been released regarding there 30 user test in Tasmania…. 30 user how the hell does 30 users represent Australia’s traffic, maybe that is the...
September 2008
1 post
Wired.com Photography compertition winners
Wired is doing a piece on all of the winners of there previous photography competitions. There are some awesome photos here, my favourites are the Gecko Eye by Alan M which is awesome and the picture of the guy canoeing in the mist by Peter Bowers. The next photography contest being run by Wired is a Portraits contest so any photographers reading get involved. Check out the contests page at...
August 2008
5 posts
Redhat Servers Compromised
last week Redhat detcted intrusions to certin computer systems. There have been minimal details on the intrusion and what actually has happened as investigations are still happening. RedHat’s first concern was the RedHat Network (RHN) and ensuring that their distrobution channel with there clients was intact. I think this is a great move by RedHat acting so swiftly and ensuring that the...
Dawn of war II Trailer and other Cool DoW stuff
While trawling through the www.wargamerau.com forums today I came across 2 new things that make the future release of THQ’s Dawn of war series looking like something to keep an eye out for. The first is the new trailer that was released yesterday titled ‘This world is not ours’. It is amazing and the animators at THQ have done a great job capturing the Warhammer 40k universe. Not...
Deleted Scene from Ironman
I cant wait for this to come to DVD in September, as ever since I saw this at the cinema I have wanted to see it again. To keep me going Dez sent through a link to this 4 minute deleted scene from Ironman.
New Job
It is official I will be moving on from my current position at In-tellect to a role at Discount Domain Name Services. I have had a great time working at In-tellect and have been able to play with some pretty cool applications and technologies, and will still be doing some stuff at In-tellect still. At DDNS I will be doing some exciting stuff in the web hosting and registrar areas of the web side...
Geee its been a while!
Hi all, Firstly I am soory for the lack of posting over the last 4 months, but in my defence (a slim one at that) I have been crazy busy. Whats been going on… well quickly building a house, work, finding new work, new baby on the way and heaps of other stuff but they are the big bits of news. I am getting ready to do some big things in remodelling the site as we will be moving away from the...
April 2008
8 posts
Asus Eee PC 900
Now I am glad i waited for this release before going and buying mine. The Eee PC 900 with its larger screen looks great. Check out the video for the low down on this hot mini Laptop.
Nintendo Media Summit Wrap up
Here is a video from IGN about the Nintendo Media summit. There is heaps of coll looking stuff coming out for the Wii by the looks of things. not only the Wii Fit (Which I have oredered mine BTW) and Mario Kart, but also Rock Band tough it will be missing online play and downloads. Check out the video: