Skip to content

Instantly share code, notes, and snippets.

Mark Biggers biggers

Block or report user

Report or block biggers

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@biggers
biggers / .gitconfig
Created Nov 7, 2019
My dot gitconfig
View .gitconfig
# -*-conf-*-
[user]
# email = biggers@utsl.com
email = mabigger@cisco.com
name = Mark Biggers
[core]
autocrlf = input
safecrlf = false
pager = less -+S
@biggers
biggers / py_syslog_dict_config.py
Last active Jul 30, 2019
Python dictConfig logging example using SyslogHandler - modified from Stackoverflow answer
View py_syslog_dict_config.py
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'
@biggers
biggers / bashrc.win.sh
Created Dec 27, 2018
"bootstrap" bashrc for a WSL (Windows 10) and Docker workflow
View bashrc.win.sh
# /home/mabigger/.bashrc.win -*-sh-*-
# ---- References
# https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly
# https://sourceforge.net/projects/vcxsrv/
CEC=mabigger
sudo mount --bind /mnt/c /c
@biggers
biggers / csvs_db_insert.py
Last active Mar 3, 2019
insert a set of CSVs (spreadsheets, "raw") into a MySQL DB - Python3 example (DB API; generators; PyMySQL)
View csvs_db_insert.py
import pymysql.cursors
import os
from attrdict import AttrDict
import sys
from datetime import datetime as dt
# Insert all /var/tmp/*/"CSV summary-reports" into MySQL - using Py DB-API
# NOTE: schema for the table must have been already created!
#
# INSTALL:
@biggers
biggers / gosmacs.el
Created Jun 30, 2018
favorite Gosling Emacs keybindings, once shipped with GNU Emacs -- probably not any more
View gosmacs.el
;;; gosmacs.el --- rebindings to imitate Gosmacs.
;; Copyright (C) 1986 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: emulations
;; This file is part of GNU Emacs.
;; GNU Emacs is free software; you can redistribute it and/or modify
@biggers
biggers / linux_rescue_notes.rst
Last active Nov 15, 2018
Rescuing a Linux system
View linux_rescue_notes.rst
@biggers
biggers / peewee_pets_quickstart.py
Last active Aug 6, 2018
"pets" example from peewee "quickstart" / documentation
View peewee_pets_quickstart.py
# Refs:
# (primary) http://peewee.readthedocs.io/en/latest/peewee/quickstart.html
# https://peewee.readthedocs.io/en/2.0.2/peewee/cookbook.html
from datetime import date
import peewee
from peewee import ( # noqa: F401
MySQLDatabase,
Model,
BooleanField,
@biggers
biggers / .bashrc.macos
Created Jan 9, 2018
.bashrc additions, for virtualenvwrapper and Python3 from Python.org
View .bashrc.macos
# 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
@biggers
biggers / torpeewee_ex01.py
Last active May 18, 2018
torpeewee -- fixed example from torpeewee/README.rst -- async peewee for Tornado
View torpeewee_ex01.py
# -*- coding: utf-8 -*-
# REWORKED by biggers@utsl.com, from:
# 16/7/7
# create by: snower
import datetime
from tornado import gen
from tornado.ioloop import IOLoop
from torpeewee import (
Model,
@biggers
biggers / Dockerfile
Last active Mar 8, 2018
docker-compose build attempt for a Pyramid app
View Dockerfile
FROM phusion/baseimage:0.9.18
MAINTAINER biggers@utsl.com
ENV PYTHONUNBUFFERED 1
# ...put your own build instructions here...
RUN apt-get update --no-install-recommends && \
apt-get install -y --no-install-recommends \
You can’t perform that action at this time.