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
# you can omit the first (2) entries... | |
export PATH="$HOME/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin::/sbin:/usr/bin:/bin" | |
export PATH=/Applications/Emacs.app/Contents/MacOS:$PATH | |
# 'virtualenvwrapper' support | |
export WORKON_HOME=$HOME/.virtualenvs | |
export VIRTUALENVWRAPPER_SCRIPT=/usr/local/bin/virtualenvwrapper.sh | |
source /usr/local/bin/virtualenvwrapper.sh |
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
import sys | |
import logging | |
import logging.config | |
import random | |
import string | |
# "thank you" to folks on StackOverflow.com for various ideas, | |
# for this example. Works with Python3. |
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
import time | |
import logging | |
from tornado.options import options, define | |
from tornado import gen | |
from tornado.tcpclient import TCPClient | |
from tornado.iostream import StreamClosedError | |
from tornado.ioloop import IOLoop | |
define("host", default="127.0.0.1", help="TCP server host") | |
define("port", default=9888, help="TCP port to connect to") |
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
# REF: https://github.com/pyenv/pyenv/blob/master/README.md | |
# ... building Python 3.6.2 on Bastion, "locally" | |
# yum install [Python3 build pre-reqs, on CentOS 6.7] | |
curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash | |
tee -a $HOME/.bash_profile <<EOF | |
export PATH="\$HOME/.pyenv/bin:\$PATH" | |
eval "\$(pyenv init -)" |
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
import logging | |
import sys | |
from logging import config | |
# REF, modified from: | |
# https://stackoverflow.com/a/19367225 | |
if sys.platform == "darwin": | |
address = '/var/run/syslog' | |
facility = 'local1' |
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
-*-sh-*- | |
Various bits, pieces, notes -- on using Linux Volume (Disk) Mgmt, | |
on various Linux distros | |
"A Debian Grimoire - LVM: Logical Volume Management, Version 2" | |
http://deb.riseup.net/storage/lvm2/ | |
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
import pymysql.cursors | |
import os | |
from attrdict import AttrDict | |
import sys | |
# Test a one-row Insert, Select for Capacity DB | |
# ... using Py DB-API | |
# | |
# Install: | |
# pip3 install PyMySQL attrdict |
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
from concurrent.futures import ThreadPoolExecutor, as_completed | |
import time | |
import random | |
TPOOL_SIZE = 8 | |
def blocking(pid): | |
""" a non-deterministic "blocking" ? task | |
""" |
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 python3 | |
# | |
# Port of "Fabric streamlogger" to Python3 | |
# Credit (originally): https://gist.github.com/2376336.git | |
# pmuller - streamlogger.py | |
import sys | |
import logging | |
from io import StringIO |
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
# NetworkManager should manage wired interfaces! | |
# Linux Mint 18.x (Ubuntu 16.04) | |
# REF: "fixing VPN problem in Ubuntu", | |
# http://blog.wensheng.org/search?updated-min=2015-01-01T00:00:00-06:00&updated-max=2016-01-01T00:00:00-06:00&max-results=5 | |
aptitude install etckeeper | |
git log | |
nmcli c # NOTE: no wired-interface controlled | |
emacs -nw /etc/NetworkManager/NetworkManager.conf |