Skip to content

Instantly share code, notes, and snippets.

function remove-docker-containers
echo "Stop running shit"
docker stop (docker ps -q)
echo "Remove the whale shit"
docker rm (docker ps -a -q)
end
function remove-docker-images
remove-docker-containers

Experimental Docker Libnetwork DHCP Driver

The DHCP driver is intended for users to be able to integrate Docker IP address management with their existing IPAM strategies that use DHCP for dynamic address assignment. DHCP enables users to allocate addresses in an organized fashion that will prevent overlapping IP address assignment by associating a unique MAC address from the container eth0 Ethernet interface to an IP address as determined by the DHCP pools defined in the DHCP configuration.

This driver only provides the DHCP client functionality. It does not include a DHCP server. The default driver offers single-host IPAM or for distributed multi-host orchestrated IPAM see the libnetwork overlay driver.

Getting Started

@yeokm1
yeokm1 / archlinux-rpi3-serial-and-bluetooth.md
Last active October 9, 2021 09:59
Arch Linux Raspberry Pi 3 configuration to use both Serial Debug Port and Bluetooth

The new Raspberry Pi 3 released on 29 Feb 2016 has issues with its UART port as the pinout GPIO 14/15 on the pin header is now based on a low throughput mini-UART.

To understand the issue better than reading the wall of text below, you can see the talk I gave on this issue.

The actual hardware UART on the BCM2837 SoC has now been assigned to handle Bluetooth with the BCM43438 Wifi/Bluetooth chip. More details can be found here and here.

This mini-UART does not produce a stable baud rate as it fluctuates based on the Core clock speed whenever it rises or falls. The result is that the serial debug output is practically unusable. On Raspbian you may see garbage or nothing at all. The solution is simple, add core_freq=250 to /boot/config.txt to cap the core frequency to a constant value. This optio

@radupotop
radupotop / iperf3.service
Last active January 12, 2019 08:04
iperf3.service for systemd
[Unit]
Description=iperf3 server
After=syslog.target network.target auditd.service
[Service]
User=iperf
ExecStart=/usr/bin/iperf3 -s --logfile /var/log/iperf.log
[Install]
WantedBy=multi-user.target
@m-ou-se
m-ou-se / replace-debian-with-arch.txt
Last active October 22, 2023 12:16
Instructions to replace a live Debian installation with Arch
# Download latest archlinux bootstrap package, see https://www.archlinux.org/download/
wget 'ftp://ftp.nluug.nl/pub/os/Linux/distr/archlinux/iso/latest/archlinux-bootstrap-*-x86_64.tar.gz'
# Make sure you'll have enough entropy for pacman-key later.
apt-get install haveged
# Install the arch bootstrap image in a tmpfs.
mount -t tmpfs none /mnt
cd /mnt
tar xvf ~/archlinux-bootstrap-*-x86_64.tar.gz --strip-components=1
@gbaman
gbaman / HowToOTG.md
Last active April 16, 2024 22:39
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

@kuntau
kuntau / yify.md
Last active February 14, 2024 19:30
YIFY's Quality Encoding

For those that want to keep the YTS going (No, IDGAF about people that don't care for YTS quality) get HandbrakeCLI https://handbrake.fr/downloads... and use the following settings:

user@user:~$HandBrakeCLI -i /file/input.mp4 -o /file/out.mp4 -E fdk_faac -B 96k -6 stereo -R 44.1 -e x264 -q 27 -x cabac=1:ref=5:analyse=0x133:me=umh:subme=9:chroma-me=1:deadzone-inter=21:deadzone-intra=11:b-adapt=2:rc-lookahead=60:vbv-maxrate=10000:vbv-bufsize=10000:qpmax=69:bframes=5:b-adapt=2:direct=auto:crf-max=51:weightp=2:merange=24:chroma-qp-offset=-1:sync-lookahead=2:psy-rd=1.00,0.15:trellis=2:min-keyint=23:partitions=all

Reason to use CLI over GTK has to do with lack of support for advanced settings for Handbrake GTK

** Don't Re-encode already shitty encodes...get good source!**

@kennwhite
kennwhite / vpn_psk_bingo.md
Last active February 24, 2024 12:19
Most VPN Services are Terrible

Most VPN Services are Terrible

Short version: I strongly do not recommend using any of these providers. You are, of course, free to use whatever you like. My TL;DR advice: Roll your own and use Algo or Streisand. For messaging & voice, use Signal. For increased anonymity, use Tor for desktop (though recognize that doing so may actually put you at greater risk), and Onion Browser for mobile.

This mini-rant came on the heels of an interesting twitter discussion: https://twitter.com/kennwhite/status/591074055018582016

@jedahan
jedahan / twitcher.py
Last active June 7, 2021 17:45 — forked from imba3r/twitcher.py
#!/usr/bin/env python
#-------------------------------------------------
# file: twitcher.py
# author: Florian Ehmke
# description: dmenu for twitch streams
#-------------------------------------------------
import argparse
import requests
from subprocess import Popen, PIPE, STDOUT
# Use the high-colour menu system. This file, and the low-colour 'menu.c32'
# version, are provided by the syslinux package and can be found in the
# '/var/lib/tftpboot' directory. Copy it to '/var/lib/tftpboot'.
UI vesamenu.c32
# Time out and use the default menu option. Defined as tenths of a second.
TIMEOUT 2600
# Prompt the user. Set to '1' to automatically choose the default option. This
# is really meant for files matched to MAC addresses.