Skip to content

Instantly share code, notes, and snippets.

@g-r-a-v-e-l-y
g-r-a-v-e-l-y / move-torrent-files-folder-action.applescript
Last active November 4, 2022 18:56
An applescript folder action that moves downloaded torrent files to a different directory.
on adding folder items to thisFolder after receiving added_items
mount volume "afp://user@host/share"
delay 1
repeat with addedFile in added_items
tell application "Finder"
if (the name of the addedFile ends with "torrent" or "nzb") then
display notification "Queueing " & (name of addedFile) & "."
try
tell application "Finder"
move addedFile to "spool" with replacing
@g-r-a-v-e-l-y
g-r-a-v-e-l-y / autoexec
Created February 22, 2012 16:02
An ioquake3 config for a 13-inch, Mid 2011 MacBook Air
// _ ______ _ __ __ ____ _ _ _
// / |___ ( | ) | \/ | __ _ ___| __ ) ___ ___ | | __ / \ (_)_ __
// | | |_ \V V | |\/| |/ _` |/ __| _ \ / _ \ / _ \| |/ / / _ \ | | '__|
// | |___) | | | | | (_| | (__| |_) | (_) | (_) | < / ___ \| | |
// |_|____/ |_| |_|\__,_|\___|____/ \___/ \___/|_|\_\ /_/ \_\_|_|
// _ _ _____
// (_) ___ __ _ _ _ __ _| | _____|___ /
// | |/ _ \ / _` | | | |/ _` | |/ / _ \ |_ \
// | | (_) | (_| | |_| | (_| | < __/___) |
@g-r-a-v-e-l-y
g-r-a-v-e-l-y / gist:4132419
Created November 22, 2012 18:10
ImageMagick up a kindle ""screen saver"" from a source tile
composite -tile pattern.gif -size 600x800 -monochrome xc:none lock-screen.png
@g-r-a-v-e-l-y
g-r-a-v-e-l-y / paperwhite-background-generator
Created December 8, 2012 19:16
fish script to generate kindle paperwhite images from k10k.net tiles
set index 0
for file in (ls *gif)
set index (math $index + 1)
composite -tile $file -size 758x1024 -colorspace gray xc:none bg_medium_ss0$index.png
end
echo Copy the bg_medium_ss0#.png images into /usr/share/blanket/screensaver/ on your Kindle.
@g-r-a-v-e-l-y
g-r-a-v-e-l-y / rsyslog.conf
Created January 13, 2013 20:18
super-simple rsyslog.conf for remote log collection and only remote log collection
# /etc/rsyslog.conf Configuration file for rsyslog.
#
# For more information see
# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html
#
# Default logging rules can be found in /etc/rsyslog.d/50-default.conf
#################
#### MODULES ####
@g-r-a-v-e-l-y
g-r-a-v-e-l-y / gist:4573811
Created January 19, 2013 17:27
Sublime Text 2 package listing
grant@scribble ~/L/A/S/Packages> pwd
/Users/grant/Library/Application Support/Sublime Text 2/Packages
grant@scribble ~/L/A/S/Packages> ls -m
ASP, ActionScript, AppleScript, Batch File, C#, C++, CSS, CSSFormat, CSSTidy, CSV, Clojure,
Color Scheme - Default, D, Default, Diff, Dotfiles Syntax Highlighting, Erlang, Git, Go, Graphviz, Groovy,
HTML, Haskell, INI, Java, JavaScript, LaTeX, LaTeXTools, Language - English, Lisp, Lua, Makefile, Markdown,
Markdown Preview, Matlab, Minifier, OCaml, Objective-C, PHP, Package Control, Perl, Python,
Python PEP8 Autoformat, PythonTidy, QuickLook, R, Rails, Regular Expressions, RestructuredText, Ruby, SQL,
Scala, ShellScript, SublimeBlockCursor, SublimeCodeIntel, SublimeLinter, TCL, Tag, Text, Textile,
Theme - Aqua, Theme - Default, Theme - Soda, TidyHTML5, Tomorrow Color Schemes, User, Vintage, XML, YAML,
@g-r-a-v-e-l-y
g-r-a-v-e-l-y / gist:5657772
Created May 27, 2013 15:56
A very silly full screen "most recent tweet" gag.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Devops Wisdom</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script>
function GetLastTweet(UserName) {
url = 'http://api.twitter.com/1/statuses/user_timeline/' + UserName + '.json?callback=?';
$.getJSON(url, function (tweet) {
$("#tweet").html(tweet[0].text);
});
@g-r-a-v-e-l-y
g-r-a-v-e-l-y / gist:5657778
Created May 27, 2013 15:57
A very silly "turn chrome into a full screen kiosk and tab-rotate it with applescript" waste of time.
## settings
set lag to 120
set sites to {"http://nyan.cat", "http://grantstavely.com/files/borat.html"}
## functions
on tab_toggle(lag, sites)
set siteCount to count sites
tell application "System Events"
## lame hacks abound
@g-r-a-v-e-l-y
g-r-a-v-e-l-y / gist:5918037
Created July 3, 2013 13:55
iTerm2 -> mosh -> remote xterm-256color with mouse support in tmux, vim, weechat, etc. Hold option to release.
# https://github.com/keithw/mosh/issues/101
# thanks FiXato!
perl -E ' print "\e[?1005h\e[?1002h" '
@g-r-a-v-e-l-y
g-r-a-v-e-l-y / default.vcl
Created July 14, 2013 03:46
An example varnishd config virtual hosting backend services on localhost that are on non-standard ports, because memorizing ports for things is dumb (and so is /etc/services).
backend splunk{
.host = "127.0.0.1";
.port = "8000";
}
backend archiveteam{
.host = "127.0.0.1";
.port = "8001";
}