Skip to content

Instantly share code, notes, and snippets.

@mohnish
mohnish / Mintty.md
Last active February 23, 2024 17:03 — forked from appikonda/Mintty.md
Mintty Themes for Windows

Macvlan Global Driver

Setup

  • The same functionality is preserved as in the instructions in the experimental Macvlan README. To run the driver locally dockerd daemon label is used for local driver registration like so: dockerd --label com.docker.network.driver.macvlan=local

  • By running the drivers globally it enables the user to have globally distributed IPAM and DNS support via the libnetwork IPAM/DNS excellence.

  • To run the PoC binary download this tar and extract to the /usr/bin/ directory from here: dockerd-binaries Note: (backup your Docker binaries prior if you dont want them overwritten by the extracted binaries).

@tiann
tiann / auto_switch_kb.py
Created December 2, 2015 06:51
auto switch keyboard to english in specific applications
#! /usr/bin/env python
# coding: utf-8
'''
auto switch keyboard between different applications
if you want to change the app list, modify the var 'ignore_list'
'''
from AppKit import NSWorkspace, NSWorkspaceDidActivateApplicationNotification, NSWorkspaceApplicationKey
@sourceperl
sourceperl / th_pinger.py
Last active August 12, 2025 09:58
Python script for do multi-threaded ping
#!/usr/bin/env python
# ping a list of host with threads for increase speed
# use standard linux /bin/ping utility
from threading import Thread
import subprocess
try:
import queue
except ImportError:
import Queue as queue
@ralphbean
ralphbean / scapy-pub.py
Created November 30, 2012 19:08
Try connecting to a netcat instance with scapy on port 9001
#!/usr/bin/env python
# The above line indicates that this is a python script.
# Author: Ralph Bean <rbean@redhat.com>
# This line imports python objects from the scapy module
from scapy.all import sendp, TCP, IP
# Can we get scapy to talk with netcat?
# http://stackoverflow.com/questions/12062781/how-to-make-netcat-display-payload-of-packet
# Run "nc -l 9001"
@diosmosis
diosmosis / example.py
Created August 15, 2011 22:41
Python decorator that catches exceptions and logs a traceback that includes every local variable of each frame.
import os
from log_exceptions import log_exceptions
def throw_something(a1, a2):
raise Exception('Whoops!')
@log_exceptions(log_if = os.getenv('MYAPP_DEBUG') is not None)
def my_function(arg1, arg2):
throw_something(arg1 + 24, arg2 - 24)
@glacjay
glacjay / tun-ping-linux.py
Created September 18, 2010 04:49
Reading/writing Linux's TUN/TAP device using Python.
import fcntl
import os
import struct
import subprocess
# Some constants used to ioctl the device file. I got them by a simple C
# program.
TUNSETIFF = 0x400454ca
TUNSETOWNER = TUNSETIFF + 2