Skip to content

Instantly share code, notes, and snippets.

View sneak's full-sized avatar

Jeffrey Paul sneak

View GitHub Profile
@sneak
sneak / find.sh
Created October 4, 2016 00:41
way to find pkg osx is downloading to slipstream
lsof -n | grep REG | colrm 1 84 | grep -v Fonts | grep -v " " | sort | uniq | xargs file | grep xar
# then, *hard* link the found file to /tmp/mypackage.pkg and rename it when the download is finished.
@sneak
sneak / steemrpi.sh
Last active November 9, 2016 13:37
Script to build steemd on raspberry pi 3 model B
#!/bin/bash
# enable bigger swap on rpi
if [[ ! -e /swapfile ]]; then
fallocate -l 2G /swapfile
mkswap /swapfile
chmod 0600 /swapfile
swapon /swapfile
fi
#!/bin/bash
zdb -l /path/to/diskpartition
zpool import -D rusty01 # once pool name is found
#!/bin/bash
tar -c ~/Library/Application?Support/MobileSync/Backup/ | \
pv | pbzip2 | \
gpg --encrypt -r df2a55c2 > /Volumes/rusty01/iosbackup.tbz2.gpg
@sneak
sneak / rsync-app-exclude-osx.txt
Last active October 6, 2016 22:39
things to exclude from homedir rsync on osx
**/.DS_Store
**/App?Store.app
**/Automator.app
**/Calculator.app
**/Calendar.app
**/Chess.app
**/Contacts.app
**/DVD?Player.app
**/Dashboard.app
**/Dictionary.app
# check for existing running agent info
if [[ -e $HOME/.gpg-agent-info ]]; then
source $HOME/.gpg-agent-info
export GPG_AGENT_INFO SSH_AUTH_SOCK SSH_AGENT_PID
fi
# test existing agent, remove info file if not working
ssh-add -L 2>/dev/null >/dev/null || rm -f $HOME/.gpg-agent-info
# if no info file, start up potentially-new, working agent
if [[ ! -e $HOME/.gpg-agent-info ]]; then
gpg-agent \
sneak@pris:~$ gpg --keyserver pgp.mit.edu --recv-key df2a55c2
gpg: keyring `/Users/sneak/.gnupg/secring.gpg' created
gpg: keyring `/Users/sneak/.gnupg/pubring.gpg' created
gpg: requesting key DF2A55C2 from hkp server pgp.mit.edu
gpg: /Users/sneak/.gnupg/trustdb.gpg: trustdb created
gpg: key DF2A55C2: public key "Jeffrey Paul <[email protected]>" imported
gpg: key DF2A55C2: public key "Jeffrey Paul <[email protected]>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 2
gpg: imported: 2 (RSA: 2)
body {
margin:40px auto;
max-width: 650px;
line-height: 1.6;
font-size: 18px;
color: #444;
padding: 0 10px
}
h1,h2,h3 {
@sneak
sneak / generate-pinlist.py
Created January 9, 2017 06:58
generate-pinlist.py
#!/usr/bin/env python
# (c) 2017 Jeffrey Paul <[email protected]> - All rights reserved.
#import ipfsapi
from sanelogging import log
from datetime import datetime
import json
import os
import os.path
import re
#!/bin/bash
DESTPREFIX="papertrail/logs/12345"
BUCKET="org-global-papertrail-archive"
for FN in $(cat dailies.txt); do
ORIGPATH="old/$FN"
NEWDT=$(echo $FN | awk -F- '{print $1 "-" $2 "-" $3}')
NEWDT=$(echo $NEWDT | awk -F. '{print $1}')
NEWPATH="$DESTPREFIX/dt=$NEWDT/$FN"