| Description | Command |
|---|---|
| Start a new session with session name | screen -S <session_name> |
| List running sessions / screens | screen -ls |
| Attach to a running session | screen -x |
| Attach to a running session with name | screen -r |
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 | |
| graceful_exit() { | |
| # include this line: trap graceful_exit TERM INT HUP | |
| echo "Exit requested..." | |
| local timeout=${1:-4} | |
| local list="" | |
| for c in $(ps -o pid= --ppid $$); do | |
| # request children shutdown | |
| kill -0 ${c} 2>/dev/null && kill -TERM ${c} && list="$list $c" || true |
When connecting to a remote server via SSH it is often convenient to use SSH agent forwarding so that you don't need a separate keypair on that server for connecting to further servers.
This is enabled by adding the
ForwardAgent yes
option to any of your Host entries in ~/.ssh/config (or alternatively with the -A option). Don't set this option in a wildcard Host * section since any user on the remote server that can bypass file permissions can now als use keys loaded in your SSH agent. So only use this with hosts you trust.
Just plug in your own values for registry and repo/image name.
registry='localhost:5000'
name='my-image'
curl -v -sSL -X DELETE "http://${registry}/v2/${name}/manifests/$(
curl -sSL -I \
-H "Accept: application/vnd.docker.distribution.manifest.v2+json" \
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 python | |
| # A simple script to suck up HTML, convert any images to inline Base64 | |
| # encoded format and write out the converted file. | |
| # | |
| # Usage: python standalone_html.py <input_file.html> <output_file.html> | |
| # | |
| # TODO: Consider MHTML format: https://en.wikipedia.org/wiki/MHTML | |
| import os | |
| from bs4 import BeautifulSoup |