Skip to content

Instantly share code, notes, and snippets.

View atoponce's full-sized avatar
Crypto coffee

Aaron Toponce atoponce

Crypto coffee
View GitHub Profile
### Keybase proof
I hereby claim:
* I am atoponce on github.
* I am atoponce (https://keybase.io/atoponce) on keybase.
* I have a public key whose fingerprint is E041 3539 273A 6534 A3E1 9259 22EE E048 8086 060F
To claim this, I am signing this object:
#!/bin/bash
HOME=/var/services/homes/backupchef
SNAPSHOT_DIR=$HOME/backups/myserver
LOG_DIR=$HOME/backups
KEY_ID=$HOME/.ssh/id_rsa
RM=/bin/rm;
MV=/bin/mv;
CP=/bin/cp;
$RM -rf $SNAPSHOT_DIR/daily.6;
#!/bin/bash
HOME=/var/services/homes/backupchef
SNAPSHOT_DIR=$HOME/backups/myserver
LOG_DIR=$HOME/backups
KEY_ID=$HOME/.ssh/id_rsa
RM=/bin/rm;
MV=/bin/mv;
CP=/bin/cp;
$RM -rf $SNAPSHOT_DIR/daily.6;
#!/bin/bash
HOME=/var/services/homes/backupchef
SNAPSHOT_DIR=$HOME/backups/myserver
LOG_DIR=$HOME/backups
KEY_ID=$HOME/.ssh/id_rsa
RM=/bin/rm;
MV=/bin/mv;
CP=/bin/cp;
$RM -rf $SNAPSHOT_DIR/daily.6;
@atoponce
atoponce / gist:4b495da9e3a876c44169
Last active February 21, 2016 18:31
My Vivint Wireless outages outside of my control
Uptime percentage: 99.91271
Account created 2015-12-12 12:00: http://ae7.st/s/w4tc6
- 104,940 minutes from 2015-12-12 12:00 to 2016-02-23 09:00
Outages:
240m: 2015-12-31 05:00 - 2015-12-31 09:00 (http://ae7.st/s/licq-)
600m: 2015-12-31 23:00 - 2016-01-01 09:00 (http://ae7.st/s/ic9lh)
600m: 2016-02-18 11:30 - 2016-02-18 21:30 (http://ae7.st/s/85hko)
7720m: 2016-02-18 00:20 - 2016-02-23 09:00 (http://ae7.st/s/ifgl4)
@atoponce
atoponce / sha256-crypto.py
Last active December 10, 2023 11:00
Encryption and decryption with SHA-256
#!/usr/bin/python
import hashlib
nonce = 0
key = 'f3q4uszyt67cfatq'
pad = hashlib.sha256(str(nonce)+key).digest()
# encrypt
plaintext = 'the quick brown fox jumped over.'
@atoponce
atoponce / gist:07d8d4c833873be2f68c34f9afc5a78a
Last active March 19, 2024 17:24 — forked from tqbf/gist:be58d2d39690c3b366ad
Cryptographic Best Practices

Cryptographic Best Practices

Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.

The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from

@atoponce
atoponce / README.md
Last active July 30, 2019 11:00
Technical Documentation Standards

Documentation Standards

When creating documentation for your project, you should take advantage of some standards defined by the IETF for metasyntactic variables, domain names and IP addresses. Then, if people automatically copy and paste your examples, nothing harmful can (SHOULD!) happen.

Metasyntactic Variables

RFC 3092 was created on April 1 as a joke (as most RFCs created on that day are). However, there is sane logic to using standardized variables in code examples when documenting an open source project, or providing examples of how or how not to do some concept.

The variables are listed as follows:

  • foo
  • bar
@atoponce
atoponce / README.md
Last active November 30, 2017 17:20
Syntax for setting up Vim as a secure password manager, with syntax highlighting and shoulder surfing security.

Introduction

This allows you to use Vim as a secure password manager. It was inspired and mostly lifted from http://pig-monkey.com/2013/04/password-management-vim-gnupg/. It differs in that a specification is now defined, and a syntax highlighting file is provided to highlight keywords and hide passwords. Additionally, this Gist uses *.pw file extensions to trigger the syntax highlighting, in addition to some custom GPG config.

GnuPG.vim

Save in ~/.vim/plugin/gnupg.vim. Grab from https://github.com/jamessan/vim-gnupg.

Vimrc

Save in ~/.vimrc:

if has("autocmd")

@atoponce
atoponce / gen_pass.sh
Last active September 6, 2016 15:18
Password generation in POSIX sh
shuff() {
if [ $(command -v shuf) ]; then
shuf -n "$1"
elif [ $(command -v shuffle) ]; then
shuffle -f /dev/stdin -p "$1"
else
awk 'BEGIN{
"od -tu4 -N4 -A n /dev/urandom" | getline
srand(0+$0)
}