Skip to content

Instantly share code, notes, and snippets.

View dwallraff's full-sized avatar

Dave Wallraff dwallraff

View GitHub Profile
@dwallraff
dwallraff / apt-get_socks5.md
Created December 26, 2018 04:07
apt-get through a socks5 proxy ?????

Should work through the config

Acquire::socks::proxy "socks5://server:port";
To keep apt.conf clean and avoid problems at Linux upgrade I created a new file (/etc/apt/apt.conf.d/12proxy) and added the config file to it.

Maybe UDP tunneling?

@dwallraff
dwallraff / generate_passwords.sh
Last active February 5, 2019 08:43
Generate random(ish) passwords from the cli (thanks to @markpudd for the idea)
#! /usr/bin/env bash
## Use openssl. Use hex not base64, special characters suck in passwords
# the number refers to the number of bytes, so with 2 hex characters per byte, this is a 32 character password.
openssl rand -hex 16
## Just straight up urandom. Give me 5 32 char alpha-numeric passwords
tr -cd '[:alnum:]' < /dev/urandom | fold -w 32 | head -n 5
tr -cd 'a-zA-Z0-9' < /dev/urandom | fold -w 32 | head -n 5
@dwallraff
dwallraff / 1password_backup.sh
Last active January 27, 2024 19:44
Backup 1Password (item metadata and docs)
#! /usr/bin/env bash
#-- Dave Wallraff
# First things first, I'm the realest...
### backup everything in 1password
# curl -sL dwallraff.com/1password | bash
# wrap in a function for curl|bash
do_stuff() {
@dwallraff
dwallraff / op_get_docs.sh
Last active September 28, 2018 11:24
Export all non-trashed docs from 1Password
#! /usr/bin/env bash
## Copy all docs from 1password
mkdir files || exit
# Get all current (non-trashed) doc UUIDs and titles
# shellcheck disable=2016
op list documents | jq -r '. as $in | keys[] | select($in[.].trashed=="N") as $res | [$in[$res].uuid, $in[$res].overview.title] | @json' > files/docs_list
@dwallraff
dwallraff / op_get_items.sh
Last active September 28, 2018 11:12
Export all item metadata from 1Password
#! /usr/bin/env bash
## Copy all item metadata from 1password
# Get all item UUIDs
# shellcheck disable=2016
op list items | jq -r '.[].uuid' > items_list
# Loop over list and save off all the metadata
TODAY=$(date "+%Y%m%d")
@dwallraff
dwallraff / jumpbox.sh
Last active May 24, 2023 03:26
Personal jumpbox bootstrap script -- curl -L dwallraff.com/jumpbox | bash
#! /usr/bin/env bash
#-- Dave Wallraff
# First things first, I'm the realest...
### personal jumpbox bootstrap script
# curl -L dwallraff.com/jumpbox | bash
# wrap in a function for curl|bash
do_stuff() {
@dwallraff
dwallraff / encrypted_tarball.sh
Last active April 20, 2021 18:10
Encrypted tarball
## Encrypt (GPG)
tar hcz <dir> | gpg --batch --cipher-algo AES256 --symmetric --output <filename>.tar.gz.enc
## Decrypt (GPG)
gpg --no-verbose --quiet --batch --cipher-algo AES256 --decrypt <filename>.tar.gz.enc | tar xvz
## Encrypt (SSL)
tar cz <dir> | openssl enc -e -aes-256-cbc -salt -md sha256 -out <filename>.tar.gz.enc
@dwallraff
dwallraff / bootstrap.sh
Last active March 7, 2025 21:55
Crostini penguin bootstrap script -- curl -sL dwallraff.com/bootstrap | bash
#! /usr/bin/env bash
#-- Dave Wallraff
# First things first, I'm the realest...
### bootstrap crostini container
# curl -sL dwallraff.com/bootstrap | bash
# wrap in a function for curl|bash
do_stuff() {
@dwallraff
dwallraff / fix_github_https_repo.sh
Created September 21, 2018 05:20 — forked from m14t/fix_github_https_repo.sh
Convert HTTPS github clones to use SSH
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
fi
@dwallraff
dwallraff / sublime3_keymappings.json
Created September 21, 2018 05:07
Sublime3 linux key mappings
[
{ "keys": ["ctrl+tab"], "command": "next_view" },
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" },
{ "keys": ["ctrl+shift+G"], "command": "find_all_under" }
]