Please, PLEASE make a domain for your own email address.

Posted on Mon 02 November 2020 in Tech

Don’t have a me@gmail.com or us@outlook.com, have a me@myname.com instead! [Google locks people out of their accounts](https://www.businessinsider.com/google-users-locked-out-after-years-2020-10?r=US&IR=T), to me loss of my email address would be a total disaster. This is the problem with …


Continue reading

Populate Ansible from Amazon secrets manager

Posted on Thu 03 September 2020 in Tech

One of the ways to improve your security and avoid passing around env files is to follow the twelve factor app and start populating your secrets from the environment. Another improvement is to pull those secrets from a known secret store, with features like rotation, auditing etc.

Requirements


Continue reading

Better local development for Serverless Functions

Posted on Mon 11 February 2019 in Tech

Lambda is a terrific piece of kit for all the benefits listed on the AWS product page and Serverless is a very useful framework for developing Lambda functions. However, developing serverless applications locally is a total pain if what you're solving isn't totally trivial.

When things get complicated and your …


Continue reading

Easy maintenance mode with nginx

Posted on Mon 20 August 2018 in Tech

So I combined a few solutions I found online to come up with a quick way to set up maintenance mode using nginx. Ideally it shouldn't happen but in times of emergency in can be good to knock up a quick maintenance page for everyone but your own internal ips …


Continue reading

Lessons from Remote Working

Posted on Sun 18 February 2018 in Tech

For the past few years as a freelancer, I've done many forms of remote work. I've worked both part and full-time remote positions, I've also worked with teams across multiple time-zones, in locations ranging from home offices, hotdesking, even camping and crummy motels, so I have a fairly broad range …


Continue reading

Supplementing an iPad Pro with Linux

Posted on Sun 21 January 2018 in Tech

Recently I wrote about why I'm using an iPad Pro as my main "at home" machine and how I'm generally using it for tinkering around with remote servers. There is however, one caveat. I do still have an at-home server that I use for helping with making the iPad as …


Continue reading

The iPad Pro as a focused, simple coding machine

Posted on Sat 20 January 2018 in Tech

So recently I wrote a post on why a developer might use an iPad Pro as an at home machine. Today, I'm going to elaborate on how I'm actually using it day to day.

So there is not much you can do locally

Realistically, as a local dev environment there …


Continue reading

Why an iPad for a backend developer

Posted on Mon 08 January 2018 in Tech

So I'm a backend developer. I'm often closest to the source of most technical problems at my job. Networking issues, memory issues, hardware issues, operating system issues, the list goes on. I need to be able to tinker and play with things often, so usually my work environments reflect this …


Continue reading

Faster SugarCRM Development with PHPStorm

Posted on Sun 30 April 2017 in Tech

Javascript development with SugarCRM can be a bit of a pain, however combining PHPStorm's filewatcher tool with a cut down repair script can speed things up to a more tolerable level.

What this setup does is watch for any javascript changes in our custom/ folder(because you're not making core …


Continue reading

Pomot — command line pomotodo client

Posted on Thu 20 April 2017 in Tech

For anyone interested, I've created a simple pomotodo client for interacting with pomotodo.com easily.

You can find it here, feel free to use github issues for any issues or feature requests you can think of.


Command line calendars with Khal and fastmail

Posted on Tue 04 April 2017 in Tech

Recently I've been on a bit of a command line kick and I started using khal to render my calendar agenda locally.

All of the codebases used are python based so before I start I've created a virtualenv so as not to pollute my OS.

mkvirtualenv khal workon khal

Vdirsyncer …


Continue reading

SugarCRM 7 — Conditional Read Only Fields

Posted on Sat 06 February 2016 in Tech

SugarCRM has a few ways to set fields as read-only, but it leaves a lot to be desired. One of the missing features that you might need to implement is having a module flagged as read-only on the record view based on a field on the module or the result …


Continue reading

NetworkX — Get all Paths from all sources to sinks

Posted on Wed 04 November 2015 in Tech

Often when I'm working with graphs and a set of masses in a spectrum I need to be able to iterate over all paths for all sources and sinks in that graph. Especially if I'm looking to compare multiple ideal spectrums against a given spectrum. Here's some code that will …


Continue reading

Generate Binary Tree From String

Posted on Tue 27 October 2015 in tech

Recently while implementing the Small Parsimony Problem I had the need to generate a binary tree from a string in Python.

The pseudo-code in the question implicitly assumes you have some functionality that will generate a DNA sequence like CAAATCCC into a binary tree, then run SmallParsimony on it. I …


Continue reading

SugarCRM — Conditional Actions

Posted on Thu 15 October 2015 in Tech

Say you need to hide certain actions in Sugar depending on the status of a field, I've come across a great snippet of code from an awesome comment by Felix Nilam on the SugarCRM forums and wanted to show you a brief snippet of how it could work.

Make sure …


Continue reading

Bioinformatics/Rosalind — Skeleton Generator

Posted on Sun 27 September 2015 in Tech

Working through part 4 of my Cousera Bioinformatics specialisation, I decided to write a generator that creates a standardised approach to structure, write and test your algorithmic code. It also works for Rosalind problems.

Explanations are in the README. If you have any issues or are confused by anything, feel …


Continue reading

Tiddlywiki to Org-Mode

Posted on Mon 31 August 2015 in Tech

Okay, I swear this is the last document conversion script I'm writing this year. I've been on a bit of a rampage to move all of my life in Emacs Org-Mode and converting all of my Tiddlywiki notes into Org mode has been on my list for a while. Thankfully …


Continue reading

OSQA to Tiddlywiki

Posted on Mon 27 July 2015 in Tech

Recently I've been trying out Tiddlywiki as an alternative to Evernote. I decided to try convert my existing OSQA install to Tiddlywiki as I'm travelling a lot and don't always have access to my servers via the internet. Here's a python script I wrote that might help anyones trying to …


Continue reading

Verify you're hidden with conky

Posted on Sun 26 July 2015 in Tech

I run a few scripts to ensure my identity stays hidden day to day on my laptop. Here's a few conky scripts to verify things are as they should be.

VPN

Because I don't always know my ip or what my VPN's ip is, I wanted conky to display the …


Continue reading

SugarCRM 7 — Adding an action to the listview headerpanel

Posted on Sat 25 July 2015 in Tech

This tutorial should show you how to add a custom button/action that will appear across all modules. It's a little similar to this tutorial with a few changes to how the button gets rendered and the actions get called.

1. Adding the button to the headerpanel

Firstly you'll need …


Continue reading

SugarCRM — Prevent currencies getting overridden

Posted on Thu 16 April 2015 in Tech

SugarCRM has some neat features involving currency rates, but one of the more annoying ones is that Sugar will automatically update the base rate every time you save a record with a currency field attached. This can be fairly annoying default behaviour if you wish to maintain the correct record …


Continue reading

SugarCRM 7 — Roll SugarCRM with Docker

Posted on Tue 07 April 2015 in Tech

I find trying to replicate the SugarCRM environment locally a real pain. One of the main issues is simply that Sugar requires such old versions of PHP to be installed, especially compared to other web projects I have that implement the latest/greatest versions of PHP. Running multiple PHP versions …


Continue reading

Solving boot2docker's fail to start error

Posted on Sat 07 February 2015 in Tech

I'm putting this obvious solution up as I couldn't see it anywhere online.

If you try to start up boot2docker with boot2docker start and it returns.

error in run: Failed to start machine "boot2docker-vm": exit status 1

Before destroying everything and wiping your ~/Virtualbox VMs folder, try starting up Virtualbox …


Continue reading

R — Cleaning/Merging Excel files

Posted on Thu 05 February 2015 in Tech

This is just a useful snippet of code I've been using a lot to tidy up messy exports I've been getting lately.

Takes in a bunch of excel files, rewrites some variable column names in column 3 then outputs them as a list of dataframes. These then get merged into …


Continue reading

SugarCRM — Git Version Control Strategy

Posted on Mon 10 November 2014 in Tech

I've found SugarCRM an utter pain to work with in terms of version control for a number of reasons, but the most annoying is simply that certain critical elements of the SugarCRM configuration are stored on the database.

Over time I've worked out a system that circumvents this and I've …


Continue reading

Better PHP Debugging with Emacs

Posted on Thu 02 October 2014 in Tech

Recently I came across an app called CodeBug, a really nice PHP debugger for Mac. I find debugging PHP really painful within editors such as Vim or Emacs, so up until now I'd been stuck using the incredibly bloated PHPStorm.

On Emacs you can currently use Geben for debugging but …


Continue reading

Shellshock — Am I vulnerable and what do I do?

Posted on Thu 25 September 2014 in Tech

`Shellshock `__ is the latest Heartbleed level vulnerability to be discovered. It's a pretty long running exploit in how bash handles environment variables. It's a good thing to fix asap, especially if you're running any old services like telnet, ftp or an old version of apache.

Is my server vulnerable …


Continue reading

SugarCRM 7 — Fix to re-enable ElasticSearch on custom modules

Posted on Thu 18 September 2014 in Tech

I had an issue in Sugar where some custom modules refused to appear in the Global Search settings, meaning I couldn't index them in ElasticSearch.

When I checked the module oddly enough unified search would be enabled:

modules//vardefs.php

1. Re-enable the module

To force it to be re-enabled …


Continue reading

SugarCRM 7 — Enable Importing on Custom Modules

Posted on Thu 11 September 2014 in Tech

I've been wracking my brain trying to get this guide to work with SugarCRM 7. Add to the fact that it "looks" like this is also how it's done in SugarCRM 7, if you peruse the code under Accounts or Contacts. However it isn't. This is how I've added importing …


Continue reading

DOMpdf failing to render certain accented characters

Posted on Thu 21 August 2014 in Tech

I've noticed some issues with DOMpdf when trying to generate PDFs using their internal Helvetica font. After banging my head against a wall for a few hours trying to "fix" UTF-8 support, it turned out UTF-8 support was working fine. Essentially DOMpdf's internal Helvetica font didn't support a few polish …


Continue reading

Yii — Convert database to migrations

Posted on Thu 21 August 2014 in Tech

It happens to be best of us. You start a new Yii project, generate a few tables and fields, create the models in Gii and totally forget to use any migrations.

There's an easy way to move yourself to a db backed migration.

  • Put txDbMigration in your codebase.
  • Create a …

Continue reading

SugarCRM 7 — Custom subpanels

Posted on Wed 13 August 2014 in Tech

This tutorial should hopefully help you to create a new subpanel under the Contacts module in Sugar using a custom link class and driven by SugarCRM 7's new SugarQuery API.

1. Create a new link class

This should go into custom/modules//YourNewLink.php and this class will act as …


Continue reading

SugarCRM 7 — Making Ajax Requests

Posted on Sat 09 August 2014 in Tech

SugarCRM has a pretty great API if you know how to poll it. Today I'm sharing two examples of where I've needed to poll SugarCRM's API with some sample jQuery code.

A jQuery autocompleter

If you're declaring an input box and wish to autocomplete it's results based on the results …


Continue reading

SugarCRM 7 — Add a new action to a record

Posted on Thu 07 August 2014 in Tech

Odds are if you're customising SugarCRM, you will at some point need to add functionality to the records page. This article shows you a framework for creating actions on the UI, the API entrypoints to run your code and how to link it all together using SugarCRM's sidecar functionality.

1 …


Continue reading

SugarCRM — Sugar powered by Salt!

Posted on Sat 02 August 2014 in Tech

SugarCRM can be a pain to setup, especially if you are managing many installs on different servers/environments. I'm a big fan of using salt to configure my servers. I rarely manage any servers directly anymore and generally run things through my salt master. This guide should hopefully get you …


Continue reading

Log Queries with MySQL Proxy

Posted on Sat 19 July 2014 in Tech

What is it?

Have you ever found yourself wanting live statistics of you mysql database, or a log of all the erroring queries. Well MySQL Proxy might

MySQL Proxy is a simple program that sits between your client and MySQL server(s) that can monitor, analyze or transform their communication …


Continue reading

SugarCRM — Versioning Your Database

Posted on Wed 16 July 2014 in Tech

One issue that constantly re-occurs for me using SugarCRM is that certain knowledge is only stored in it's database. So say you want to revert to a previous version of Sugar and wish to obtain the Studio customisations you've done at that version, say two days ago, well your just …


Continue reading

SugarCRM 7 — Set recordlist row colours based on row data

Posted on Sat 12 July 2014 in Tech

The tutorial shows you how to do two useful things in SugarCRM 7. Firstly, how to call actions when rows get updated in SugarCRM's recordlist and secondly, how to set information based on row data. The example I have here will essentially update the table colours based on a specific …


Continue reading

Minimalist MySQL Reporting

Posted on Thu 10 July 2014 in Tech

Sometimes business folk can have crazy demands on the types of reports your system should produce and sometimes these can be really time consuming and painful to get right. Often I find the most flexible solution is to give these power-users access to tidier version of the raw data within …


Continue reading

SugarCRM 7 — Colour Code Rows based on data values

Posted on Thu 10 July 2014 in Tech

Add this into your recordlist javascript file.

javascript render_colors : function() { console.log('here'); $("tr[name^='<YOUR_MODULE']").each(function() { //loop over each row if($(this).find('div[data-original-title="Out"]').length > 0) { //check value of TD $(this).find($('td')).each(function() { $(this).css("background-color", "#FFBABA"); }); } else if($(this).find('div[data-original-title="In …


Continue reading

Your brain on stoicism

Posted on Thu 10 July 2014 in Tech

For the last few months I've been attempting to practice Stoicism and wanted to share the effects of what regular stoic practice has had. If you've never heard of Stoicism I'd recommend fourhourworkweek.com's introduction, which is very pragmatic. Essentially, what happens after several weeks of watching your emotional reactions …


Continue reading

Manage background tasks with PHP-Resque and Supervisor

Posted on Thu 03 July 2014 in Tech

PHP-Resque, the PHP equivalent to Ruby's really nice background process runner is a great way to execute long running PHP processes. Supervisor is a python-based process control system, essentially it's a convenient way to manage custom system processes you need to handle. Combining the two to manage long running PHP …


Continue reading

Simple API Mocking with Guzzle and Charles

Posted on Thu 26 June 2014 in Tech

If you've ever had to try unit test code that's dependent on external services, you'll know the pain of trying to mock-up fake API requests by hand. It's painful to setup and painful to maintain, this little tutorial attempts to make the whole process as easy as possible.

Step 1 …


Continue reading

SugarCRM — Permissions Script

Posted on Sat 21 June 2014 in Tech

I use salt quite extensively to deploy SugarCRM installs and I wanted a scriptable way to setup the correct permissions for Sugar running on a linux box. This script is based on the Sugar documentation and this handy post here.

Simply fill in your apache user details and the path …


Continue reading

Quick Salt Minion Setup

Posted on Thu 12 June 2014 in Tech

I find myself setting up salt minions a LOT. So I figured I'd write down the steps in this concise format.

On the minion

sudo add-apt-repository ppa:saltstack/salt
sudo apt-get update && sudo apt-get install salt-minion
sudo echo ' salt' >> /etc/hosts //Or whatever the salt master is
sudo salt-call -l …

Continue reading

SugarCRM 7 — Hiding subpanels based on specific criteria

Posted on Thu 12 June 2014 in Tech

The new Sugar subpanels look great but they do take up quite a lot space, without any ability to remove Subpanels via studio I've had to come up with a few ways to hide them.

Note: Original Props go to Robin Larsson who wrote the original on the Sugar Community …


Continue reading

Super simple folder backup one-liner

Posted on Fri 06 June 2014 in Tech

I needed a simple cron job, that just took backups of my project folders, should the worst happen to my laptop. Google brought up nothing obvious, so I figured I'd share it here.

tar zcvf /tmp/snap.tgz ~/Projects && rsync /tmp/snap.tgz user@remotebox:/home/backups/snap_`date +%F_ …

Continue reading

SugarCRM 7 — Adding a custom column to a list

Posted on Thu 22 May 2014 in Tech

This is the SugarCRM 7 equivalent to this post here, because Sugar has dropped the process record logic hook, we need to come up with a new solution.

Here's how you can add a new column to a list view, I have to admit this is one of the really …


Continue reading

SugarCRM 7 — Adding an action to the listview

Posted on Sun 18 May 2014 in Tech

There doesn't appear to be a documented way to do this but in SugarCRM 7 this is how I've added actions to the listview. For this example it's showing how to add a button to an animal module, which adds the animal to a related circus event.

1. Adding thebutton …


Continue reading

Find My Run — My first iPhone app

Posted on Sat 17 May 2014 in Tech

It's a pretty basic app that lists the ten nearest running events in your area. There was a few new pieces of tech(for me) involved. The app was built with Appcelerator's Alloy framework, which I must admit I quite like for rapid development of cross platform mobile apps(hopefully …


Continue reading

Owning Your Data — Replacing Dropbox

Posted on Thu 24 April 2014 in Tech

Dropbox as late has come under a fair bit of fire. They've added DMCA takedowns to personal folders, scan/open personal files and have appointed Condelleza Rice as a member of their board of directors. Which has kicked off quite a bit of backlash including a #dropdropbox tag that's gaining …


Continue reading

SugarCRM — Search for records related to the current record

Posted on Sun 20 April 2014 in Tech

Say you have two modules in Sugar: Animals and Ringmasters and they aren't directly related via a standard relationship but they are related through some convoluted means. Now, imagine if you want to override the SugarCRM search to allow you to search for all Animals indirectly related to a Ringmaster …


Continue reading

SugarCRM — Searches with data from indirectly related modules

Posted on Thu 17 April 2014 in Tech

Building modules in SugarCRM can cause you to create a boatload of unnecessary relationships, simply because it's convenient to do so. Maybe you'd have a relationship where A relates to B and B to C but you'd like to search for all A module records that relate to C. One …


Continue reading

Build Yii 1.* with composer

Posted on Tue 08 April 2014 in Tech

While we're looking forward to Yii 2 coming alive, all of the posts on please do not use it for production**. So it might be a little while before we have in-built composer awesomeness with Yii. The guide online on integrating composer with yii does not seem particularly straight-forward and …


Continue reading

SugarCRM — Add a code-driven column to a list

Posted on Sat 05 April 2014 in Tech

Sometimes you might find that you want your users to make decisions based on ListViews and you need to pull in relational data beyond the immediately related objects. Example

So using the circus example say you have performers who are performing for a specific show. You might want to see …


Continue reading

Yii issues with Homebrew PHP 5.3

Posted on Fri 04 April 2014 in Tech

When running yii with a homebrewed install of PHP 5.3, PHP code embedded in HTML wouldn't work. This is because for some inexplicable reason Homebrew's PHP install disables short-tag support. Simply edit /usr/local/etc/php/5.3/php.ini and change short-tags to On.

short_open_tag = On

Also ensure …


Continue reading

Owning Your Data — Replacing Gmail

Posted on Sat 29 March 2014 in Tech

Gmail isn't secure or private, Google have admitted this. You simply cannot expect privacy from any service that you don't have control of. Thankfully your email doesn't have to be tied a mail service like Gmail, Yahoo or Microsoft. You can simply roll your own email server with your own …


Continue reading

Useful bit of SQL to update many records in SugarCRM

Posted on Thu 27 March 2014 in Tech

UPDATE clowns SET deleted=1 WHERE id IN
 (SELECT id FROM (
 SELECT id FROM clowns WHERE deleted = 0 ORDER BY id ASC LIMIT 0, 800)
 tmp );

Owning Your Data — Initial Server Setup

Posted on Thu 06 March 2014 in Tech

So before you can move to your own self-hosted services, you'll need your own hosting. This is a really basic tutorial/set of links on getting a server up and running with Salt.

Hosting Provider

DigitalOcean is a terrific hosting company if you're want to play around with a few …


Continue reading

Owning Your Data

Posted on Thu 27 February 2014 in Tech

Governments are collecting data on you, that's a fairly accepted fact at this stage. Whether you're being "social", reading email, playing video games or even when you're writing a book on the NSA. If you want more details The Guardian has a great explanation as to what Snowden's files mean …


Continue reading

Rolling your own mail server with Salt

Posted on Sun 16 February 2014 in Tech

Recently I decided to migrate my mail server and I took this as an opportunity to better get my head around setting the whole thing up. I've used iRedmail in the past but the whole process seemed a little like magic so I took a scouring around the internets for …


Continue reading

OfflineImap to Thunderbird

Posted on Sat 08 February 2014 in Tech

Last week I moved from Debian to Linux Mint and setup Thunderbird as my new mail client(replacing mutt). Sadly for some reason Thunderbird started tanking and wiped all the mails from my mailserver without actually downloading anything.

I could've restored the mails from a backup but instead I figured …


Continue reading

Make money mining a cryptocurrency

Posted on Sat 04 January 2014 in Tech

A while back I wrote a post on my tech blog about using a tool called salt to configure your boxes to mine a crypto-currency. The currency I was mining was Anoncoin and I jokingly said it was a bit of fun that would make no money. Turns out, as …


Continue reading

Thrashing your networks download with dispatch and axel

Posted on Thu 12 December 2013 in Tech

Say you need to grab a file as fast as possible and you also happen to have a few network connections knocking about. For example maybe a separate network for your wireless and ethernet. Maybe you have a phone with tethering or a 3g dongle. This little guide will get …


Continue reading

Fixing a broken vagrant box

Posted on Thu 17 October 2013 in Tech

The first time this happened I went into a cold sweat. My box with all dev versions of my companies live databases had died. Of course I had the box provisioned with salt so configuration wasn't a problem, but grabbing all those databases, downloading, altering specific internal values and inserting …


Continue reading

Using PPAs with Salt-States

Posted on Thu 10 October 2013 in Tech

I couldn't seem to find a decent tutorial on using PPA's to manage repos with salt states so I'm documenting it here.

Say you want to install golang using these

sudo add-apt-repository ppa:duh/golang
sudo apt-get update
sudo apt-get install golang

Well, to replicate this into a salt state …


Continue reading

Making Drupal 6 Development Suck Less

Posted on Thu 03 October 2013 in Tech

So you're here. Like myself probably stuck developing for `Drupal 6 `__. All the modules on-line are for the latest and greatest versions of Drupal and you're scouring posts from 2009 to try find that deprecated module you really need. Well his post is dedicated to making your life that …


Continue reading

Connect to routers anonymously

Posted on Sat 28 September 2013 in Tech

I've created a little script that incorporates wicd, macchanger, hostname and john the ripper's password list to randomise your mac address and hostname when connecting to the internet.

I've gone with wicd over network manager as network-manager has a tendency to store connection details, so while your machine might id …


Continue reading

Explainshell

Posted on Fri 13 September 2013 in Tech

explainshell.com - match command-line arguments to their help text match command-line arguments to their help textexplainshell.com

A very nice visualization of command line args.


Salt Miner

Posted on Sat 07 September 2013 in Tech

I've just created a salt state that allows you to install a crypto-currency miner across your salt provisioned boxes. It's only tested on Ubuntu and Debian, but I intend to extend it to Archlinux(there's a lovely aur package that does all the work). Currently I'm mining anoncoins as you …


Continue reading

Unit-testing unmanaged Django models

Posted on Sat 31 August 2013 in Tech

Say you have an app with a set of models that aren't being managed by Django, you're going to run into trouble when it comes time to run unit-tests against these. What I mean is if in the model meta you have something like this

 app_label = 'your_app_label'
 managed = False
 db_table …

Continue reading

Suppling test data to django-cities

Posted on Thu 29 August 2013 in Tech

Django-Cities, is an awesome project that supplies easy to import worldwide location data and a set of very neat location models that you should really be using for any django project needing location information. I've been using it lately but ran into problems when I tried to run unit tests …


Continue reading

Archlinux Pacman Update Fix

Posted on Sun 25 August 2013 in Tech

I'm writing this up as a quick solution to archlinux's dreaded pacman update problem.

If you have yaourt installed simply update package-query through it and update pacman normally.

yaourt -S package-query
pacman -Syu

Make sure also to delete the SyncFirst option from /etc/pacman.conf


Writing Django tests for PostGis

Posted on Sat 24 August 2013 in Tech

PostGis is awesome, I think I already established this in this post. However when you start writing django tests you might start getting errors complaining that certain postgres libs cannot be found. This is because you've failed to create a proper postgres_template database for your test database to work with …


Continue reading

Install nzbget using salt

Posted on Fri 23 August 2013 in Tech

Recently I've been using vagrant to configure more and more of the local webapps I'm using day to day, simply as I find sticking all the apps I use on my host machine a little messy. I've also been picking up salt-stack with salt-states as the provisioner as I personally …


Continue reading

Octopress back to Wordpress

Posted on Thu 22 August 2013 in Tech

I've been using Octopress for the last while and it felt good having a nice fast static blog as opposed to heavy-old Wordpress. After time passed however, I noticed I wrote less. Having to grab my laptop and pull up vim to write something, then play around with git or …


Continue reading

Postgis

Posted on Mon 19 August 2013 in Tech

from cities.models import City cape_town = City.objects.filter(country__name='South Africa').get(name='Cape Town') nearest = City.objects.distance(cape_town.location).exclude(id=cape_town.id).order_by('distance')[:10000]

I must be very damaged from location data being badly implemented in MySQL. I'm still amazed that this request could be …


Continue reading

worksly.com — Find workspaces in the UK

Posted on Wed 22 May 2013 in Tech

It's online here. Hopefully people find it useful, it's got data from Foursquare, Yelp and a few other sources.

The site itself is built in Python, Bottle, Bootstrap and MySQL, though I hope to upgrade to Postgres with PostGIS when I get the time. I also want to make it …


Continue reading

Circumventing The Pirate Bay Blockade

Posted on Thu 03 May 2012 in Tech

Fuck jou, Tim Kuik _Edit description_www.fucktimkuik.org

will forward you to a number of viable options, but in case that goes down.

Download music, movies, games, software! The Pirate Bay - The world's most resilient BitTorrent… _Download music, movies, games, software and much more. The Pirate Bay is the world's …


Continue reading

Screwed Server Checklist

Posted on Sat 28 April 2012 in Tech

My servers started getting unusably slow at peak hours lately and I decided, midst panic to vaguely attempt to document the various things I had to go through to narrow down the problem, anyway I'm sticking them up here so a) I don't lose the list and b) it might …


Continue reading

Diary.py future proof memories.

Posted on Thu 08 March 2012 in Tech

I've created a little command line diary script for anyone whose interested. It stores your diaries in separate txt files so you know all of your memories will always be accessible to you in a format you'll always be able to read. It's super quick and easy to use. It's …


Continue reading

Quick vhost script

Posted on Thu 01 March 2012 in Tech

Quick script to setup a new virtualhost entry for apache. Works for me on archlinux.

#!/usr/bin/python
 import sys, os, subprocess

vhosts_file = "/etc/httpd/conf/extra/httpd-vhosts.conf"
 hosts_file = "/etc/hosts"

domain_name=sys.argv[1]
 folder=sys.argv[2]

def usage():

if (len(sys.argv) != 3):
 usage()
 sys.exit …

Continue reading

Easily remember linux commands

Posted on Sun 19 February 2012 in Tech

I use an absolute ton of awesome tools my various linux distros. The problem is I tend to forget a lot of the time how to use the tools, so I got a list of frequently used command with and a few examples of how to use them from here …


Continue reading

Simple ubuntu backup to S3

Posted on Sat 14 January 2012 in Tech

After browsing the web for ages to find a decent solution to backup my server to amazon s3 I finally came across one and I'm just throwing it up here. So basically all I need it to do was backup my sites(filesystem and mysql databases) and some config for …


Continue reading

Simple git web interface

Posted on Sat 07 January 2012 in Tech

I decided instead of springing for a monthly github payed account I'd install git on a server and use a decent web interface that could be easily installed.

So for this little guide I'm rocking ubuntu 10.04 with git and lighttpd already installed.

It was a Goldilocks search for …


Continue reading

CLI Dash

Posted on Sat 31 December 2011 in Tech

Due to being flu-ridden for the entire holiday period, I decided to write up a quick tool I've been wanting to write for ages. It's written in Python, so go easy, I'm no Python expert and I'm sick.

The tool is essentially a wee-little dashboard for your linux server.

It …


Continue reading

Good Coding Practice Snippets

Posted on Sat 24 December 2011 in Tech

After reading through Code Complete I decided to make up mind-maps on each topic in the hope that I would peruse them every so often to brush up on my programming best practice. Recently I decided take a look over them and was dismayed at the amount of knowledge from …


Continue reading

Very Simple EC2 Snapshot Management

Posted on Fri 01 April 2011 in Tech

I've been pulling my hair out trying to get a handy ec2 snapshot backup/management working. My google results have ranged from broken libraries to using bash scripts to do one aspect and php scripts to do another, all of the solutions seem to have serious issues with regions.

Anyway …


Continue reading

Music at work

Posted on Thu 13 January 2011 in Tech

For anyone bored of trying to decide what to listen to at work I'd recommend indie 103.1. Decent music and as it's in La it's 8 hours behind, so no annoying presenters during the work day(If you're in the timezone of course).

Anyway, for anyone rocking mplayer a …


Continue reading

Daily WTF — Shopping Carts

Posted on Wed 12 January 2011 in Tech

Daily WTF-Shopping Carts

Really entertaining how the writer "thought" through this solution.

Amazing.


Software Engineer

Posted on Sat 08 January 2011 in Tech

Best job of 2011

Apparently.


Intel Insider — Now hardware can screw you with copy protection.

Posted on Thu 06 January 2011 in Tech

Intel Insider-Now hardware can screw you with copy protection.

Another product I have to remember never to buy. Companies should be punished for this behaviour.


PHP and big numbers

Posted on Wed 05 January 2011 in Tech

PHP isn't friends with big numbers.

Wonder where I can stick this number to cause some serious problems.


Worryingly accurate — This is your brain on vim

Posted on Wed 05 January 2011 in Tech

This is Your Brain on Vim _la casa de kev en Interweb_kev.town


Simple ubuntu backup to S3

Posted on Mon 22 November 2010 in Tech

After browsing the web for ages to find a decent solution to backup my server to amazon s3 I finally came across one and I'm just throwing it up here.

Reqs:

So basically all I need it to do was backup my sites(filesystem and mysql databases) and some config …


Continue reading

Google History told me I'm a nerd

Posted on Thu 06 May 2010 in Tech

24000 searches later and here is my top ten sites I click to on google.

Top sites

Ubuntu Forums _A help and support forum for Ubuntu Linux._ubuntuforums.org

Wikipedia, the free encyclopedia _Allied naval bombardments of Japan during the last weeks of World War II in 1945 targeted industrial …


Continue reading

8 randomly useful php tricks

Posted on Mon 22 February 2010 in Tech

1)debug_print_backtrace() I use this one a lot, print a debug-style list of what was called to get thethe point where this function is called. Very, very useful.

2) __autoload() - Called when you attempt to load a class that hasn't been defined. the autoloader to attempt an import of xyz …


Continue reading

Sync config files over dropbox

Posted on Sun 14 February 2010 in Tech

One of the many reasons for my love of linux is the idea of keeping config information in simple texts files in the home directory of each user. It all very painless. And now with Dropbox I can have a set of application configurations stored via the web.

Using Dropbox …


Continue reading

Disable jQuery autocompleter cache

Posted on Fri 12 February 2010 in Tech

For anyone wondering how to disable the autocompleter cache in jQuery(meaning you always poll the server each time a letter is entered).

Simply set cacheLength: 0, in the autocompleter's settings. Seems obvious but my googling told me never set this value below 1 or the whole thing would explode …


Continue reading

Php Beautifier

Posted on Sat 23 January 2010 in Tech

Why?

When you're faced with an ugly PHP file(or files) with little to do but trawl through it, there is a solution.

PHP beautifier is a pear package that will process PHP files and reformat them in a (hopefully) nicer format.

Installation

You can install it using pear with …


Continue reading

Vim!

Posted on Mon 11 January 2010 in Tech

For a while now vim has been my editor of choice and only up until recently have I began to unearth it's potential. My reasoning before was that it was so cross-compatible(even working in ssh terminals) that this would always be my go-to editor. Now it's become so much …


Continue reading

Google Wave Server Admin

Posted on Wed 16 December 2009 in Tech

Download here.

What it does

Execute commands from google wave on your remote server.

How to set it up

You need python2.6 or greater, which sucks for a lot of debian users but I need it to be able to kill processes nicely.

Fill in the details required here …


Continue reading

Pseudocode Programming Process

Posted on Mon 23 November 2009 in Tech

So for the last while I've been experimenting with PPP as described in Code Complete. Jeff Atwood has a great description of it on coding horror. You should read the blog post the metaphor of pseudocode as tang is a good one. I've been using PPP for a number of …


Continue reading

Code Complete

Posted on Fri 06 November 2009 in Tech

I've been reading through Steve McConnell's Code Complete for the last few months, in fact I'm working through mindmaps of each section to traverse through this dense book in a fairly easy manner. Basically, instead of saying "Hey I need to create a new class what should I be thinking …


Continue reading

Useful Linux apps you've probably never heard of

Posted on Thu 12 June 2008 in Tech

Corkscrew

What corkscrew does is allow you to tunnel ssh connections over a http proxy very easily. As far as admins of the http proxy can see this is encrypted traffic which is most likely anssl connection to a web server(the server you have sshed to), you could in …


Continue reading

Getting yourself on Trinity's Wireless network with Linux

Posted on Sun 03 February 2008 in Tech

Since ISServices have washed their hands of any support for Linux, I've banged up a guide on how to get onto it with Linux. I'm using Ubuntu so things may need to be changed depending on your distro. :D Right, you need wpa_supplicant installed and modify it's config file /etc …


Continue reading