I hereby claim:
- I am mwoolweaver on github.
- I am mwoolweaver (https://keybase.io/mwoolweaver) on keybase.
- I have a public key ASDyozktfq8L_ZH5UxV5L4yUO9w55jWtuF6MLY6jmmxaNwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#!/bin/sh | |
HOSTNAME="host.yourdomain.com" | |
USERNAME="username" | |
PASSWORD="password" | |
LOG_FILE="/tmp/ddns/ddns.log" | |
while true; do |
# 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 |
def pretty_time_delta(seconds): | |
sign_string = '-' if seconds < 0 else '' | |
seconds = abs(int(seconds)) | |
days, seconds = divmod(seconds, 86400) | |
hours, seconds = divmod(seconds, 3600) | |
minutes, seconds = divmod(seconds, 60) | |
if days > 0: | |
return '%s%dd%dh%dm%ds' % (sign_string, days, hours, minutes, seconds) | |
elif hours > 0: | |
return '%s%dh%dm%ds' % (sign_string, hours, minutes, seconds) |
# ~/.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 |