___ ___ ____ __ __ ______ __ __ _____ _____ ( ( ) ) ( ) ) ) ( ( (____ \ \ \ / / ( __ \ )__ \ \ \ _ / / / /\ \ ( ( ) ) ) / () \/ () ) )_) ) __) / \ \/ \/ / ( (__) ) \ \ / / __ / / / _ _ \ ( ___/ (__ ( ) _ ( ) ( \ \/ / / \/ / __ / / \/ \ \ ) ) \ \ \ ( ) / / /\ \ \ / ( () \__/ / /_/ \_\ ( ( ___/ ) \_/ \_/ /__( )__\ \/ \__\____( (/ \) /__\ )____/
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
archive() { | |
if [ ! -d "$1" ]; then echo Missing base; return 1; fi | |
local BASE=$1 | |
for f in "${@:2:$#-1}"; do | |
if [ -d "$f" ]; then continue; fi; | |
local DATE=`date -r "$f" "+%Y-%m-%d"` | |
local YEAR=`date -r "$f" "+%Y"` | |
local TARGET_DIR="$BASE/$YEAR/$DATE" | |
mkdir -p $TARGET_DIR | |
echo cp -iv "$f" "$TARGET_DIR/" |
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/python3 | |
""" | |
The idea is to take stdin, and write it to a new unique log file | |
php myscript.php | newlog filename | |
""" | |
import os | |
import sys |
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
<?php include 'protect.php';?> | |
<!DOCTYPE html> | |
<html> | |
<head></head> | |
<body>Secrets. </body> | |
</html> |
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 | |
wget --no-verbose --mirror --convert-links --directory-prefix=dwebsummit-download --no-host-directories https://decentralizedweb.net | |
rsync -vv --recursive --links --perms --checksum --ignore-times --exclude={.dat,dat.json} dwebsummit-download/ dwebsummit-dat/ |
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
Here are the exact parts I used: | |
USB HOST - This has all the software pre-installed. Just need to wire it up. | |
1x $16.76 http://www.hobbytronics.co.uk/usb-host-midi | |
MIDI Breakout board - This handles the extra components needed to wire up midi | |
1x $11.95 http://www.amazon.com/ubld-it-MIDI-Breakout-Board/dp/B00YDLVLVO/ref=sr_1_1?ie=UTF8&qid=1464058935&sr=8-1&keywords=midi+breakout | |
Power - Needed a usb-power breakout board and a power supply | |
1x $1.50 https://www.adafruit.com/products/1764 |
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
import httplib2 | |
from apiclient.discovery import build | |
from oauth2client.client import AccessTokenCredentials | |
def connect_helper(user): | |
c = user.social_auth.get(provider='google-oauth2') | |
access_token = c.tokens['access_token'] | |
credentials = AccessTokenCredentials(access_token, 'my-user-agent/1.0') | |
http = httplib2.Http() |
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
<?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>CFBundleDocumentTypes</key> | |
<array> | |
<dict> | |
<key>CFBundleTypeExtensions</key> | |
<array> | |
<string>txt</string> |
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
<?php | |
function add_cache($key, $value, $ttl) { | |
$dir = __DIR__.'/../cache/'; | |
// Remove slashes for security | |
$filename = $dir . str_replace('/', '', $key); | |
// Store expiry in first line | |
$lines = [(string)(time() + (int)$ttl), $value ]; | |
if (!file_exists($dir)) mkdir($dir, 0755, true); | |
file_put_contents($filename, implode("\n", $lines)); |
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 | |
# | |
# Easily start/stop sshuttle | |
# | |
# <bitbar.title>sshuttle</bitbar.title> | |
# <bitbar.version>v1.0</bitbar.version> | |
# <bitbar.author>richard@archive.org</bitbar.author> | |
# <bitbar.author.github>rchrd2</bitbar.author.github> | |
# <bitbar.desc>Easily start/stop a background shhuttle.</bitbar.desc> | |
# <bitbar.image></bitbar.image> |