Skip to content

Instantly share code, notes, and snippets.

View biggers's full-sized avatar

Mark Biggers biggers

View GitHub Profile
@biggers
biggers / gosmacs.el
Created June 30, 2018 20:40
favorite Gosling Emacs keybindings, once shipped with GNU Emacs -- probably not any more
;;; 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 / py_syslog_dict_config.py
Last active May 31, 2023 20:21
Python dictConfig logging example using SyslogHandler - modified from Stackoverflow answer
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 / exifImageMover.py
Last active September 16, 2022 00:51
rename JPEG image files by (date, time) from EXIF data -- "fork" / update of n3wtron/exifImageMover.py
#!/usr/bin/env python
from PIL import Image
import sys
import time
import os
from os import path
import shutil
from optparse import OptionParser
@biggers
biggers / py_rotate_log_dict_config.py
Created December 19, 2017 19:23
Python3 rotating log-file configuration via "config.dictConfig"
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.
@biggers
biggers / vbox_clom_trial.py
Last active October 18, 2021 21:54
Am example (expanded) of using Python 'clom' library, to "abstract" Virtualbox command-line. Thanks to the "Refs!" It's not a runnable script by itself; will probably make it so, soon.
#!/usr/bin/env python
from clom import clom
from pprint import pprint as pp
# Install, into a virtualenv: pip install clom
#
# Reference:
# http://clom.readthedocs.org/en/latest/
# Derived from:
@biggers
biggers / sh_mod_vbox.py
Last active October 18, 2021 21:54
Python 'sh' module example, working with Virtualbox commands & outputs
#!/usr/bin/env python
from __future__ import print_function
from pprint import pprint
# install into a virtual-env: pip install sh
#
# References:
# http://amoffat.github.com/sh
#
# Inspired by:
@biggers
biggers / sshfs_ubuntu_fsys.sh
Created October 2, 2021 14:04
sshfs remote SSH mount script - MacOS client to Ubuntu
#!/bin/bash
# MacOS *specific*, 'sshfs' remote-mounts
# - tested on MacOS catalina; latest MacOS Fuse & sshfs
# - 10-02-2021 Sat
# NOTE:
# sudo mkdir -p /private/ssh # and do a 'chmod, chgrp'...
# drwxrwsr-x 5 root admin 160 Oct 2 08:32 /private/ssh/
# - install, MacOS FUSE, sshfs from https://osxfuse.github.io/
@biggers
biggers / git-fetchall.sh
Created May 21, 2020 15:10
Git, fetch all branches!
#!/bin/sh
# "git fetch all branches" -- to your local-repo
## to RUN-ME:
## git branch -r | sed -r -e 's:origin/::g' -e '/^\s+HEAD/d' | egrep -v gerrit/ > /tmp/foo
# ... gives you a chance, to change the "temp list of Branches to fetch"
## cat /tmp/foo ## hand-edit, if needed
@biggers
biggers / .gitconfig
Created November 7, 2019 15:43
My dot gitconfig
# -*-conf-*-
[user]
# email = biggers@utsl.com
email = mabigger@cisco.com
name = Mark Biggers
[core]
autocrlf = input
safecrlf = false
pager = less -+S
@biggers
biggers / bashrc.win.sh
Created December 27, 2018 14:32
"bootstrap" bashrc for a WSL (Windows 10) and Docker workflow
# /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