-
Go to https://developer.apple.com/downloads/index.action and search for "Command line tools" and choose the one for your Mac OSX
-
Go to http://brew.sh/ and enter the one-liner into the Terminal, you now have
brewinstalled (a better Mac ports) -
Install transmission-daemon with
brew install transmission -
Copy the startup config for launchctl with
ln -sfv /usr/local/opt/transmission/*.plist ~/Library/LaunchAgents
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
| // A small SSH daemon providing bash sessions | |
| // | |
| // Server: | |
| // cd my/new/dir/ | |
| // #generate server keypair | |
| // ssh-keygen -t rsa | |
| // go get -v . | |
| // go run sshd.go | |
| // | |
| // Client: |
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
| "use strict" | |
| api1 = | |
| a: (x,y,z,cb) -> setTimeout cb.bind(null, null, x+y+z+1), 500 | |
| b: (x,y,z,cb) -> setTimeout cb.bind(null, null, x+y+z+2), 500 | |
| api2 = | |
| b: (x,y,z,cb) -> setTimeout cb.bind(null, null, x+y+z+3), 500 | |
| c: (x,y,z,cb) -> setTimeout cb.bind(null, null, x+y+z+4), 500 | |
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
| package main | |
| import ( | |
| "log" | |
| "net/smtp" | |
| ) | |
| func main() { | |
| send("hello there") | |
| } |
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 | |
| # given "https://www.icloud.com/iclouddrive/<ID>#<Filename> | |
| ID="...." | |
| URL=$(curl 'https://ckdatabasews.icloud.com/database/1/com.apple.cloudkit/production/public/records/resolve' \ | |
| --data-raw '{"shortGUIDs":[{"value":"$ID"}]}' --compressed \ | |
| jq -r '.results[0].rootRecord.fields.fileContent.value.downloadURL') | |
| curl "$URL" -o myfile.ext |
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
| # $ apt install rdiff | |
| # $ rdiff --help | |
| # Usage: rdiff [OPTIONS] signature [BASIS [SIGNATURE]] | |
| # [OPTIONS] delta SIGNATURE [NEWFILE [DELTA]] | |
| # [OPTIONS] patch BASIS [DELTA [NEWFILE]] | |
| # Options: | |
| # -v, --verbose Trace internal processing | |
| # -V, --version Show program version | |
| # -?, --help Show this help message |
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 | |
| #set these in your environment/profile (NOT HERE) | |
| AWS_ACCESS_KEY="" | |
| AWS_SECRET_KEY="" | |
| function s3get { | |
| #helper functions | |
| function fail { echo "$1" > /dev/stderr; exit 1; } | |
| #dependency check |
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
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "net" | |
| "time" | |
| "github.com/hashicorp/yamux" | |
| ) |
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
| //dijkstra solve graph starting at s | |
| function solve(graph, s) { | |
| var solutions = {}; | |
| solutions[s] = []; | |
| solutions[s].dist = 0; | |
| while(true) { | |
| var parent = null; | |
| var nearest = null; | |
| var dist = Infinity; |
NewerOlder