Skip to content

Instantly share code, notes, and snippets.

@jeckep
jeckep / save_logo_brandcrowd.js
Created February 19, 2020 16:06
Save log as png from brandcrowd.com
var c = document.getElementById("js-maker-canvas");
var c2 = document.createElement('canvas');
document.body.appendChild(c2);
c.toBlob = c2.toBlob;
var saveData = (function () {
var a = document.createElement("a");
document.body.appendChild(a);
a.style = "display: none";
return function (blob, fileName) {
@jeckep
jeckep / check_pass.py
Created February 5, 2020 13:37
check, is your password compromised?! | python3 check_pass.py
import hashlib
import requests
import getpass
def test_pw(byte_string):
hasher = hashlib.sha1()
hasher.update(byte_string)
digest = hasher.hexdigest().upper()
print(f'Hash: {digest[:5]}, {digest[5:]}')
print(f'GET https://api.pwnedpasswords.com/range/{digest[:5]}')
  • This creates a 560mb ramdisk. Adjust the size accordingly. I think the number at the end of the command is the number of disk blocks. They are 2kb in size for me.
  • Restarting postgres is not necessary; you can create the ramdisk and tablespace while postgres is running.
  • You will lose all data in the ramdisk tablespace when you shut your machine down

  $ diskutil erasevolume HFS+ "postgres_ramdisk" `hdiutil attach -nomount ram://1165430`
  Started erase on disk1
  Unmounting disk
  Erasing
 Initialized /dev/rdisk1 as a 569 MB HFS Plus volume
@jeckep
jeckep / nginx.conf
Created February 26, 2014 07:43 — forked from plentz/nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048