#!/bin/bash
set -euo pipefail
mkdir zero
for i in {1..1000000}; do
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 -euo pipefail | |
name=${1?You must set the DNS name to check.} | |
host=${2:-$1} | |
port=${3:-443} | |
# https://www.shellhacks.com/openssl-check-ssl-certificate-expiration-date/ | |
echo | openssl s_client -servername "$name" -connect "$host":"$port" 2>/dev/null | openssl x509 -noout -subject -issuer -startdate -enddate -ocsp_uri -fingerprint -sha256 |
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
[alias] | |
# Checkout a pull request branch on an upstream project. It | |
# handles PRs that get rebased as well. | |
# | |
# git pr 3 | |
pr = "!f() { git checkout master; git branch -D pr/$1 || true; git fetch origin refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f" | |
# Pull a rebasing branch on a fork. Useful for viewing someones | |
# rebasing feature branch from a clone of their fork. | |
pbr = "!f() { b=$(git rev-parse --abbrev-ref HEAD); git fetch origin $b && git reset --hard origin/$b; }; f" |
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 -euo pipefail | |
needle=${1?You must provide an name or email to search for.} | |
gpg2 --list-keys --fingerprint "$needle" | | |
grep 'Key fingerprint = ' | | |
sed -r 's/Key fingerprint = (.+)$/\1/' | | |
tr -d ' ' |
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
unset SSH_AGENT_PID | |
export SSH_AUTH_SOCK=/home/ccase/.gnupg/S.gpg-agent.ssh | |
cat > ~/.gnupg/gpg-agent.conf <<EOF | |
enable-ssh-support | |
default-cache-ttl 15 | |
max-cache-ttl 15 | |
default-cache-ttl-ssh 15 | |
max-cache-ttl-ssh 15 | |
EOF |
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
alias rust='docker run -it --rm --user "$(id -u):$(id -g)" --net=host -v "$(pwd)":"/home/$USER" --workdir="/home/$USER" -e HOME="/home/$USER" -e USER="$USER" rust:latest' | |
cd ~/some-rust-project | |
rust cargo run |
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
alias haskell='docker run -it --rm --user "$(id -u):$(id -g)" --net=host -v "$(pwd)":"/home/$USER" --workdir="/home/$USER" -e HOME="/home/$USER" -e USER="$USER" haskell:8' | |
cd ~/some-haskell-project | |
haskell cabal update | |
haskell cabal build |
Let's go faster and just use the pre-built stuff in a docker container:
alias haskell='docker run -it --rm --user "$(id -u):$(id -g)" --net=host -v "$(pwd)":"/home/$USER" --workdir="/home/$USER" -e HOME="/home/$USER" haskell:8'
Pull down the most recent cabal index:
haskell cabal update
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 -euo pipefail | |
query=${1:-amazon} | |
# Shut down other users of the smart card (otherwise we can't use it). | |
pkill scdaemon || true | |
if [[ -f ~/.token ]]; then | |
last=$(<~/.token) |
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 -euo pipefail | |
domain=$1 | |
ciphers=$(openssl ciphers | tr ':' ' ') | |
for cipher in $ciphers; do | |
if openssl s_client -servername "$domain" -connect "$domain":443 -cipher "$cipher" <<<'' &>/dev/null; then | |
printf '%s ok\n' "$cipher" | |
else |
NewerOlder