Skip to content

Instantly share code, notes, and snippets.

View dylanlott's full-sized avatar
🏗️
Hacking

d7t dylanlott

🏗️
Hacking
View GitHub Profile
@dylanlott
dylanlott / dns_lookup.go
Created May 3, 2019 02:51 — forked from miguelmota/dns_lookup.go
Golang DNS lookup (ip, mx, txt, etc)
package main
import (
"fmt"
"net"
)
func main() {
ips, err := net.LookupIP("google.com")
if err != nil {
@dylanlott
dylanlott / AesUtil.js
Created March 12, 2019 20:55 — forked from AndiDittrich/AesUtil.js
Node.js - AES Encryption/Decryption with AES-256-GCM using random Initialization Vector + Salt
// AES Encryption/Decryption with AES-256-GCM using random Initialization Vector + Salt
// ----------------------------------------------------------------------------------------
// the encrypted datablock is base64 encoded for easy data exchange.
// if you have the option to store data binary save consider to remove the encoding to reduce storage size
// ----------------------------------------------------------------------------------------
// format of encrypted data - used by this example. not an official format
//
// +--------------------+-----------------------+----------------+----------------+
// | SALT | Initialization Vector | Auth Tag | Payload |
// | Used to derive key | AES GCM XOR Init | Data Integrity | Encrypted Data |
@dylanlott
dylanlott / duptools.sh
Created January 21, 2019 23:30 — forked from tsileo/duptools.sh
A bash script to simplify backup management with duplicity (encrypted incremental backups on amazon S3)
#!/bin/bash
export AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY
export AWS_SECRET_ACCESS_KEY=YOUR_SECRET_ACCESS_KEY
export PASSPHRASE=YOU_PASSHRASE
# directories, space separated
SOURCE="/home/thomas/backup /home/thomas/bin /home/thomas/documents"
BUCKET=s3+http://mybucket
LOGFILE=/home/thomas/tmp/duplicity.log
# set email to receive a backup report
@dylanlott
dylanlott / dht-walkthrough.md
Created August 8, 2018 22:28 — forked from gubatron/dht-walkthrough.md
DHT walkthrough notes

DHT Walkthrough Notes

I've put together these notes as I read about DHT's in depth and then learned how the libtorrent implementation based on the Kademlia paper actually works.

What problem does this solve?

400,000,000,000 (400 billion stars), that's a 4 followed by 11 zeros. The number of atoms in the universe is estimated to be around 10^82. A DHT with keys of 160 bits, can have 2^160 possible numbers, which is around 10^48

@dylanlott
dylanlott / default.conf
Created May 17, 2017 17:54
NGiNX Configuration for Vue-Router in HTML5 Mode
server {
listen 80 default_server;
listen [::]:80 default_server;
root /your/root/path;
index index.html;
server_name you.server.com;
@dylanlott
dylanlott / sinon-chai-expect.md
Created March 21, 2017 22:27 — forked from patocallaghan/sinon-chai-expect.md
Sinon Chai assertions in expect style.Examples from http://chaijs.com/plugins/sinon-chai #sinon #chai #javascript

Sinon JS

##Spies

//Anonymous function
var spy = sinon.spy();

//Provided Function
var spy = sinon.spy(myFunc);
@dylanlott
dylanlott / deploying-with-flightplan.md
Last active February 21, 2017 17:12 — forked from learncodeacademy/flightplan-deploy.md
Deploy Node.js Apps with Flightplan

Setup your server

Add a Passwordless Deploy user

(wherever it says url.com, use your server's domain or IP)

Login to new server as root, then add a deploy user

sudo useradd --create-home -s /bin/bash deploy
sudo adduser deploy sudo