Skip to content

Instantly share code, notes, and snippets.

View AaronJackson's full-sized avatar
📟
writing yaml

Aaron S. Jackson AaronJackson

📟
writing yaml
View GitHub Profile
@AaronJackson
AaronJackson / .profile
Last active December 10, 2015 09:29
My .profile file
# Hmm... Colours
Black="\[\033[0;30m\]" Red="\[\033[0;31m\]" Green="\[\033[0;32m\]" Cyan="\[\033[0;36m\]"
Yellow="\[\033[0;33m\]" Blue="\[\033[0;34m\]" Purple="\[\033[0;35m\]" White="\[\033[0;37m\]"
# MacPorts
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Web Development
export PATH=/Development:$PATH
export PATH=/Development/php5/bin:$PATH
export PATH=/Development/mysql/bin:$PATH
@AaronJackson
AaronJackson / gist:5061397
Last active December 14, 2015 08:59
Updating many events in iCal
set theEvents to {}
tell application "Calendar"
tell calendar "Calendar"
set theEvents to every event whose summary contains "IDM-" or summary contains "ICP-"
repeat with theEvent in theEvents
tell theEvent
set location to "Dean Street, Bangor, Gwynedd, UK"
end tell
@AaronJackson
AaronJackson / gist:5743647
Created June 9, 2013 13:56
Simple shell function for quickly pushing a file to a web server. Link is copied into pasteboard for your convenience. :)
function pushfile
{
extension="${1##*.}"
newname=`md5 ${1} | awk '{print $4}'`'.'$extension
cp ${1} $newname
scp $newname root@serveraddress.co.uk:/var/www/blahblahblah/p/
rm -f $newname
echo 'http://serveraddress.co.uk/p/'$newname
echo 'http://serveraddress.co.uk/p/'$newname | pbcopy
}
var Bookmark = function (url, name, tag) {
this.url = url;
this.name = name;
if (tag) this.tags = [tag];
else this.tags = [];
};
Bookmark.list = [];
Bookmark.push = function (p) { Bookmark.list.push(p) };
@AaronJackson
AaronJackson / gpgview
Created August 29, 2013 20:11
Quick and messy bash script for viewing plain text files encrypted with GPG
#!/bin/bash
GPG_ID=`gpg --list-secret-keys | grep "sec " | awk '{ print $2 }' | awk -F '/' '{ print $2 }'`
DATA=`cat $1 | gpg -d -r $GPG_ID`
clear
printf '%*s\n\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' -
clear all
p = [ 4 5 6 7 8 9 10 11 12 13 14 ];
timings = [];
for i = 1:length(p)
load( sprintf('timings/%i_localizer.mat', p(i) ) );
@AaronJackson
AaronJackson / gist:7554807
Created November 19, 2013 23:54
Used to update hard links based on a file called links. Requires hlink and hulink. I'm using this to put the music I want to sync to my phone into a specific directory, as BitTorrent Sync does not follow symlinks.
#!/bin/bash
cd "/Volumes/Marceline/MusicSync/"
# first unlink files which have been removed
for artist in *; do
if [ -d "$artist" ]; then
if ! grep -Fxq "$artist" "links" ; then
echo Unlinking $artist
hulink "$artist"
set mouse=a
set nocompatible
filetype indent plugin on
syntax on
set hidden
set ignorecase
set smartcase
set backspace=indent,eol,start
@AaronJackson
AaronJackson / sent_mail_vis.m
Created April 2, 2015 00:23
MATLAB Visualise Sent Email - 24 Hour Clock
clear all
close all
clc
% dump from zimbra and run
% grep -r "^Date: " ./Sent* > Sent.list
regs = ...
['(?<day_named>(Mon|Tue|Wed|Thu|Fri|Sat|Sun))' ',\s' ...
'(?<day>[0-9][0-9]*)' '\s' ...
@AaronJackson
AaronJackson / Cameras
Created May 29, 2015 20:39
Tile four VLC windows. Used to view RTSP security cameras
xset dpms 0 0 0
xset -dpms
xset s noblank
xset s noexpose
killall -9 vlc
export WINOPTS="--disable-screensaver --width=960 --height=540 --no-embedded-video"
vlc --video-title TopLeft \