Skip to content

Instantly share code, notes, and snippets.

View ccoenen's full-sized avatar

Claudius Coenen ccoenen

View GitHub Profile
@ccoenen
ccoenen / node-scrypt-to-scrypt-async.js
Last active September 16, 2018 17:39
I am trying to read "old" node-scrypt hashes with scrypt-async. So far with little success. This script needs `scrypt` and `scrypt-async` installed via `npm`
/* ATTEMPT TO PARSE A node-scrypt STRING CORRECTLY FOR USE WITH scrypt-async */
var scrypt = require('scrypt-async');
var scryptOld = require('scrypt');
var crypto = require('crypto');
// Format as seen in node-scrypt, written by Barry Steyn. Scrypt by Colin Percival.
// https://github.com/barrysteyn/node-scrypt/blob/master/scrypt/scrypt-1.2.0/keyderivation.c#L60-L77 and
// https://security.stackexchange.com/a/91050/50616
// scrypt paper: https://www.tarsnap.com/scrypt/scrypt.pdf (not helpful for this :-( )
@ccoenen
ccoenen / anchor-test.md
Last active April 2, 2018 09:18
Test of Hackmd Issue #795

Summary Heading

test

@ccoenen
ccoenen / Deutsche Webhosting Anbieter.md
Last active November 5, 2020 15:47
Nach dem Verkauf von HostEurope an GoDaddy bin ich auf der Suche nach einem deutschen Webhoster für ein kleines privates Paket.
#!/usr/bin/env ruby
# moves files containing 002 on line 9 to a different directory.
require 'fileutils'
FileUtils.mkdir_p('with002')
FileUtils.mkdir_p('no002')
def contains_zero_zero_two?(filename)
@ccoenen
ccoenen / monitoring.sh
Created March 3, 2015 13:01
Simple Monitoring with statsd, shell and netcat
PREFIX=any.prefix.will.do
STATSD_HOSTNAME=your.server.name
STATSD_PORT=8125
while true; do
echo "$PREFIX.systemload1:`cut -f1 -d " " /proc/loadavg`|g" | ./nc -u -q 0 $STATSD_HOSTNAME $STATSD_PORT
cat /proc/stat | grep "cpu " | \
while read -r cpu user nice system idle iowait irq softirq steal guest guestnice
do
@ccoenen
ccoenen / 0-readme.md
Last active August 29, 2015 14:15
Monty Hall Problem Simulator

The Monty Hall Problem is a probability puzzle.

When i read [this article about Marilyn vos Savant][1], my initial reaction was "that can't be right". I continued to read the comments, the [wikipedia page][2] and then started a table to see if this was indeed the case. Being a programmer, i then started a simulation.

This is what it turned out to be.

The concise explanation is: The door's chance does not change. This

@ccoenen
ccoenen / keybase.md
Created January 23, 2015 20:15
Keybase

Keybase proof

I hereby claim:

  • I am ccoenen on github.
  • I am amenthes (https://keybase.io/amenthes) on keybase.
  • I have a public key whose fingerprint is AC0E EF09 8692 337D C2DF 08AC 1643 AC59 BD9B 1572

To claim this, I am signing this object:

@ccoenen
ccoenen / upnp2mrtg.sh
Last active August 29, 2015 14:06
upnp2mrtg fork
#!/bin/bash
#
# MINOR CHANGES IN THIS VERSION, NOT ACTUALLY THE ORIGINAL RELEASE!
#
# upnp2mrtg - Monitoring AVM Fritz!Box With MRTG
# This versions have been reported as working: 3030, 5050, 7050, 7141 and 7170
#
# Copyright (C) 2005 Michael Tomschitz <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
@ccoenen
ccoenen / .gitconfig
Created May 14, 2014 15:04
Git Configuration (Windows)
[user]
name = My Awesome name
[core]
excludesfile = c:/Users/....../.gitignore_global
editor = 'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -nosession -noPlugin
autocrlf = false
[push]
default = simple
@ccoenen
ccoenen / serve.py
Last active December 16, 2022 04:11 — forked from dustingetz/serve.py
#!/usr/bin/env python
import http.server
class MyHTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
def end_headers(self):
self.send_my_headers()
http.server.SimpleHTTPRequestHandler.end_headers(self)
def send_my_headers(self):
self.send_header("Cache-Control", "no-cache, no-store, must-revalidate")