Blog


Installing MONO on Linux Cent OS 6

First install the dependencies, you’ll likely have some of them, but this is the full list needed to install mono. yum install bison gettext glib2 freetype fontconfig libpng libpng-devel libX11 libX11-devel glib2-devel libgdi* libexif glibc-devel urw-fonts java unzip gcc gcc-c++ automake autoconf libtool make bzip2 wget change directory to /usr/local/src: cd /usr/local/src get mono: wget […]

Read more...



Mac OS X vhosts not working after yoemite / el capitan upgrade

This is because you forgot to back up your httpd.conf… – easily fixed: First, back up the current httpd.conf: (you’ll need to be root, so either su or run the following commands with sudo) cd /etc/apache2 mv httpd.conf httpd.conf.preUpgrade mv httpd.conf~previous httpd.conf and then restart apache: apachectl restart now your local vhosts will work again.

Read more...



Move from Courier-imap to Dovecot on Cent OS6 running Plesk

First, install dovecot from the plesk panel. it will likely fail to start, and that’s due to the ssl cert not being present according to the defaults, the default config looks like this: #ssl_cert = #ssl_key = We will reuse the ssl cert used by courier, which lives in /usr/share/imapd.pem edit /etc/dovecot/dovecot.conf you’ll see the […]

Read more...



Extend Date to get an ordinal suffix

  • January 13, 2016
  • C#

Added a simple extension to the Date object as to output an ordinal suffix. using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace StuartsPlayground.App_Code { public static class DateTimeExtensions { public static string ToStringWithOrdinal(this DateTime d) { var result = “”; bool gotOne = false; switch ( d.Day % 100 ) { case 11: case […]

Read more...



Recursively counting files in a directory

find . -maxdepth 1 -type d -print0 | xargs -0 -I {} sh -c ‘echo $(find “{}” | wc -l) “{}”‘ | sort -n

Read more...



Remove query string from filename after wget

  • July 30, 2014
  • Linux

After using wget to fetch multiple files, you end up with any query strings as part of the filename, remove them: for file in *.js\?*; do mv “$file” “${file%%\?*}”; done

Read more...



Google map in hidden bootstrap tab fix

Fix google map rendering when showing bootstrap tabs $(‘a[data-toggle=”tab”]’).on(‘shown.bs.tab’, function(e) { if ( $(e.target).attr(‘href’) == ‘#map’ ) { doMap(); // your map init function here google.maps.event.trigger(map, ‘resize’); } });

Read more...



Python & MySQL on MAC OS X

Using Django. Get MySQL working with Python on Mac OS X Mavericks. The error: raise ImproperlyConfigured(“Error loading MySQLdb module: %s” % e) django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb I had previously used Pip to install PyMySQL, soon realised this was a mistake, so uninstalled that, and installed https://pypi.python.org/pypi/MySQL-python/1.2.4 instead: Download the archive, […]

Read more...



Jailbreak an old iPhone 3g with redsn0w

My old iPhone 3g has been sitting around with a broken screen for a few years now, recently found it and thought i’ll see if i can resuscitate it! No SIM (don’t need one in it) so couldn’t do a lot, jailbreak it is… (i have never jailbroken a phone before) Took some finding to […]

Read more...