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 | |
# Print the number of video frames in $1 | |
ffprobe -count_frames -v error -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 ${1} |
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 | |
# An nvidia and cuda installer for Ubuntu | |
# Set env DEBUG_MODE=1 (up to 4) for more verbosity | |
if [[ "$DEBUG_MODE" == "" ]] || [ $DEBUG_MODE ! -gt 0 ]; then export DEBUG_MODE=0; fi | |
# Set env ASSUME_YES=-y for less interactivity | |
if [[ "$ASSUME_YES" != "" ]]; then export ASSUME_YES="-y"; else export ASSUME_YES=''; fi | |
## Pretty Print |
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 | |
apt-get update &>/dev/null | |
if [[ "$(lsmod | grep wireguard)" -n ]]; then | |
export HAS_WG_MODULE=1 | |
else | |
apt-get install wireguard wireguard-tools -y &>/dev/null | |
modprobe wireguard | |
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
#KEYBASE_ALLOW_PTRACE= | |
#KEYBASE_ALLOW_ROOT= | |
#KEYBASE_API_DUMP= | |
#KEYBASE_API_TIMEOUT= | |
#KEYBASE_APP_TYPE= | |
#KEYBASE_ATTACHMENT_DISABLE_MULTI= | |
#KEYBASE_ATTACHMENT_HTTP_START= | |
#KEYBASE_AUTO_FORK= | |
#KEYBASE_AUTOSTART= | |
#KEYBASE_AVATAR_SOURCE= |
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 | |
# Sets up the directory tree and necessary files for unpriv LXC GUI containers. | |
# Expects the default LXC setup (lxcbr0) to be functioning | |
# Need to install desktop environment inside each container. | |
UNAME="ubuntu" | |
UHOME="/home/$UNAME" | |
mkdir -p "$UHOME/.config/lxc" # /etc/lxc | |
touch "$UHOME/.config/lxc/lxc.conf" # /etc/lxc/lxc.conf |
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
# Adapted from https://blog.simos.info/how-to-easily-run-graphics-accelerated-gui-apps-in-lxd-containers-on-your-ubuntu-desktop/ | |
# | |
config: | |
environment.DISPLAY: :0 | |
raw.idmap: both 1000 1000 | |
user.user-data: | | |
#cloud-config | |
runcmd: | |
- 'sed -i "s/; enable-shm = yes/enable-shm = no/g" /etc/pulse/client.conf' | |
- 'echo export PULSE_SERVER=unix:/tmp/.pulse-native | tee --append /home/ubuntu/.profile' |
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 | |
# This script will perform the same function as `do-release-upgrade` when that tool is giving | |
# an error for an EOL verison of Ubuntu, or some other "cannot upgrade from <current> to <next>". | |
# It does this safely by downloading the release-upgrade meta-pacakge from your target distribution. | |
# | |
# See https://help.ubuntu.com/community/EOLUpgrades/ for more information. | |
# Make sure a release is given as argument | |
if [[ "$1" == "" ]]; then |
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 a nonstandard resolution (ultrawide) interactively | |
# | |
### | |
# Define default resolution (and monitor ID if multiple monitors) | |
# Will be overridden is passed to script as arguments | |
# | |
# |
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 | |
# | |
# Source this file with an to change the current prompt color | |
# No arguments for normal (green) and red (root) defaults | |
# Include an integer 0 - 255 after for an x256term color prompt | |
# | |
# You can also paste into .bashrc with $1 replace with an integer or variable | |
# | |
# Examples: | |
# |
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 | |
# First argument passed to script is pgp key url | |
# Download key to memory with curl or wget (fallback) | |
key="$(curl -sSL "$1" 2>/dev/null || wget --quiet -O - "$1" 2>/dev/null)" | |
# Parse just the fingerprint and email, then separate into their own variables | |
both="$(gpg --show-keys --keyid-format=long --list-options show-only-fpr-mbox=yes <<< "$key")" | |
fingerprint="$(echo "$both" | cut -d' ' -f1)" | |
email="$(echo "$both" | cut -d' ' -f2)" |
NewerOlder