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 | |
set -e | |
_get_cert () { | |
openssl s_client -showcerts -connect "$1":"$2" </dev/null 2>/dev/null | openssl x509 -outform PEM | |
} | |
if [ $# -lt 2 ] ; then | |
echo "Usage: $0 HOST PORT [OUTFILE]" | |
echo "" | |
echo "Connects to TCP PORT on HOST and downloads TLS certificates." | |
echo "Saves to OUTFILE if it is specified, otherwise outputs to standard 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
#!/bin/sh | |
# defaultenv.sh - Load environment variable defaults and run programs | |
set -e | |
[ x"$DEBUG" = "x1" ] && set -x | |
_load_envrc () { | |
local file="$1"; shift | |
if [ -r "$file" ] ; then | |
# Bourne shell limits how we can test and set env vars, so here I'm |
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
echo -ne "\033]0;This changes the window title\007" | |
echo -ne "\ekThis changes the tab title\e\\" |
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 | |
# Get all GitLab repositories from the GitLab API. | |
GITLAB_HOST="https://gitlab.com" | |
export TOKEN=$(cat ~/.gitlab-token) | |
API_VER="v4" | |
PER_PAGE=100 | |
set -eo 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
#!/bin/sh | |
# Exports your bookmarks.html and converts them to a simple text file, one URL per line | |
BOOKMARKS_FILE="$1" | |
cat "$BOOKMARKS_FILE" | grep HREF | sed -e 's/^.*HREF="\([^"]*\)".*$/\1/ig' | grep -i ^http | sort -u > httrack-bookmarks.txt | |
# Get all bookmarks with httrack. | |
# NOTE: this disables all of httrack's "safety features" | |
httrack -O foo -i -iC2 -c20 -%c200 -%! -r1 -n -%k -%L httrack-bookmarks.txt |
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/bash | |
# Export your bookmarks into a bookmarks.html file and pass it to this script | |
BOOKMARKS_FILE="$1" | |
wget -v --tries=1 --convert-links --adjust-extension --page-requisites --no-parent --timestamping --no-remove-listing --no-clobber --force-html -i "$BOOKMARKS_FILE" 2>&1 | tee -a wget-mirror-bookmarks.log |
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/bash | |
# Prune local orphan refs | |
git prune -v | |
# Deletes all stale (local) remote-tracking branches under origin. | |
# These stale branches have already been removed from the remote repository | |
# referenced by <name>, but are still locally available. | |
git remote prune origin |
NewerOlder