mullvad-up.sh
as called fromopenvpn.conf
would be unnecessary if openvpn would fork after setting up thetun
interface, for then its contents could be realized with a few systemdExecStartPost
-directives.- Some means of automatically detecting and stopping/reconnecting a broken connection would be nice.
- Due to libcurl being buggy, transmission-daemon leaks DNS requests. I don't mind, if you do, consider using a couple of iptables rules to route any packets coming from transmission's UID through a special routing table.
This file contains 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
In [1]: %rehashx | |
In [2]: import praw | |
In [3]: urls = [e.url.replace('https', 'http') for e in praw.Reddit('ipython').get_subreddit('indie_rock').get_hot(limit=30) if 'youtu' in e.url or 'soundcloud' in e.url] | |
In [4]: for url in urls: | |
!mpv --no-video "$url" | |
....: | |
Playing: http://www.youtube.com/watch?v=sXfLPNv-Axs | |
[quvi] Checking URL... | |
[stream] Video --vid=1 (vp8) | |
[stream] Audio (+) --aid=1 (*) (vorbis) |
This file contains 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 | |
import time | |
import sys | |
from datetime import datetime | |
import feedparser | |
import requests | |
import json | |
import sqlite3 | |
import ast |
This file contains 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 python | |
from colorsys import hsv_to_rgb | |
from time import sleep | |
from itertools import cycle | |
for i in cycle(range(100)): | |
print('\033]12;#{:02x}{:02x}{:02x}\007'.format(*map(lambda x: int(x*255), hsv_to_rgb(i/100, 1, 1))), end='', flush=True) | |
sleep(0.05) |
This file contains 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 | |
from distutils.core import setup | |
from setuptools.command.install import install | |
script = """#!/bin/sh | |
# A word about this shell script: | |
# | |
# It must work everywhere, including on systems that lack | |
# a /bin/bash, map 'sh' to ksh, ksh97, bash, ash, or zsh, |
This file contains 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
all: | |
gcc -Wall -o foo main.c test.S |
This file contains 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
#!/bin/bash | |
# Remaps [TAB] to mean [ESCAPE] (nice for vim) and properly assigns the "Windows | |
# key" to MOD4 (nice for the awesome window manager) | |
# Also, sprinkles some unicode over unused or poorly used keys. | |
# <LGST> is that key next to left shift that is not found on US keyboards | |
xkbcomp - $DISPLAY<<EOF | |
xkb_keymap { | |
xkb_keycodes { include "evdev+aliases(qwertz)"}; | |
xkb_types { include "complete"}; | |
xkb_compat { include "complete"}; |
:0;s/`/{/;s/`/}/;t0
Because sed does more than just s///