This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set up a Raspberry Pi 4 as a USB-C Ethernet Gadget | |
# Based on: | |
# - https://www.hardill.me.uk/wordpress/2019/11/02/pi4-usb-c-gadget/ | |
# - https://pastebin.com/VtAusEmf | |
if ! $(grep -q dtoverlay=dwc2 /boot/config.txt) ; then | |
echo "Add the line dtoverlay=dwc2 to /boot/config.txt" | |
exit | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tracking cursor position in real-time without JavaScript | |
// Demo: https://twitter.com/davywtf/status/1124146339259002881 | |
package main | |
import ( | |
"fmt" | |
"net/http" | |
"strings" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/systemd/network/eth.network | |
# Pass nfsroot=... on the kernel command line as you'd expect | |
[Match] | |
Name=eth* | |
KernelCommandLine=!nfsroot | |
[Network] | |
DHCP=v4 | |
[DHCPv4] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#These directories may be excluded: | |
# contains mounted file systems | |
.gvfs | |
.local/share/gvfs-metadata | |
# contains the actual encrypted home directory | |
.Private | |
# session-specific | |
.dbus | |
.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
launchonce() { | |
app=`basename $1` | |
pidof $app >/dev/null && echo "$app is already running" || $1 & | |
} | |
launchonce_alt() { | |
pidof $2 >/dev/null && echo "$1 is already running" || $1 & | |
} |