Skip to content

Instantly share code, notes, and snippets.

@mwoolweaver
mwoolweaver / .bashrc
Last active July 26, 2020 04:58 — forked from marioBonales/.bashrc
Default .bashrc for ubuntu
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@mwoolweaver
mwoolweaver / README
Created April 25, 2020 20:34 — forked from radfish/README
Route only Transmission through a VPN connection using your own VPN server
# The approach is to mark packets from a specific user,
# create a dedicated routing table with a default route
# through the VPN, and force all marked packets to be
# routed using that table.
#
# Sources:
# https://www.niftiestsoftware.com/2011/08/28/making-all-network-traffic-for-a-linux-user-use-a-specific-network-interface/
# http://freeaqingme.tweakblogs.net/blog/9340/netflix-using-a-vpn-for-just-one-application.html
# In this guide
@mwoolweaver
mwoolweaver / .gitignore
Last active May 18, 2019 17:12 — forked from thatalextaylor/1-python-pretty-time-delta.py
print a pretty time delta in Python in days, hours, minutes and seconds
# Byte-compiled / optimized / DLL files / pip / IDE
__pycache__/
*.py[cod]
*$py.class
src/
.idea/
.vscode/
# Config
config.ini
@mwoolweaver
mwoolweaver / disk_usage.py
Created May 15, 2019 01:13
Disk usage statistics with python
import os
from collections import namedtuple
disk_ntuple = namedtuple('partition', 'device mountpoint fstype')
usage_ntuple = namedtuple('usage', 'total used free percent')
PROC_FILESYSTEMS = "/proc/filesystems"
ETC_MTAB = '/etc/mtab'
def get_disk_partitions():
@mwoolweaver
mwoolweaver / update-google-dyndns.sh
Created April 29, 2019 19:38 — forked from drewchapin/update-google-dyndns.sh
A shell script to update the public IP address of a Google DynDNS hostname. Intended to be used on DD-WRT routers.
#!/bin/sh
HOSTNAME="host.yourdomain.com"
USERNAME="username"
PASSWORD="password"
LOG_FILE="/tmp/ddns/ddns.log"
while true; do
@mwoolweaver
mwoolweaver / ipsw.decrypt.md
Created June 17, 2016 19:25 — forked from tzmartin/ipsw.decrypt.md
Decrypting ipsw firmware files