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
#!/usr/bin/env bash | |
if [[ "${1/--help/-h}" == '-h' ]]; then | |
echo 'fan2add [-h | --help]' | |
echo 'fan2add [-i | --immediately] statement...' | |
echo | |
echo '##### Statement Examples ########' | |
cheat fantastical-statements | |
exit | |
fi | |
if [[ "${1/--immediately/-i}" == '-i' ]]; then |
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
# duti settings file | |
# src: https://gist.github.com/apfelchips/0073cb3e8d186115f590d318998c1025 | |
# mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/duti/" && curl -L "https://git.io/JRtzH" -o "${XDG_CONFIG_HOME:-$HOME/.config}/duti/default.duti" | |
# duti-apply wrapper: alias duti-apply='duti -v "${XDG_CONFIG_HOME:-$HOME/.config}/duti"' | |
## duti documentation https://web.archive.org/web/20180901095433/http://duti.org/documentation.html | |
## see also: https://github.com/Lord-Kamina/SwiftDefaultApps#readme | |
# List of MIME Types: |
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
#!/usr/bin/env bash | |
alias soffice=/Applications/LibreOffice.app/Contents/MacOS/soffice | |
shopt -s expand_aliases | |
soffice --headless --convert-to pdf arch1.pptx | |
soffice --headless --convert-to pdf arch2.pptx | |
convert -density 150 arch1.pdf -quality 80 'output1.jpg' | |
convert -density 150 arch2.pdf -quality 80 'output2.jpg' | |
i=0 | |
for files in output1-*; 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
#!/usr/bin/env bash | |
# Use python's argparse module in shell scripts | |
# | |
# The function `argparse` parses its arguments using | |
# argparse.ArgumentParser; the parser is defined in the function's | |
# stdin. | |
# | |
# Executing ``argparse.bash`` (as opposed to sourcing it) prints a | |
# script template. |
To completely avoid the MacOS python, start with brew or macport. If you start with macports, you will not be using that python version for much (ideally). But we need some, somewhat isolated python to start with.
sudo port install python38
sudo port install py38-pip
You can see what path openssl lib uses for certs
openssl version -a
Python packages often use the default cafile
$ python -c "import ssl; print(ssl.get_default_verify_paths())"
But note that there are other places packages could look even just based on the above.
SSL_CERT_DIR
SSL_CERT_FILE
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
# from https://medium.com/@ripoche.b/using-global-pre-commit-hook-to-prevent-committing-unwanted-code-edbbf957ad12 | |
# | |
# To prevent debug code from being accidentally committed, simply add a comment near your | |
# debug code containing the keyword NO_GITCOMMIT (with underscore gone) and this script will abort the commit. | |
# | |
# I also made this available here | |
# https://gist.github.com/aberezin/7078ec087c7e4f8a078dd518d30a75bf | |
# | |
if git commit -av --dry-run | grep $(echo NO_GITCOMMIT | tr -d _) >/dev/null 2>&1 |
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
FROM alpine:edge | |
# use the CDN mirror from gilderlabs since its much faster | |
RUN mkdir -p /etc/apk && echo "http://alpine.gliderlabs.com/alpine/edge/main" > /etc/apk/repositories &&\ | |
# Install openrc | |
apk update && apk add openrc &&\ | |
# Tell openrc its running inside a container, till now that has meant LXC | |
sed -i 's/#rc_sys=""/rc_sys="lxc"/g' /etc/rc.conf &&\ | |
# Tell openrc loopback and net are already there, since docker handles the networking | |
echo 'rc_provide="loopback net"' >> /etc/rc.conf &&\ |
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
# -*- coding: utf-8 -*- | |
import json | |
import sys | |
from ConfigParser import (ConfigParser, MissingSectionHeaderError, | |
ParsingError, DEFAULTSECT) | |
class StrictConfigParser(ConfigParser): | |
def _read(self, fp, fpname): |
NewerOlder