Skip to content

Instantly share code, notes, and snippets.

View egregius313's full-sized avatar

Edward Minnix III egregius313

View GitHub Profile
@matthiassb
matthiassb / dns-sync.sh
Last active March 20, 2024 12:12
Init.d script for keeping WSL resolv.conf in-sync with Windows
#! /bin/bash
### BEGIN INIT INFO
# Provides: dns-sync
# Required-Start:
# Required-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: Synchronizes /etc/resolv.conf in WLS with Windows DNS - Matthias Brooks
### END INIT INFO
@dutc
dutc / namedtuple-json.py
Last active October 10, 2021 12:48
Extend `json.dumps` to encode namedtuples as maps (not arrays)
from collections import namedtuple
from json import dumps
from datetime import datetime
def fix_default(default=None):
class TupleButNotNamedTupleMeta(type):
def __instancecheck__(cls, obj):
return isinstance(obj, tuple) and not hasattr(obj, '_fields')
class TupleButNotNamedTuple(metaclass=TupleButNotNamedTupleMeta):
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 24, 2024 12:19
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname