Skip to content

Instantly share code, notes, and snippets.

View jmenglis's full-sized avatar

Josh English jmenglis

View GitHub Profile
@Enigmatrix
Enigmatrix / GDB Cheatsheet.md
Last active June 18, 2024 18:08
GDB Cheatsheet using pwndbg

GDB Cheatsheet

Setup

First of all, we need to install GDB: sudo apt install gdb

Next we will be installing an extension to GDB called pwndbg that will make our life easier. Instructions for installation are here.

You can verify that your installation works by running gdb /bin/true in your command line, then running start when the prompt shows.

@phortuin
phortuin / signing-git-commits.md
Last active June 24, 2024 10:06
Set up a GPG key for signing Git commits on MacOS (M1)

Based on this blogpost.

To sign Git commits, you need a gpg key. GPG stands for GNU Privacy Guard and is the de facto implementation of the OpenPGP message format. PGP stands for ‘Pretty Good Privacy’ and is a standard to sign and encrypt messages.

Setting up

Install with Homebrew:

$ brew install gpg
@mbostock
mbostock / .block
Last active May 19, 2020 12:51
Stacked Negative Values
license: gpl-3.0
redirect: https://observablehq.com/@d3/diverging-stacked-bar-chart
@vlucas
vlucas / encryption.js
Last active June 7, 2024 04:27
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);
@bitgord
bitgord / Create-Bitcoin-Address-NodeJS-BitcoinJS
Last active March 17, 2020 20:01
Create a bitcoin address with Nodejs and Bitcoinjs
// You must have node and npm downloaded on your computer
// Download bitcoinjs library
npm install bitcoinjs-lib
// Require bitcoinjs-lib
var bitcoin = require("bitcoinjs-lib");
// Make variable for keyPair
var keyPair = bitcoin.ECPair.makeRandom();
@vasanthk
vasanthk / System Design.md
Last active June 23, 2024 04:30
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@joepie91
joepie91 / vpn.md
Last active June 21, 2024 14:42
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@kangax
kangax / quicksort.hs
Last active September 5, 2021 19:44
Haskell-inspired quick sort in ES6
quicksort :: (Ord a) => [a] -> [a]
quicksort [] = []
quicksort (x:xs) =
let smallerSorted = quicksort (filter (<=x) xs)
biggerSorted = quicksort (filter (>x) xs)
in smallerSorted ++ [x] ++ biggerSorted

Comparison of ASP.NET and Node.js for Backend Programming

We will compare ASP.NET and Node.js for backend programming.
Source codes from examples.

Updates

This document was published on 21.09.2015 for a freelance employer. Some changes since then (14.02.2016):

  1. Koa.js no longer uses co-routines, it has switched to Babel's async/await. yield and await are used almost in the same way, so I see no point to rewrite the examples.
@olivierlacan
olivierlacan / migrate_postgresql_database.md
Last active March 24, 2022 20:30
How to migrate a Homebrew-installed PostgreSQL database to a new major version (9.3 to 9.4) on OS X. See upgraded version of this guide: http://olivierlacan.com/posts/migrating-homebrew-postgres-to-a-new-version/

This guide assumes that you recently run brew upgrade postgresql and discovered to your dismay that you accidentally bumped from one major version to another: say 9.3.x to 9.4.x. Yes, that is a major version bump in PG land.

First let's check something.

brew info postgresql

The top of what gets printed as a result is the most important: