I hereby claim:
- I am hudon on github.
- I am hudon (https://keybase.io/hudon) on keybase.
- I have a public key whose fingerprint is CCF4 66F0 9D45 FFFA E97D 59E2 9C99 4054 9B44 7CFC
To claim this, I am signing this object:
Verifying that +hudon is my Bitcoin username. You can send me #bitcoin here: https://onename.io/hudon |
I hereby claim:
To claim this, I am signing this object:
cat > /var/tmp/log-truncate <<EOF | |
#!/bin/sh | |
set -eux | |
cd /var/lib/docker/containers | |
for id in * | |
do | |
logfile="\${id}/\${id}-json.log" | |
[ -e "\${logfile}" ] && truncate -s 0 "\${logfile}" | |
done | |
btrfs balance start -v -dusage=20 /var/lib/docker/btrfs |
#!/bin/bash | |
# Docker can't pass newlines to containers if there are \n in variables in | |
# --env-file files. This tool creates a $1.exported file with newlines that | |
# can be sourced before running your container and a $1.vars for you to pass | |
# to --env-files so docker passes those variables to the container. | |
# Usage: | |
# dockerize-env .env | |
# This creates: .env.vars and .env.exported |
def self.encrypt(data, crt_pem) | |
cert = OpenSSL::X509::Certificate.new(crt_pem) | |
rsa = cert.public_key | |
aes = OpenSSL::Cipher::Cipher.new('aes-256-cbc') | |
aes.encrypt | |
key = aes.random_key.unpack('H*')[0] | |
iv = aes.random_iv.unpack('H*')[0] | |
ciphertext = aes.update(data) |
# decrypt /path/to/decrypted/target | |
# assumes existence of target.iv, target.key (aes-256-cbc), target.enc (encrypted target) | |
decrypt () { | |
local IV=`base64 -d < "$1.iv" | openssl rsautl -decrypt \ | |
-inkey /etc/ssl/private/private.key` | |
local KEY=`base64 -d < "$1.key" | openssl rsautl -decrypt \ | |
-inkey /etc/ssl/private/private.key` | |
openssl aes-256-cbc -d -a -in "$1.enc" -out "$1" -iv "$IV" -K "$KEY" | |
} |
# /bin | |
#gists.txt | |
#https://github.com/gist/hudon/0ccd3601425b25b5e559 | |
#https://github.com/gist/hudon/89254003f8d5491a2e1d | |
# ... | |
# | |
while read -r in | |
do | |
url=${in/gist\/andy/gist}.git | |
url=${url/https:\/\/github.cbhq.net/[email protected]:} |
#!/bin/bash | |
find . | grep 'MacBook' | while read -r line ; do ; mv "$line" $(echo "$line" | sed 's/ (Ja.*MacBook.*17)//') ; done |
This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.
###Array ####Definition:
byteSum :: [Word8] -> [Word8] -> [Word8] | |
byteSum = byteSum' 0 | |
where | |
byteSum' 0 [] [] = [] | |
byteSum' 1 [] [] = [1] | |
byteSum' carry (x:xs) (y:ys) = | |
let v = x + y + carry | |
in v : byteSum' (if v < x || v < y then 1 else 0) xs ys |