-
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
brew
installed (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 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 ( | |
"io" | |
"log" | |
"net" | |
"os" | |
) | |
const ( |
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
const MAX_INFLIGHT = 4; | |
const TOTAL = 100; | |
// the given dummy api supports a maximum of 4 of inflight requests. | |
// the given code is correct, but it is slow because it processes elements serially. | |
// your task is to process 100 elements as fast as possible. | |
// run this code with "node/bun test.js". | |
// it should print "pass". | |
// no external dependencies are allowed. | |
async function run(elements) { | |
// ============ |
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/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 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 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 -euf -o pipefail | |
if [ ! -f code-server ]; then | |
ARCH=$(uname -m) | |
OS="unknown-linux-gnu" | |
echo "downloading code-server ($ARCH-$OS)" | |
URL="https://vscodeserverlauncher.blob.core.windows.net/builds/latestbin/$ARCH-$OS/$ARCH-$OS" | |
curl -L "$URL" >code-server | |
chmod +x code-server |
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
# $ 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 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 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 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 |
NewerOlder