Skip to content

Instantly share code, notes, and snippets.

@g-r-a-v-e-l-y
g-r-a-v-e-l-y / org.archiveteam.warrior.plist
Created August 21, 2013 14:09
Run ArchiveTeam's Warrior automatically, headlessly. launchctl load -w ~/Library ~/Library/LaunchAgents/org.archiveteam.warrior.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.archiveteam.warrior</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/VBoxHeadless</string>
<string>-s</string>
#!/bin/sh
# toggle http://code.google.com/p/macosx-nosleep-extension/
/usr/local/bin/NoSleepCtrl -s 1,1
#!/bin/sh
# toggle http://code.google.com/p/macosx-nosleep-extension/ off
/usr/local/bin/NoSleepCtrl -s 0,0
### Keybase proof
I hereby claim:
* I am grantstavely on github.
* I am grantstavely (https://keybase.io/grantstavely) on keybase.
* I have a public key whose fingerprint is B6B2 B7DB 961B 290C 5F33 1725 A067 55D6 88AF 5060
To claim this, I am signing this object:
@g-r-a-v-e-l-y
g-r-a-v-e-l-y / URL!.js
Created December 24, 2015 15:51
A Safari bookmarklet to alert the URL with no anchors or parameters. Make your first favorite to use with Option-Command-1.
javascript:(function(){%20%20%20%20alert(document.location.protocol%20+"//"+%20document.location.hostname%20+%20document.location.pathname)})();
@g-r-a-v-e-l-y
g-r-a-v-e-l-y / add-file-to-torrent-or-nzb-queue.applescript
Last active May 30, 2022 14:39
I use Transmission and sabnzbd behind a basic auth http proxy kinda like this now
on adding folder items to thisFolder after receiving added_items
repeat with addedFile in added_items
tell application "Finder"
if (the name of the addedFile ends with "torrent") then
set transmissionRemote to "/usr/local/bin/transmission-remote https://TRANSMISSION_HOST/transmission -n 'USERNAME:PASSWORD' --add '" & POSIX path of addedFile & "' | sed 's/\"//g' | grep -oE '[^ ]+$'"
set fileName to name of (info for addedFile)
display notification fileName with title "Torrent Janitor - Queueing Torrent"
set transmissionResponse to do shell script transmissionRemote
display notification fileName with title "Torrent Janitor - " & transmissionResponse
tell application "Finder"