Skip to content

Instantly share code, notes, and snippets.

View ChristopherA's full-sized avatar

Christopher Allen ChristopherA

View GitHub Profile
@ChristopherA
ChristopherA / sshgpgperm.sh
Last active March 14, 2021 12:59
SCP SSH & GPG and Set Folder Permissions
#on local machine
scp -Cvpr .private/ [email protected]:.ssh/
scp -Cvpr .private/ [email protected]:.gnupg/
scp -Cvpr .private/ [email protected]:.profile.local
ssh [email protected]
#on remote machine
sudo -v
sudo chown -R christophera ~christophera/.gnupg/
sudo chown -R christophera ~christophera/.gnupg/*
sudo chown -R christophera ~christophera/.ssh/*
@ChristopherA
ChristopherA / 1-setup.md
Created April 5, 2018 13:18 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS Sierra/High Sierra

Methods of Signing with GPG

There are now two ways to approach this:

  1. Using gpg and generating keys
  2. Using Kryptonite by krypt.co

This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing with either GPG or Krypt.co.

@ChristopherA
ChristopherA / mas_macos.txt
Created April 5, 2018 13:51 — forked from patrickgill/macos_appstore.txt
macOS App Store IDs
444303913 macOS 10.7 Lion
537386512 macOS 10.8 Mountain Lion
675248567 macOS 10.9 Mavericks
915041082 macOS 10.10 Yosemite
1147835434 macOS 10.11 El Capitan
1018109117 macOS 10.11 El Capitan (new)
1127487414 macOS 10.12 Sierra
1246284741 macOS 10.13 High Sierra
@ChristopherA
ChristopherA / get_friends.js
Created June 11, 2018 06:23
grab facebook friend URLs
var friends = document.querySelectorAll('._698 > div > a');
urls = [];
for (var i = 0, len = friends.length; i < len; i++) {
urls.push(friends[i].href);
}
JSON.stringify(urls);
@ChristopherA
ChristopherA / finddupshere.sh
Last active July 8, 2018 20:49
Find Duplicates Here
# Move to the target folder using the cd command. Example: cd ~/Documents.
#
find . -size 20 \! -type d -exec cksum {} \; | sort | tee /tmp/f.tmp | cut -f 1,2 -d ‘ ‘ | uniq -d | grep -hif – /tmp/f.tmp > duplicates.txt
@ChristopherA
ChristopherA / debian9generic.stackscript
Last active August 13, 2018 21:50
Debian 9 Generic Linode Stackscript
#!/bin/bash
# This block defines the variables the user of the script needs to input
# when deploying using this script.
# <UDF name="hostname" label="Short Hostname" example="Example: bitcoincore-testnet-pruned" />
# HOSTNAME=
# <UDF name="fqdn" label="Fully Qualified Hostname" example="Example: bitcoincore-testnet-pruned.local or bitcoincore-testnet-pruned.domain.com"/>
# FQDN=
@ChristopherA
ChristopherA / git-submodule-tips.md
Last active May 24, 2024 10:24
`git submodule` Tips #git #submodule

git submodule Tips

To clone a repo with submodules

git clone --recursive [email protected]:url_to/awesome_submodule.git path_to_awesome_submodule

Add a submodule clone into an existing repo

git submodule add [email protected]:url_to/awesome_submodule.git path_to_awesome_submodule
@ChristopherA
ChristopherA / deleteduplicatelines.sh
Created August 27, 2018 08:48
Delete duplicate lines
awk '! seen[$0]++'
# Efficiently prints lines from a file without duplicates, without sorting (unlike `sort -u`)
@ChristopherA
ChristopherA / BrewFileRake.md
Created February 18, 2019 07:54
Clean Brewfile of Accidental Leaves

brew bundle dump will leave out leaf dependencies unless you accidently added them specifically. This script will clean them out of the Brewfile

cat Brewfile | egrep "$(brew leaves | xargs printf '"%s"|')tap|cask" > Brewfile.leaves
@ChristopherA
ChristopherA / installkeys.sh
Last active February 25, 2019 07:46
Install Keys on New macOS Mojave
# THIS IS IN A WORK IN PROGRESS, DO NOT USE!
# curl -L https://gist.githubusercontent.com/ChristopherA/6075798aeef4f9bbb4afd26c93f2506b/raw/installkeys.sh | bash
sudo chown -R christophera ~christophera/.gnupg/
sudo chown -R christophera ~christophera/.gnupg/*
sudo chown -R christophera ~christophera/.ssh/*
sudo chown -R christophera ~christophera/.ssh/*
chmod 755 ~
chmod 600 ~/.ssh/*
chmod 600 ~/.ssh/id_*