Skip to content

Instantly share code, notes, and snippets.

View trapier's full-sized avatar

Trapier Marshall trapier

  • Raleigh, NC USA
View GitHub Profile
@trapier
trapier / fenix_fullscreen_triple_tap.user.js
Created February 10, 2024 20:27
firefox mobile triple tap for fullscreen
// ==UserScript==
// @name triple touch to fullscreen
// @namespace http://tampermonkey.net/
// @version 0.1
// @description triple touch to fullscreen for for mobile
// @author trapier
// @run-at document-end
// @match http(s)?://*/*
// @include http://*
// @include https://*
@trapier
trapier / kube-on-linux-networking.txt
Last active August 15, 2020 17:43
kube on linux networking (created using http://asciiflow.com/)
+-----------------------------------------------------------------------------+
|CLIENT POD HOST |
| +---------------------------------------------+ |
+---------------+ | |CLIENT POD | |
|KUBEDNS | | | | |
| <-------------+ $ curl http://myservice:4000 | |
| | | srvc | | |
| myservice | | disc | $ grep nameserver /etc/resolv.conf | | ++ kubelet
| A 10.96.193.4 | | (DNS) | nameserver 10.96.0.10 | | ++ > svc cluster ip range:
| | | | | |
@trapier
trapier / gist:2b0e04590edd27e7544cb542a4737fd3
Created October 22, 2019 20:57 — forked from hgross/gist:26042d052f58feeb6d1b329e8dd2dfcc
Change docker_gwbridge subnet address
## Do this on each swarm-node
# store containers attached to the bridge
$ gwbridge_users=$(docker network inspect --format '{{range $key, $val := .Containers}} {{$key}}{{end}}' docker_gwbridge | \
$ xargs -d' ' -I {} -n1 docker ps --format {{.Names}} -f id={})
# stop all containers
# if you have stacks that restart automatically, remove them via docker stack <stackName> rm
$ echo "$gwbridge_users" | xargs docker stop
$ docker network rm docker_gwbridge
$ docker network disconnect -f docker_gwbridge gateway_ingress-sbox
@trapier
trapier / PrimitivePic_bg.30m.py
Last active September 23, 2019 17:15 — forked from teki/PrimitivePic_bg.30m.py
Use latest pic as background from https://twitter.com/PrimitivePic
#!/usr/bin/python
import os
import re
import subprocess
import tempfile
import time
import urllib.request
from pathlib import Path
TW_URL = 'https://twitter.com/PrimitivePic'
diff --git a/components/engine/vendor/github.com/docker/libnetwork/drivers/macvlan/macvlan_network.go b/components/engine/vendor/github.com/docker/libnetwork/drivers/macvlan/macvlan_network.go
index 914c6cdf64..8e73809cff 100644
--- a/components/engine/vendor/github.com/docker/libnetwork/drivers/macvlan/macvlan_network.go
+++ b/components/engine/vendor/github.com/docker/libnetwork/drivers/macvlan/macvlan_network.go
@@ -64,10 +64,16 @@ func (d *driver) CreateNetwork(nid string, option map[string]interface{}, nInfo
// empty parent and --internal are handled the same. Set here to update k/v
config.Internal = true
}
- err = d.createNetwork(config)
+
@trapier
trapier / marklastwindow.py
Last active January 30, 2019 17:35
Mark the most-recently-focused i3 window with _last
#!/usr/bin/env python3
# Mark the most-recently-focused i3 window with _last
#
# Add this to your i3 config:
# exec_always --no-startup-id /path/to/script
# bindsym <your binding here> [con_mark=_last] focus
#
# Inspired by:
# - https://www.reddit.com/r/i3wm/comments/4d4luc/how_to_focus_the_last_window/
@trapier
trapier / gist:0cb6d2471d9254a8cdb66e29677c57ab
Created August 7, 2017 18:03
autokey-gtk script to copy case and account number out of salesforce classic case view in vimium into markdown format
import time
def keyboard_type(keys):
for key in keys:
keyboard.send_keys(key)
time.sleep(0.1)
def copy_next_field():
keyboard_type("vcwv$y")
@trapier
trapier / halp_cant_see_sfdc_stuff.css
Last active June 29, 2017 16:20 — forked from squizzi/halp_cant_see_sfdc_stuff.css
halp can't see sfdc 'cause the fonts just are so small
/*Fix Pukey Colors on Case Tabs*/
.caseTab .tertiaryPalette,
.individualPalette .caseBlock .tertiaryPalette,
.layoutEdit .individualPalette .caseBlock .tertiaryPalette {
background-color: #36a0fe;
border-color: #015ba7;
}
.caseTab .primaryPalette,
.individualPalette .caseBlock .primaryPalette {
@trapier
trapier / keybase.md
Created March 8, 2017 15:48
keybase.md

Keybase proof

I hereby claim:

  • I am trapier on github.
  • I am trapier (https://keybase.io/trapier) on keybase.
  • I have a public key ASC7Tj_NIylOeBJxSuucwWtck2s2bIJzgUfkIZJvH91U3wo

To claim this, I am signing this object:

@trapier
trapier / virt-migrate
Created November 16, 2015 19:15
rsync based virsh migrate. minimal downtime and and avoids image bloating due to non-sparse copying.
#!/bin/bash
VM=$1
TARGET=$2
vm_path=/var/lib/libvirt/images/$VM.img
rsync -vS --progress $vm_path root@$TARGET:$vm_path && \
virsh migrate --live --suspend --persistent --undefinesource --verbose $VM qemu+ssh://$TARGET/system && \
rsync -vS --progress $vm_image root@$TARGET:$vm_path && \