Skip to content

Instantly share code, notes, and snippets.

View dragon788's full-sized avatar

dragon788 dragon788

View GitHub Profile
@dragon788
dragon788 / !notes.md
Created January 5, 2020 01:10
Getting a PiVPN profile working on GL.iNet GL-AR-750S

If you've used the PiVPN scripts to generate a profile and protected your private key with a passphrase (a very good practice), then you will need a way to decrypt this during the "non-interactive" OpenVPN connection on the router.

The option that I used that worked was to create a separate file that could be referenced in the profile by adding an askpass option that contains only the passphrase.

https://stackoverflow.com/a/24071181/3794873

I'm planning to also test with a dummy empty .pass file since it seems like maybe the OpenVPN profile upload in the GL.iNet firmware doesn't realize that the PiVPN generated ovpn profile has an encrypted private key so it doesn't prompt for one until it sees multiple files in a zip. If you upload a zip that contains the ovpn profile and another file, it seems to assume that the other file is a key or certificate that might need a passphrase so it requests one after the upload.

@dragon788
dragon788 / shortcuts.md
Created June 29, 2021 18:12
Git.io routes I use for easier curl/wget grabbing

Git.io routes I use for easier curl/wget grabbing

getcrouton https://github.com/dnschneid/crouton/raw/master/installer/crouton
crouton https://github.com/dnschneid/crouton
@dragon788
dragon788 / !scdrand-yubikey-nitro-compile-and-installation.md
Last active May 9, 2021 10:58
Script to use scdrand to generate entropy from smartcard

Using scdrand to utilize a smartcard as a hardware RNG

Copy/download the quick build steps file and execute it with sh quick-build-steps.sh and if you are on Debian and have Docker it should fetch the Dockerfile here which when run with the docker build in the script clones scdtools and installs scdrand (and scdtotp) on your host system.

After you've installed it you can run sudo scdrand to get try and add some entropy to the kernel pool.

@dragon788
dragon788 / fetch_tools.md
Last active March 30, 2021 15:57
Handy tool snippets
VERSION=`curl  "https://api.github.com/repos/cli/cli/releases/latest" | \
grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/' | cut -c2-`; \
curl -sSL https://github.com/cli/cli/releases/download/v${VERSION}/gh_${VERSION}_linux_amd64.tar.gz | \
sudo tar xzfC - /usr/local --strip-components=1
@dragon788
dragon788 / build.sh
Created February 16, 2018 21:38 — forked from Forst/build.sh
Ubuntu ISO with preseed.cfg generation script
#!/bin/bash
## FORSTWOOF UBUNTU PRESEED :: BUILD SCRIPT
# Quit on first error
set -e
# Temporary directory for the build
TMP="/var/tmp/ubuntu-build"
@dragon788
dragon788 / notes.md
Created October 4, 2020 14:08
Chromefy / Project Croissant 🥐 notes

Creating the image isn't hard, the trouble is the stupid installer never seems to work properly according to their directions on most system that I've tried (primarily Chromebooks, so YMMV). The only surefire method that has worked for me every single time is using dd from the Ctrl+Alt+F2 shell (or one in a logged in account, but then that account gets copied over to the target system) or dd or the 'python-awesome-dd' script from a Linux LiveUSB. If you use dd you probably need to run the fix-grub.sh script from the chromefy repo and the lab folder. There is a short URL for it, curl -L goo.gl/HdjwAZ | bash -s /dev/sda to grab the file and run it assuming you are in a root shell.

You MUST be in Developer Mode if you are attempting to Chromefy an existing ChromeOS device. Then after the Dev Mode changeover wipes the device you should access the system shell (aka VTY) using Ctrl+Alt+F2 (usually the Forward key depending on the age of the device but may also be Refresh or something else, and you m

@dragon788
dragon788 / crostini-libvirt-vagrant.md
Last active June 17, 2020 01:32
Crostini libvirt tips and tricks

libvirt tweaks for Crostini

Important bits

sudo apt install virt-manager # includes libvirt/virsh/etc

curl -L https://vagrantup.com/whatever/vagrant-version.deb
sudo dpkg -i vagrant*.deb

For the vagrant-libvirt plugin you may need to use an alternate ruby/vagrant path in the call to install the plugin.

@dragon788
dragon788 / reset-libvirt-qemu-kvm-tablet-input.sh
Created March 18, 2020 04:08
Sometimes the mouse cursor stops responding or two finger scrolling doesn't work, this quick reset fixes that
virsh detach-device --domain macOS-Simple-KVM --live --conf
ig <( cat << 'EOF'
<input type='tablet' bus='usb'>
<alias name='input3'/>
<address type='usb' bus='0' port='2'/>
</input>
EOF
)
sleep 2
virsh attach-device --domain macOS-Simple-KVM --live --conf
@dragon788
dragon788 / README.md
Created June 27, 2017 15:26 — forked from pdanford/README.md
Applescript to launch iTerm2 Version 3+ from OS X Finder via keyboard shortcut or Toolbar

Description

Based on info from http://peterdowns.com/posts/open-iterm-finder-service.html but with modified behavior and fixed to work with iTerm2 version 3 or later. It will not work with older versions of iTerm. The modified behavior is to open a new terminal window for each invocation instead of reusing an already open window. Update - The original author released a build script for the newer iTerm2 versions at https://github.com/peterldowns/iterm2-finder-tools that keeps the original behavior of reusing an open iTerm2 window.

To open iTerm2 at selected folder with keyboard shortcut

  1. Run Automator, select a new Service
  2. Select Utilities -> Double click ‘Run AppleScript’
  3. Service receives selected 'folders' in 'finder.app'
  4. Paste script:
@dragon788
dragon788 / !readme.md
Last active February 27, 2020 18:24
Clear Linux basic setup

Setting up Clear Linux with i3 and Yubikey bits

See [bootstrap.sh] for quickest swupd package bundle installation.

If you are tricksy you can curl the raw [bootstrap.sh] file and examine it and then chmod +x bootstrap.sh and run it yourself.

The bootstrap currently doesn't automatically force you into i3, but if you log out and select your user from the login screen and click the ⚙️ icon and select i3 from the list, then enter your password if you didn't already and login.