First, install powerline:
$ sudo apt install powerline
Optionally consult docs:
$ less /usr/share/doc/powerline/README.Debian
Enable in ~/.bashrc
:
First, install powerline:
$ sudo apt install powerline
Optionally consult docs:
$ less /usr/share/doc/powerline/README.Debian
Enable in ~/.bashrc
:
#!/usr/bin/env python3 | |
import os | |
from pathlib import Path | |
import sys | |
bad_shebangs = { | |
'/usr/bin/python', | |
'/usr/bin/env python', | |
} |
0123456789ABCDEF |
#!/usr/bin/env python3 | |
import dns.resolver | |
from ipaddress import IPv4Network, IPv6Network, ip_address | |
GOOGLE_NETBLOCKS = [ | |
'_netblocks.google.com', | |
'_netblocks2.google.com', | |
'_netblocks3.google.com', | |
] |
# A simple, constant env var | |
CONST='A constant env var' | |
# Derived from another variable | |
DERIV="I came from ${CONST} with some more" | |
# An environment variable we expect to be set on the outside | |
EXT_SET=${ENV_EXT_SET} | |
# An environment variable we expect *not* to be set on the outside |
#!/bin/bash | |
# Adapted from https://forum.netgate.com/topic/139561 | |
set -o pipefail | |
if [[ $# -lt 1 ]]; then | |
echo "Usage: $(basename $0) <encrypted-config>" | |
exit 1 | |
fi | |
inpath="$1" | |
tmpout="$(mktemp)" |
version: '2' | |
services: | |
# MySQL Database | |
db: | |
image: mysql:5.6 | |
volumes: | |
- ./data/mysql:/var/lib/mysql | |
- ./mysql-entrypoint.sh:/custom-entrypoint.sh:ro |
from __future__ import print_function | |
import random | |
import sys | |
class CompatibleRandom(random.Random): | |
# Inspired by https://stackoverflow.com/a/55800424/119527 | |
def seed(self, a): | |
if sys.version_info >= (3, 2): | |
super(CompatibleRandom, self).seed(a, version=1) | |
else: |
# Put this in your .bashrc or .bash_aliases | |
# List virtual envs | |
function list-virtualenvs() { | |
for d in *; do | |
if [[ -d "${d}" && -f "${d}/bin/activate" ]]; then | |
echo "${d}" | |
fi | |
done | |
} |