Skip to content

Instantly share code, notes, and snippets.

@jmar71n
jmar71n / gnome-shell-extension-weather-location-updater.sh
Created June 5, 2011 15:05
Location updater script for laptop users using gnome-shell-extension-weather. Script gets location based on surrounding wireless access points, then converts that into a woeid.
#!/bin/bash
# gnome-shell-extension-weather-location-updater.sh is free software: you
# can redistribute it and/or modify it under the terms of the GNU General
# Public License as published by the Free Software Foundation, either version
# 3 of the License, or (at your option) any later version.
#
# gnome-shell-extension-weather-location-updater.sh is distributed in the hope
# that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@jmar71n
jmar71n / handler.sh
Created May 16, 2011 10:10
acpi handler.sh script for IBM x41 / X41T
#!/bin/bash
set $*
case "$1" in
ibm/hotkey)
case "$4" in
00001004)
/usr/sbin/pm-suspend
;;
@jmar71n
jmar71n / harvard.UEL.csl
Created February 17, 2011 18:01
harvard.UEL.csl
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0">
<info>
<title>Harvard Reference format (Adapted for UEL)</title>
<id>http://www.zotero.org/styles/harvard1</id>
<link href="http://www.zotero.org/styles/harvard1" rel="self"/>
<author>
<name>Julian Onions</name>
<email>julian.onions@gmail.com</email>
<name>Jason Martin</name>
#!/bin/bash
# Possibly use dedicated user...
#useradd vmadmin
#passwd vmadmin
echo "Virtualbox VMguest setup script"
echo
echo -n "unique VM guestname: "
#!/bin/bash
## Usage: ./socks-retry server.example.com
## Use key authentication
# ----------------------------- ssh Options ------------------------------------------------
PORT=2048
# -------------------- Shouldn't need to change anything bellow -------------------------------
#!/bin/bash
# Automatically sort TV Eppisodes/Series for XBMC Libary
# using Standard naming convention at http://wiki.xbmc.org/index.php?title=TV_Shows_(Video_Library)
# ie. /destination/directory/SERIES/SEASON NO./EPISODE
SOURCE=/source/directory
DEST=/destination/directory
############################################################################
@jmar71n
jmar71n / rsync-backup.sh
Created May 3, 2010 10:57
incremental backup script for multiple computers and efficient use of disk space. Backups are based on a backup interval and no. of backups to keep.
#!/bin/bash
## incremental rsync backup script
## run hourly via cron, will take a back up every 24hrs for up to 7days.
## efficent use of space using hard links
## can handle computers been turned on / off
## executes n backup processes in parallel
# ------------- computers to backup -----------------------------------
# IP Address or fully qualified names here + remote backup directory
@jmar71n
jmar71n / bash timer
Created April 28, 2010 17:41
bash timer script
#!/bin/sh
# Section to timed between START an FINISH...
START=$SECONDS
echo "sleep 30s"
sleep 30s
FINISH=$SECONDS
@jmar71n
jmar71n / rsync-retry.sh
Created April 14, 2010 20:06 — forked from iangreenleaf/rsync-retry.sh
Runs rsync, retrying on errors up to a maximum number of tries.
#!/bin/bash
### ABOUT: See: http://gist.github.com/366269
### Runs rsync, retrying on errors up to a maximum number of tries.
### On failure script waits for internect connection to come back up by pinging google.com before continuing.
###
### Usage: $ ./rsync-retry.sh source destination
### Example: $ ./rsync-retry.sh user@server.example.com:~/* ~/destination/path/
###
### INPORTANT: