home / blog

Category Archives: geek

See which packages you’ve installed Ubuntu 13.10

grep “Commandline: apt-get install” /var/log/apt/history.log Commandline: apt-get install emacs Commandline: apt-get install aptitude Commandline: apt-get install openjdk-7-jdk Commandline: apt-get install libxss1 Commandline: apt-get install gradle Commandline: apt-get install ruby Commandline: apt-get install nodejs Commandline: apt-get install gimp imagemagick Commandline: apt-get … Continue reading

Posted in geek | Tagged , | Leave a comment

Trackpad crashing on Samsung NC10 [Workaround]

In Ubuntu 13.10 I notice the trackpad freezes on occasion. This is my hacky solution for getting it going again without a reboot sudo rmmod psmouse sudo modprobe psmouse

Posted in geek | Tagged , | Leave a comment

HTTP compression of static content with .htaccess

I was originally using mod_deflate however I had the following issues Content-length was not populated which meant I couldn’t implement an AJAX progress bar Weird error net::ERR_INVALID_CHUNKED_ENCODING on OS X with Chrome on transfers bigger than 1MB – I couldn’t … Continue reading

Posted in geek | Tagged , | Leave a comment

Jasmine 2.0 + RequireJS + Blanket + Backbone

Jasmine 2.0 provides a JavaScript unit test framework, RequireJS provides a dependency modelling/loading and Blanket provides native in-browser JavaScript code coverage – no need for a coverage server etc. So why not use all three together, well, it’s kind of … Continue reading

Posted in geek | Tagged , , , | Leave a comment

Enabling Wake On Lan on an O2 wireless router (TG587n v2)

To enable wake on lan (WOL) magic packets with an O2 wireless router you need to change the routing table entry from dynamic to static, this means the entry is always present so the router recognises the IP even when … Continue reading

Posted in geek | Tagged , | Leave a comment

Ruby – latitude/longitude from start point, bearing and distance

class CoordinatesCalc def CoordinatesCalc.offset_coordinate(lat_deg, lon_deg, distance_m, bearing_deg) r = 6371000.0; lat = lat_deg * Math::PI / 180 lon = lon_deg * Math::PI / 180 bearing = bearing_deg * Math::PI / 180 distance_by_r = distance_m / r lat2 = Math.asin( Math.sin(lat) … Continue reading

Posted in geek | Tagged | Leave a comment

Rails 4.0.0 with Ruby 2.0 on a Dreamhost shared server

Build ruby from source. RVM won’t work out of the box because it tries to use sudo. It’s quite easy. cd mkdir build cd build http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz tar xzf ruby-2.0.0-p247.tar.gz cd ruby-2.0.0-p247 ./configure –prefix /home/adamish/ruby # <=== make sure you install … Continue reading

Posted in geek | Tagged , | Leave a comment

Zoneminder with Logitech C310

Bus 001 Device 002: ID 046d:081b Logitech, Inc. Webcam C310 # Add following line to /usr/bin/zmdc.pl $ENV{LD_PRELOAD} = ‘/usr/lib/x86_64-linux-gnu/libv4l/v4l1compat.so’; sudo service zoneminder restart Capture method: V4Lv2 Format: PAL Palette: YUYV Width/Height: 640/480

Posted in geek | Tagged , | Leave a comment

JavaScript debug with Chrome / Eclipse

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome –user-data-dir=$(mktemp -d /tmp/chrome-profile-XXXXX) –remote-debugging-port=9222 Add this update site http://chromedevtools.googlecode.com/svn/update/dev/

Posted in geek | Tagged , | Leave a comment

Flash in Chrome/Ubuntu 13.04 – could not load plugin [solved]

rm -rf ~/.config/google-chrome/

Posted in geek | Tagged , | Leave a comment