Skip to content

Instantly share code, notes, and snippets.

View joshskidmore's full-sized avatar

Josh Skidmore joshskidmore

View GitHub Profile

qemu + libvirt Install on Arch

Install Packages

Note: The packages ebtables, dnsmasq, bridge-utils might not be needed.

pacaur -S uml_utilities qemu virtmanager virt-manager-qt5 ebtables dnsmasq bridge-utils

Edit /etc/libvirt/qemu.conf

Change the group= line to group="kvm".

#!/usr/bin/env bash
# automatically authenticate at a "Google Starbucks" location
mac=$(cat /sys/class/net/wlp*/address)
ap=$(ip neigh|grep "$(ip -4 route list 0/0|cut -d' ' -f3) "|cut -d' ' -f5|tr '[a-f]' '[A-F]')
curl \
-X POST \
--header "host: sbux-portal.appspot.com" \
### Keybase proof
I hereby claim:
* I am joshskidmore on github.
* I am joshskidmore (https://keybase.io/joshskidmore) on keybase.
* I have a public key ASDwCHva8Yp6uWuxpf-tzt8KQuFBj4b16gSdpM5pSZw8pAo
To claim this, I am signing this object:
@joshskidmore
joshskidmore / wireguard.md
Last active February 20, 2019 21:32
Wireguard OpenVPN Replacement

server setup

[ON SERVER] install wireguard (ubuntu)

sudo add-apt-repository ppa:wireguard/wireguard
sudo apt-get update
sudo apt-get install wireguard-dkms wireguard-tools

[ON SERVER] create wireguard conf

@joshskidmore
joshskidmore / gpd-pocket2-fix-optical-sensor.sh
Created May 22, 2019 18:35
gpd-pocket2-fix-optical-sensor.sh
#!/usr/bin/env bash
id=$(lsusb.py | grep -i hail | awk '{ print $1 }')
echo "on" | sudo tee /sys/bus/usb/devices/${id}/power/control
@joshskidmore
joshskidmore / ubuntu-mate-gpd-micropc.sh
Created June 28, 2019 10:43
ubuntu-mate-gpd-micropc.sh
#!/usr/bin/env bash
# update
apt -y update
apt -y upgrade
apt -y dist-upgrade
# 5.2 mainline kernel
cd /tmp
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.2-rc6/linux-headers-5.2.0-050200rc6_5.2.0-050200rc6.201906222033_all.deb
@joshskidmore
joshskidmore / lspci.txt
Created July 1, 2019 11:34
gpd-micro-lspci-vv
00:00.0 Host bridge: Intel Corporation Device 31f0 (rev 03)
DeviceName: Onboard - Other
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0
00:00.1 Signal processing controller: Intel Corporation Celeron/Pentium Silver Processor Dynamic Platform and Thermal Framework Processor Participant (rev 03)
DeviceName: Onboard - Other
Subsystem: Intel Corporation Celeron/Pentium Silver Processor Dynamic Platform and Thermal Framework Processor Participant
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
@joshskidmore
joshskidmore / gpd-micropc-keyboard.sh
Created July 5, 2019 14:56
Uses xmodmap + xcape to use the MicroPC's bottom row a bit more efficiently
#!/usr/bin/env bash
# resets keyboard; kills all running instances of xcape
reset_kbd () {
local xcape_cnt=$(pgrep xcape | wc -l)
echo " - reset_kbd"
echo " - killing $xcape_cnt instances of xcape"
setxkbmap -layout us
@joshskidmore
joshskidmore / keyboard.sh
Created August 27, 2019 09:51
keyboard.sh
#!/usr/bin/env bash
export DISPLAY=:0
HARD_RESET=$1
reset_kbd () {
xdotool keyup Shift_L Shift_R Control_L Control_R Meta_L Meta_R Alt_L Alt_R Super_L Super_R Hyper_L Hyper_R ISO_Level2_Latch ISO_Level3_Shift ISO_Level3_Latch ISO_Level3_Lock ISO_Level5_Shift ISO_Level5_Latch ISO_Level5_Lock Caps_Lock 204 205 206 207
@joshskidmore
joshskidmore / p2max-dsdt-check.sh
Last active September 15, 2019 16:16
p2max-dsdt-check.sh
#!/usr/bin/env bash
_dmesg=$(dmesg)
bios_version=$(echo -e "$_dmesg" | grep GPD | awk '{ print $9 }')
echo "You are running GPD P2 BIOS version $bios_version"
if [[ "$_dmesg" =~ "20190816" ]]; then
echo "You have the DSDT for v0.23 loaded (joshwiththegoodhair version)"