Skip to content

Instantly share code, notes, and snippets.

View Cellularhacker's full-sized avatar
🏠
Working from home

Cellularhacker Cellularhacker

🏠
Working from home
View GitHub Profile
@donvito
donvito / main.go
Last active April 24, 2024 03:13
AES-256 encrypt/decrypt in Go
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/hex"
"fmt"
"io"
)
@miguelmota
miguelmota / rsa_util.go
Last active April 21, 2024 15:10
Golang RSA encrypt and decrypt example
package ciphers
import (
"crypto/rand"
"crypto/rsa"
"crypto/sha512"
"crypto/x509"
"encoding/pem"
"log"
)
@chrisveness
chrisveness / mongodb-objectid.js
Created September 14, 2016 11:32
Generates a MongoDB-style ObjectId in Node.js
/**
* Generates a MongoDB-style ObjectId in Node.js. Uses nanosecond timestamp in place of counter;
* should be impossible for same process to generate multiple objectId in same nanosecond? (clock
* drift can result in an *extremely* remote possibility of id conflicts).
*
* @returns {string} Id in same format as MongoDB ObjectId.
*/
function objectId() {
const os = require('os');
const crypto = require('crypto');
@shrinath-shenoy
shrinath-shenoy / mac_openssl_include.sh
Created August 24, 2016 07:25 — forked from sunliwen/mac_openssl_include.sh
On Mac - fatal error: 'openssl/aes.h' file not found #include <openssl/aes.h>
# Install pip install cryptography, path issue with openssl/aes.h will occur. The reason is Apple deprecated openssl and the compiler can't find the one installed by homebrew.
# So the following line will help.
env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography
@ihoneymon
ihoneymon / how-to-write-by-markdown.md
Last active April 26, 2024 11:59
마크다운(Markdown) 사용법

[공통] 마크다운 markdown 작성법

영어지만, 조금 더 상세하게 마크다운 사용법을 안내하고 있는
"Markdown Guide (https://www.markdownguide.org/)" 를 보시는 것을 추천합니다. ^^

아, 그리고 마크다운만으로 표현이 부족하다고 느끼신다면, HTML 태그를 활용하시는 것도 좋습니다.

1. 마크다운에 관하여

@kimus
kimus / ufw.md
Created March 2, 2014 22:46
NAT and FORWARD with Ubuntu’s ufw firewall

UFW

I use Ubuntu’s Uncomplicated firewall because it is available on Ubuntu and it's very simple.

Install UFW

if ufw is not installed by default be sure to install it first.