view port
$ ps aux | grep 6805
cleanup system
$ docker system prune
export journalctl
| If you find yourself regularly logging into the server then it will be useful to load your ssh key automatically. | |
| Add the following snippet to the bottom of ~/.bash_profile to add it to your shell environment permanently: | |
| ssh-add ~/.ssh/your_ssh_key > /dev/null 2>&1 |
| # from https://gist.github.com/rgl/f90ff293d56dbb0a1e0f7e7e89a81f42 | |
| timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9000)" != "200" ]]; do sleep 5; done' || false |
| # Makefile for Sphinx documentation | |
| # https://github.com/graphql-python/graphene/blob/master/docs/Makefile | |
| # You can set these variables from the command line. | |
| SPHINXOPTS = | |
| SPHINXBUILD = sphinx-build | |
| PAPER = | |
| BUILDDIR = _build | |
| # Internal variables. |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| data = [ | |
| ['Freeze', 'Wind', 'Flood', 'Quake', 'Hail'], | |
| ['5 year', 66386, 174296, 75131, 577908, 32015], | |
| ['10 year', 58230, 381139, 78045, 99308, 160454], | |
| ['20 year', 89135, 80552, 152558, 497981, 603535], | |
| ['30 year', 78415, 81858, 150656, 193263, 69638], | |
| ['40 year', 139361, 331509, 343164, 781380, 52269], |
| import io | |
| import os | |
| import zipfile | |
| import boto3 | |
| def download_s3_dir_into_binary_stream(bucket_name, remote_dir_name): | |
| s3_resource = boto3.resource('s3') | |
| bucket = s3_resource.Bucket(bucket_name) |
view port
$ ps aux | grep 6805
cleanup system
$ docker system prune
export journalctl
| # include following in .bashrc / .bash_profile / .zshrc | |
| # usage | |
| # $ mkvenv myvirtualenv # creates venv under ~/.venv/ | |
| # $ venv myvirtualenv # activates venv | |
| # $ deactivate # deactivates venv | |
| # $ rmvenv myvirtualenv # removes venv | |
| export VENV_HOME="$HOME/.venv" | |
| [[ -d $VENV_HOME ]] || mkdir $VENV_HOME |
install sshuttle
sudo apt-get update -y
sudo apt-get install -y sshuttle
open ~/.bashrc and add these lines at the end
ansible-playbook --connection=local 127.0.0.1 playbook.yml127.0.0.1 ansible_connection=local| #!/bin/bash | |
| # These steps will allow the setup of an on-demand SSH proxy | |
| # Three unit files will be created to serve this purpose: | |
| # ssh-socks-helper.socket - The listening socket providing activation | |
| # ssh-socks-helper.service - A systemd proxy to pass the socket fd | |
| # ssh-socks.service - The actual SSH service providing the tunnel | |
| cat <<'EOF' > ~/.config/systemd/user/ssh-socks-helper.socket | |
| [Unit] | |
| Description=Proxy Helper Socket for Bastion SOCKS5 Proxy |