Skip to content

Instantly share code, notes, and snippets.

*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
# p4p1 is WAN interface, #p1p1 is LAN interface
-A POSTROUTING -o p4p1 -j MASQUERADE
# NAT pinhole: HTTP from WAN to LAN
@swarn
swarn / isoD.py
Created October 13, 2018 16:27
Textmate-style isoD snippet for SublimeText
import sublime, sublime_plugin
from datetime import datetime
class TimestampCommand(sublime_plugin.EventListener):
"""Expand `isoD` to YYYY-MM-DD."""
def on_query_completions(self, view, prefix, locations):
if prefix == 'isoD':
val = datetime.now().strftime('%Y-%m-%d')
else:
val = None
@swarn
swarn / gist:b94f04bd7ceab8fd64da63a7e37f99f5
Created August 17, 2019 17:03
Karbiner Elements: Caps alone is Esc; Caps with another key is Ctrl; Caps with Shift is Caps
{
"description": "Caps alone is Esc; Caps with another key is Ctrl; Caps with Shift is Caps",
"manipulators": [
{
"from": {
"key_code": "caps_lock",
"modifiers": {
"mandatory": [
"shift"
],