Skip to content

Instantly share code, notes, and snippets.

View xeaone's full-sized avatar
:bowtie:

Alexander Elias xeaone

:bowtie:
View GitHub Profile
@xeaone
xeaone / avrdude-flash.sh
Created September 5, 2018 05:45 — forked from nooges/avrdude-flash.sh
Script for flashing .hex file onto Pro Micro with avrdude
#!/usr/bin/env bash
MCU=atmega32u4
if grep -q -s Microsoft /proc/version; then
echo 'ERROR: Pro Micros can not be flashed within the Windows Subsystem for Linux (WSL) currently. Instead, take the .hex file generated and flash it using AVRDUDE, AVRDUDESS, or XLoader.'
exit 1
fi
if [ "$#" -ne 1 ]; then
@xeaone
xeaone / LetsEncrypt.md
Created August 24, 2018 22:45 — forked from davestevens/LetsEncrypt.md
Let’s Encrypt setup for Apache, NGINX & Node.js

Let's Encrypt

Examples of getting certificates from Let's Encrypt working on Apache, NGINX and Node.js servers.

Obtain certificates

I chose to use the manual method, you have to make a file available to verify you own the domain. Follow the commands from running

git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
@xeaone
xeaone / client.js
Last active August 21, 2018 01:21 — forked from agrueneberg/client.html
HMAC Signature Verification
const Http = require('http');
const Crypto = require('crypto');
const query = 'key=value';
const sharedSecret = 'secret';
const signature = Crypto.createHmac('sha256', sharedSecret).update(query).digest('hex');
Http.get({
port: 8000,
@xeaone
xeaone / encryption.js
Created March 8, 2018 19:38 — forked from vlucas/encryption.js
Stronger Encryption and Decryption in Node.js
'use strict';
const crypto = require('crypto');
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bytes (32 characters)
const IV_LENGTH = 16; // For AES, this is always 16
function encrypt(text) {
let iv = crypto.randomBytes(IV_LENGTH);
let cipher = crypto.createCipheriv('aes-256-cbc', new Buffer(ENCRYPTION_KEY), iv);