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
| #!/usr/bin/env bash | |
| set -e | |
| url="$1" | |
| temp_dir=$(mktemp -d /tmp/yt.XXXXXXXXXXXXX) | |
| validate_url() { | |
| if [ -z $url ]; then | |
| echo 'Usage: yt [url]' | |
| exit 0 |
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
| --- | |
| - :code: AED | |
| :description: UAE Dirham | |
| :notes: "United Arab Emirates" | |
| - :code: AFA | |
| :description: Afghani | |
| :notes: "Afghanistan. DEPRECATED, replaced by AFN" | |
| - :code: AFN | |
| :description: Afghani | |
| :notes: "Afghanistan (prices normally quoted as integers)" |
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
| require 'benchmark' | |
| require 'bcrypt' | |
| (5..15).to_a.each do |i| | |
| bm = Benchmark.measure { BCrypt::Password.create('I have a hairy cat', cost: i) } | |
| puts "cost: #{i} \t #{bm}" | |
| end | |
| #=> cost: 5 0.010000 0.000000 0.010000 ( 0.001988) | |
| #=> cost: 6 0.000000 0.000000 0.000000 ( 0.004081) |
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
| __...__ | |
| .--""``` ```""--. | |
| ':--..___ ___..--:' | |
| \ ``` / | |
| .-` ___.....___ '-. | |
| .:-""`` ~ ~ ``""-:. | |
| /`-..___ ~ ~ ~___..-'\ | |
| / ~ '`""-----""` \ | |
| ; ; | |
| ; '::. ' .:' _. ; |
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
| #!/usr/bin/env bash | |
| set -e | |
| trap cleanup EXIT | |
| cleanup() { | |
| cd "$(dirs -l -0)" && dirs -c | |
| } | |
| setup() { |
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
| 8.34.208.0/20 | |
| 8.35.192.0/21 | |
| 8.35.200.0/23 | |
| 23.236.48.0/20 | |
| 23.251.128.0/19 | |
| 35.184.0.0/14 | |
| 35.188.0.0/15 | |
| 35.190.0.0/17 | |
| 35.190.128.0/18 | |
| 35.190.192.0/19 |
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
| SHELL := /usr/bin/env bash | |
| RSYNC_OPTS := -av --exclude-from 'rsync-exclude.list' | |
| RSYNC = rsync $(RSYNC_OPTS) | |
| install : | |
| $(RSYNC) $(PWD)/ $(HOME)/ | |
| dryinstall : RSYNC_OPTS += --dry-run | |
| dryinstall : install |
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
| #!/usr/bin/env bash | |
| set -e | |
| PACKAGES="i3 tmux vim stow" | |
| read -d '' APT_SRC <<"EOF" ||: | |
| deb http://mirrors.kernel.org/debian/ stretch main contrib non-free | |
| deb http://security.debian.org/debian-security stretch/updates main | |
| deb http://mirrors.kernel.org/debian/ stretch-updates main contrib non-free | |
| deb http://mirrors.kernel.org/debian stretch-backports main contrib non-free |
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/sh | |
| # | |
| # Standard Nagios plugin return codes. | |
| STATUS_OK=0 | |
| STATUS_WARNING=1 | |
| STATUS_CRITICAL=2 | |
| STATUS_UNKNOWN=3 | |
| # Query pending updates. | |
| updates=$(/usr/lib/update-notifier/apt-check 2>&1) |
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
| #!/usr/bin/env python | |
| import argparse | |
| import socket | |
| import ssl | |
| import struct | |
| import subprocess | |
| import sys | |
| from datetime import * |