Skip to content

Instantly share code, notes, and snippets.

View telekineticyeti's full-sized avatar

Paul Castle telekineticyeti

  • Aberdeen, Scotland
View GitHub Profile
@telekineticyeti
telekineticyeti / Default.sublime-keymap
Last active December 20, 2015 15:18
Sublime Text 2 - Keyboard bind settings that initialize various panel layouts; from simple 2x horizontal / vertical panels, to 4/6/8x panels in grid formation.To use: select "preferences > Key bindings - User" in your ST2 menu and paste / save/
[
{ "keys": ["ctrl+g"], "command": "toggle_status_bar" },
{
"keys": ["ctrl+r"],
"command": "toggle_setting",
"args":
{
"setting": "line_numbers",
"setting": "gutter"
}
@telekineticyeti
telekineticyeti / ps1.sh
Created June 5, 2013 14:57
My bash prompt
export PS1="\[\e[30;1m\][\[\e[36;1m\]\u@\h\[\e[30;1m\]]-[\[\[\e[33;1m\]\w\[\e[30;1m\]]-[\[\e[31;1m\]\$(/bin/ls -1 | /usr/bin/wc -l | /bin/sed 's: ::g') items, \$(/bin/ls -lah | /bin/grep -m 1 total | /bin/sed 's/total //')b\[\e[30;1m\]]-{\[\e[37;1m\]\j\[\e[30;1m\]}-[\[\e[37;1m\]\@\[\e[30;1m\]]\n\[\e[0m\]\$ "
@telekineticyeti
telekineticyeti / bash_alias.sh
Created June 5, 2013 14:55
A list of my common bash shell aliases. Place in ~/.bash_aliases
# Clear term
alias cls='clear'
# Keep 1000 lines in .bash_history (default is 500)
export HISTSIZE=1000
export HISTFILESIZE=1000
#Stop bash from caching duplicate lines.
HISTCONTROL=ignoredups
@telekineticyeti
telekineticyeti / freeDNS.py
Created June 4, 2013 12:19
Python script to update your FreeDNS account with your new IP
#!/usr/bin/python
# This script is an adaption of Jeremy Blythe's script (http://jeremyblythe.blogspot.co.uk/2012/05/python-freedns-client-on-raspberry-pi.html)
# It will update FreeDNS using multiple keys if you have "Link updates of the same IP together" Disabled.
import urllib2
import os.path
FREEDNS_URL = 'http://freedns.afraid.org/dynamic/update.php?'
OLDIP_FILE = '/var/lib/misc/oldip'
@telekineticyeti
telekineticyeti / floatingClock.js
Created May 29, 2013 13:50
JQuery clock routine for adding a time/date element to the page that updates every second.
/*
JQuery clock routine for adding a time/date element to the page that updates every second.
*/
jQuery(document).ready(function(){
jQuery.noConflict();
function clockUpdate() {
var myDate = new Date();
var displayDate = (myDate.getDate()) + '/' + (myDate.getMonth()+1) + '/' + myDate.getFullYear();
var displayTime = (myDate.getHours()) + ':' + (myDate.getMinutes()<10?'0':'') + (myDate.getMinutes()) + ':' + (myDate.getSeconds∏()<10?'0':'') + (myDate.getSeconds());
@telekineticyeti
telekineticyeti / py_lftp.py
Created September 5, 2012 18:57
Python shell script that utilizes the excellent LFTP to create a mirror between a local directory and a remote ftp site.
#!/usr/bin/python
'''
©2012 Paul Castle
Very crude but functional early edition, will expand in the future.
I run this script on a 3 day cron to keep my personal wiki backed up to my
local development server. LFTP is very good at retaining permissions between
mirrors.
User/pass variables require base64 encoded attributes to avoid shoulder-surfers.