This file contains 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/sh | |
# place in /etc/NetworkManager/dispatcher.d/50-autologin | |
if [ "$1" = "wlan0" ] | |
then | |
case "$2" in | |
up) | |
case "$CONNECTION_ID" in | |
WirelessMississauga) | |
curl -so/dev/null --interface "$1" -m60 http://1.1.1.1/login.html -d buttonClicked=4;; | |
esac;; |
This file contains 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/sh | |
# Copies local X11 secondary buffer to the Android clipboard. | |
# Useful for debugging. | |
delay=3000 | |
login=my-android-ssh-name # ssh $login or adb $login shell should log you in | |
while getopts 't:q' opt | |
do | |
case $opt in | |
h) |
This file contains 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/sh | |
# Copies the Android clipboard to local X11 secondary buffer. | |
# Useful for debugging. | |
limit=33 | |
delay=3000 | |
login=my-android-ssh-name # ssh $login or adb $login shell should log you in | |
while getopts 't:h:q' opt | |
do | |
case $opt in |
This file contains 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/sh | |
# Copyright (c) 2013, Ted Ying | |
# Permission is hereby granted, without written agreement and without | |
# license or royalty fees, to use, copy, modify, and distribute this | |
# software and its documentation for any purpose, provided that the | |
# above copyright notice and the following two paragraphs appear in | |
# all copies of this software. | |
# | |
# IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR | |
# DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES |
This file contains 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/python | |
from scipy.signal import * | |
from cv2 import * | |
from numpy import * | |
cap=VideoCapture(0) | |
cc=CascadeClassifier("/usr/share/OpenCV/haarcascades/haarcascade" | |
"_frontalface_default.xml") | |
face=imread("joshua_kalpin.png") | |
while cap.grab(): | |
frame=cap.retrieve()[1] |
This file contains 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
[Unit] | |
Description=Sync Intel backlight interface to ACPI | |
After=-.mount | |
[Service] | |
ExecStart=/usr/local/bin/sync-acpi-intel.sh |
This file contains 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
// ==UserScript== | |
// @name Inline equation preview | |
// @namespace localhost | |
// @description Inline equation preview for MapleTA equation editor | |
// @include https://maple-ta.uwaterloo.ca/mapleta/modules/* | |
// @version 0.1 | |
// @grant none | |
// @require http://userscripts.org/scripts/source/68059.user.js | |
// ==/UserScript== |
This file contains 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
// ==UserScript== | |
// @name lyrics for Astral Radio player | |
// @description Check http://proxy.amri.ca/ or https://en.wikipedia.org/wiki/Bell_Media_Radio for a list | |
// @namespace localhost | |
// @include http://player.chumfm.com/ | |
// @version 0.1 | |
// @grant GM_xmlhttpRequest | |
// ==/UserScript== | |
addEventListener("load",function(){ |
This file contains 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
waiter_list() { | |
hk psql -a r101-cedar -c "SELECT * FROM pg_stat_activity WHERE extract(epoch from now() - xact_start) > 60 * 10 AND state = 'idle in transaction'" | |
} | |
waiter_cancel() { | |
hk psql -a r101-cedar -c "SELECT pid, pg_cancel_backend(pid) FROM pg_stat_activity WHERE extract(epoch from now() - xact_start) > 60 * 10 AND state = 'idle in transaction'" | |
} | |
waiter_terminate() { | |
hk psql -a r101-cedar -c "SELECT pid, pg_terminate_backend(pid) FROM pg_stat_activity WHERE extract(epoch from now() - xact_start) > 60 * 30 AND state = 'idle in transaction'" |
This file contains 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
# solution for: | |
# https://stackoverflow.com/questions/12544056/how-to-i-get-the-current-ipython-notebook-name | |
# | |
# aimed at: | |
# IPython 4.3.0 | |
''' | |
Library for getting the name of a Jupyter notebook from within an IPython | |
kernel launched for the notebook. | |
Probably doesn't work on OS X. | |
Usage: |