Skip to content

Instantly share code, notes, and snippets.

View W-Floyd's full-sized avatar

William Floyd W-Floyd

View GitHub Profile
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 4.4.0-22-generic (buildd@lgw01-41) (gcc version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2) ) #40-Ubuntu SMP Thu May 12 22:03:46 UTC 2016 (Ubuntu 4.4.0-22.40-generic 4.4.8)
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.4.0-22-generic.efi.signed root=UUID=f00a2ed2-6119-46ca-a6f1-509dae426515 ro quiet splash acpi_backlight=native acpi_osi= vt.handoff=7
[ 0.000000] KERNEL supported cpus:
[ 0.000000] Intel GenuineIntel
[ 0.000000] AMD AuthenticAMD
[ 0.000000] Centaur CentaurHauls
[ 0.000000] x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256
uncommit = reset HEAD^
cm = commit -S --signoff
diffit = diff origin/HEAD HEAD
unstage = reset HEAD
discard = checkout --
ls = log --pretty=format:'%C(auto,yellow)%h %C(auto,red)%ad %C(auto,blue)%an%C(auto,green)%d %Creset%s' --date=short --all --graph
lr = log --pretty=format:'%C(auto,yellow)%h %C(auto,red)%ad %C(auto,blue)%an%C(auto,green)%d %Creset%s' --date=relative --all --graph
bleach = "!git checkout -- . && git clean -fxd"
la = "!git config -l | grep alias | cut -c 7-"
ps = "!f() { echo $(git merge-base HEAD origin/master)..HEAD | git pack-objects --revs --thin --stdout --all-progress-implied -q | wc -c | numfmt --to=iec-i; }; f"
function mkex {
if ! chmod +x "${1}"; then
sudo chmod +x "${1}"
fi
}
function youtube-best {
youtube-dl -f bestvideo+bestaudio $1
}
@W-Floyd
W-Floyd / tunnelbroker-net.sh
Last active August 28, 2021 22:34 — forked from pklaus/tunnelbroker-net.sh
tunnelbroker.net automatic tunnel IP update and tunnel setup (on Linux)
#!/bin/bash
# This script is published by Philipp Klaus <[email protected]>
# on <http://blog.philippklaus.de/2011/05/ipv6-6in4-tunnel-via-hurricane-electric-tunnelbroker-net-automatic-ip-update-on-mac-os-x/>
# It is originally by freese60 and modified by limemonkey.
# Found on <http://www.tunnelbroker.net/forums/index.php?topic=287.0>
# Further modified by pklaus, at <https://gist.github.com/pklaus/960672>
# Forked and mostly replaced by W-Floyd, <https://gist.github.com/W-Floyd/20a4c16ceb1e008cb995b7ff7dcc0a2a>
###############################################################################
#!/bin/bash
replace_baseplate_circle () {
if ! [ -e "${1}" ]; then
return 1
fi
grep -qE '^ <linearGradient id="linearGradient[0-9]*" x1="1" x2="47" gradientUnits="userSpaceOnUse">$' < "${1}" || return 1
#!/bin/bash
replace_baseplate_circle () {
if ! [ -e "${1}" ]; then
return 1
fi
grep -qE '^ <linearGradient id="linearGradient[0-9]*" x1="1" x2="47" gradientUnits="userSpaceOnUse">$' < "${1}" || return 1
#!/bin/bash
ask() {
# https://djm.me/ask
local prompt default reply
while true; do
if [ "${2:-}" = "Y" ]; then
prompt="Y/n"
@W-Floyd
W-Floyd / zero_strip.sh
Created April 12, 2018 01:28
A one-liner sed expression to nicely strip leading and trailing 0's from each line of piped input
################################################################################
# ... | __zero_strip
################################################################################
#
# Zero Strip
#
# A one-liner sed expression to nicely strip leading and trailing 0's from each
# line of piped input.
#
# For example:
Layout Speed Sent Speed Received
←,↖,↖,↖ 138 Mbits/sec 168 Mbits/sec
←,↖,↖,↑ 113 Mbits/sec 177 Mbits/sec
←,↖,↖,↗ 140 Mbits/sec 211 Mbits/sec
←,↖,↖,→ 131 Mbits/sec 190 Mbits/sec
←,↖,↑,↑ 90.6 Mbits/sec 173 Mbits/sec
←,↖,↑,↗ 142 Mbits/sec 221 Mbits/sec
←,↖,↑,→ 132 Mbits/sec 215 Mbits/sec
←,↖,↗,↗ 83.1 Mbits/sec 171 Mbits/sec
←,↖,↗,→ 89.8 Mbits/sec 191 Mbits/sec
@W-Floyd
W-Floyd / SolidWorks_Spoof.sh
Created September 1, 2018 19:01
Simple script to make a Virtualbox VM hidden enough to install SolidWorks
#!/bin/bash
__get_random_string () {
openssl rand -hex "${1}" | cut -c "1-${1}"
}
__my_vm='W10'