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
provider "triton" { | |
url = "https://cloudapi.dc1.triton.xxx.cloud" | |
account = "caius" | |
key_id = "xxx" | |
} | |
data "triton_image" "base-64-lts" { | |
name = "base-64-lts" | |
version = "17.4.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
$ ruby -e 'tools = ARGF.read.split.map(&:chomp); puts ("a".."z").map { |l| tools.find {|t| t.start_with?(l) } }' <(ls /bin /sbin | awk 'NF && $1 !~ /:$/ { print $1 }' | sort) | |
apfs_hfs_convert | |
bash | |
cat | |
date | |
echo | |
fibreconfig | |
halt | |
ifconfig |
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
# 4m 21s | |
awk | |
bc | |
cut | |
diff | |
ed | |
find | |
grep | |
history | |
irb |
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
// Paste in a browser console to randomise the titles of all trello cards | |
$(".list-card-title").each(function(i, e) { | |
e = $(e); | |
t = e.text(); | |
s = ""; | |
for (var i = t.length - 1; i >= 0; i--) { | |
if (t[i] == " ") { | |
s += " " | |
} else { | |
s += Math.random().toString(36).substring(5, 6); |
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
# Given an input array, find the longest subarray within it (without sort) that contains numbers in ascending order | |
input = [12, 4, 78, 90, 45, 23] | |
out = input.length.downto(1) do |i| | |
subarr = input.each_cons(i).find do |arr| | |
arr.each_cons(2).map { |a, b| a < b }.uniq == [true] | |
end | |
break(subarr) if subarr | |
end |
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
↳ caius$ curl -vvv https://sendcat.com | |
* Rebuilt URL to: https://sendcat.com/ | |
* Trying 176.9.78.70... | |
* TCP_NODELAY set | |
* Connection failed | |
* connect to 176.9.78.70 port 443 failed: Operation timed out | |
* Failed to connect to sendcat.com port 443: Operation timed out | |
* Closing connection 0 | |
curl: (7) Failed to connect to sendcat.com port 443: Operation timed out |
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 | |
# | |
# Syncs pkgsrc releases to manta | |
# | |
# MIT License - Caius Durling <[email protected]> | |
# | |
[[ "$TRACE" ]] && set -o xtrace | |
set -o errexit | |
set -o nounset | |
set -o pipefail |
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
# Notes on how I installed the zone by hand, hopefully this is enough of a pointer to get | |
# you up and running! | |
# Prior art & help found at https://git.frubar.net/bluemaex/homekitten | |
pkgin install -y gmake gcc49 | |
cat > /root/package.json <<JSON | |
{ | |
"name": "homebridge-installer", |
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
# Pipe `zfs history` into this script, it will output holds | |
# which have not yet been released. | |
holds = [] | |
ARGF.each_line do |line| | |
next unless line[/zfs (hold|release) (\S+) (\S+)/] | |
kind = $1 | |
tag = $2 | |
snapshot = $3 |
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_relative "./shared" | |
seen_ids = [] | |
$q.subscribe(:block => true, :manual_ack => true) do |delivery_info, metadata, payload| | |
data = JSON.parse(payload) | |
p "Got #{data["id"]} (#{data["nack"]})" | |
if seen_ids.include?(data["id"]) | |
raise "Dup! Already seen this message" |