This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var map = document.getElementById('map'); | |
var error = document.getElementById('error'); | |
var urlstub = "http://www.openstreetmap.org/export/embed.html?"; | |
function updateMap() { | |
var request = new XMLHttpRequest(); | |
request.open('GET', 'latitudefile.txt', true); | |
request.onload = function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
description "Profile Sync Daemon" | |
start on desktop-start | |
stop on desktop-end | |
post-start exec sudo /usr/bin/psd sync | |
post-stop exec sudo /usr/bin/psd unsync |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 1. Find all the packages that have installed something in /boot | |
# 2. Trim it down to just the kernel packages (e.g. remove memtest) | |
# 3. Sort them oldest->newest | |
# 4. Remove the newest (so we've got the updated kernel to boot into) | |
# 5. Remove the current kernel (so we can go back to that if the new one fails) | |
# 6. Pass the package list to apt-get remove for uninstallation | |
# Note: This code will only simulate removal. Remove -s flag from apt-get to do it for real. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Input driver version is 1.0.1 | |
Input device ID: bus 0x3 vendor 0x1a34 product 0xf705 version 0x110 | |
Input device name: "HuiJia USB GamePad" | |
Supported events: | |
Event type 0 (EV_SYN) | |
Event type 1 (EV_KEY) | |
Event code 288 (BTN_TRIGGER) | |
Event code 289 (BTN_THUMB) | |
Event code 290 (BTN_THUMB2) | |
Event code 291 (BTN_TOP) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ruby /usr/local/bin/post-record.rb >> /home/xbmc/wakeup.log 2>&1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Executing Wakeup Script" >> /home/xbmc/wakeup.log | |
echo $1 >> /home/xbmc/wakeup.log | |
echo 0 > /sys/class/rtc/rtc0/wakealarm | |
echo $1 > /sys/class/rtc/rtc0/wakealarm | |
cat /sys/class/rtc/rtc0/wakealarm >> /home/xbmc/wakeup.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# hwclock-save - save system clock to hardware clock | |
# | |
# This task saves the time from the system clock back to the hardware | |
# clock on shutdown. | |
description "save system clock to hardware clock" | |
start on runlevel [06] | |
task |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'net/http' | |
require 'json' | |
uri = URI 'http://localhost:8080/jsonrpc' | |
jsonrpc = Net::HTTP::Post.new uri | |
jsonrpc.add_field 'Content-Type', 'application/json' | |
jsonrpc.add_field 'Accept', 'application/json' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Previous solution used Pipelight, which was much nicer. However, since Amazon ate Lovefilm, the player doesn't work with pipelight. So.. | |
2 Profiles: | |
xbmc (XBMC session, auto login, no password) | |
lovefilm (Openbox session, no password) | |
Menu item in XBMC triggers session switch to Lovefilm (uses dm-tool) | |
On login, Lovefilm automatically launches Windows 7 VM in virtualbox, full screen, automatically logs in and runs Firefox fullscreen (or just loads saved state if there is one). | |
User watches stuff with silverlight. When finished, they close VirtualBox using "X" icon on pop-up menu bar. | |
When Virtualbox is closed, dm-tool is automatically invoked to return user to XBMC, and all remaining processes belonging to lovefilm are killed with pkill. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function throw_exception() { | |
// Arbitrary code here | |
throw new Exception('Hello, Joe!'); | |
} | |
function some_code() { | |
// Arbitrary code here | |
} |