Skip to content

Instantly share code, notes, and snippets.

View ReeganExE's full-sized avatar
🇻🇳
upnp-device-client

Ninh Pham ReeganExE

🇻🇳
upnp-device-client
  • HCMC, Vietnam
View GitHub Profile
@ReeganExE
ReeganExE / AesUtil.ts
Created July 10, 2022 12:02 — forked from btxtiger/AesUtil.ts
Node.js - AES Encryption/Decryption with AES-256-GCM using random Initialization Vector + Salt
/**
* Cryptography Functions
*
* Forked from AndiDittrich/AesUtil.js
* https://gist.github.com/AndiDittrich/4629e7db04819244e843
*/
import crypto, { CipherGCM, CipherGCMTypes, DecipherGCM } from 'crypto';
import { Password } from './types';
@ReeganExE
ReeganExE / simple-youtube-dl.js
Created May 29, 2020 03:18
Simple youtube mp3
require('express-async-errors')
const http = require('http')
const bodyParser = require('body-parser')
const errorhandler = require('errorhandler')
const app = require('express')()
app.use(bodyParser.urlencoded({ extended: false })).use(bodyParser.json())
app.set('trust proxy', true)
@ReeganExE
ReeganExE / post-json.go
Created February 15, 2020 08:00
Sample POST json in Go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"os"
@ReeganExE
ReeganExE / encryption.js
Created January 23, 2020 13:55 — 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 bits (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', Buffer.from(ENCRYPTION_KEY), iv);
@ReeganExE
ReeganExE / fb-video.js
Created January 3, 2020 16:44
Facebook video downloader
var body = new FormData();
body.append('URLz', prompt('link:'));
await fetch('https://fbdown.net/download.php', {
method: 'post',
body: body
}).then(a => a.text()).then(a => new DOMParser().parseFromString(a, 'text/html').getElementById('hdlink').href);
{
"timeStamp": 1562476409396,
"version": "1.20.0",
"userSettings": {
"advancedUserEnabled": true,
"alwaysDetachLogger": false,
"autoUpdate": true,
"cloudStorageEnabled": false,
"collapseBlocked": true,
"colorBlindFriendly": false,
@ReeganExE
ReeganExE / .eslintrc.json
Created May 13, 2019 14:50
Simple ESLint for react-app
{
"extends": "react-app",
"rules": {
"arrow-parens": "off",
"comma-dangle": ["error", "never"],
"implicit-arrow-linebreak": "off",
"import/no-cycle": 0,
"import/order": ["error", {"newlines-between": "always"}],
"import/prefer-default-export": 0,
"indent": "off",
@ReeganExE
ReeganExE / java-cert-import.sh
Created February 17, 2019 04:08
Import Certificate from websites to a Java keystore
#!/usr/bin/env sh
# Change this
KEYSTORE_FILE=dest_keystore
KEYSTORE_PASS=changeit
import_cert() {
local HOST=$1
local PORT=$2
@ReeganExE
ReeganExE / dump-links.js
Created February 15, 2019 12:21
Dump Links that start with
@ReeganExE
ReeganExE / edm-links.txt
Created January 12, 2019 16:04
edm-12-Jan-2019