Skip to content

Instantly share code, notes, and snippets.

View DevoKun's full-sized avatar

Devon Hubner DevoKun

View GitHub Profile
@DevoKun
DevoKun / jq_json_keys_to_string.sh
Created March 13, 2019 13:00
Join multiple json keys in to a single string using jq
cat my.json | jq '. | "\(.time): \(.descr)"'
@DevoKun
DevoKun / presign_s3_url.sh
Created March 6, 2019 13:42
Presign an S3 URL
aws s3 presign s3://my-bycket/filename.csv --expires-in 86400
# secs = mins = hours = days
# 3600 = 60 = 1
# 7200 = 120 = 2
# 43200 = 720 = 12
# 86400 = 1440 = 24 = 1
# 172800 = 2880 = 48 = 2
# 345600 = 5760 = 96 = 4
# 604800 = 10080 = 168 = 7 (max)
@DevoKun
DevoKun / 7zip_encrypt_zip.sh
Created March 6, 2019 13:41
7zip to encrypt a zip file
##
## I choose *zip* in the hopes that the recipient already
## has a local zip tool that supports the encryption
## and does not need to download 7zip.
##
7za a -mem=AES -p${PASSWORD} -tzip \
devon_password.txt.zip \
devon_password.txt
@DevoKun
DevoKun / Convert_ppk_to_pem_on_MacOS_X.sh
Created March 2, 2019 20:31
Convert ppk to pem on MacOS X
brew install putty
puttygen key.ppk -O private-openssh -o key.pem
@DevoKun
DevoKun / GitTricks.md
Last active October 3, 2021 01:45
Git Tricks I use stored in a handy place

undo git rm $FILENAME or git add -A

##
## Restore the file status in the index
##
git reset -- <file>

##
## check out a copy from the index
@DevoKun
DevoKun / Export_public_key_from_ssh_private_key.sh
Created February 21, 2019 20:03
Export public key from ssh private key
ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub
@DevoKun
DevoKun / Transfer_Color_Picker_swatches_between_Macs.sh
Created February 21, 2019 20:02
Transfer Color Picker swatches between Macs
zip -9r NSColorPanelSwatches.zip ~/Library/Colors/NSColorPanelSwatches.plist
unzip NSColorPanelSwatches.zip
@DevoKun
DevoKun / expand-qcow2-disk-image.sh
Created February 21, 2019 02:09
Expand qcow2 disk image
qemu-img resize disk.qcow2 +2G
@DevoKun
DevoKun / .vimrc
Created February 21, 2019 01:24
VIM: Switching off auto-indentation
" Switch off all auto-indenting
set nocindent
set nosmartindent
set noautoindent
set indentexpr=
filetype indent off
filetype plugin indent off
@DevoKun
DevoKun / git_commit_past.sh
Created February 18, 2019 15:45
Make a git commit in the past
export GIT_COMMITTER_DATE="Sep 8, 2012 13:33:48 PM GMT-0500"
git add makepass.exe makepass.lst makepass_exe.md
git commit --date "${GIT_COMMITTER_DATE}" -m "Added MakePass.EXE info from archive.org." makepass.exe makepass.lst makepass_exe.md
export GIT_COMMITTER_DATE="Sep 8, 2012 20:20:20 AM GMT-0500"
git add index.php