Skip to content

Instantly share code, notes, and snippets.

View andywenk's full-sized avatar

Andreas Wenk andywenk

View GitHub Profile
@andywenk
andywenk / dir-checksum
Last active May 3, 2021 13:54
dir-checksum - minimal Python script to create a checksum of all files in a directory
#! /usr/bin/env python
## Create the checksum of all the files in a directory
## find the original script here: https://unix.stackexchange.com/questions/35832/how-do-i-get-the-md5-sum-of-a-directorys-contents-as-one-sum
import hashlib, hmac, os, stat, sys
## Return the hash of the contents of the specified file, as a hex string
def file_hash(name):
f = open(name)
h = hashlib.sha256()

Keybase proof

I hereby claim:

  • I am andywenk on github.
  • I am andywenk (https://keybase.io/andywenk) on keybase.
  • I have a public key ASC96qK-4d_-mDPql-MvN0tCpyPf7aiF1Rkv5vaKtQ8wPAo

To claim this, I am signing this object:

~/p/c/r/1/apache-couchdb-1.7.2 ❯❯❯ ./configure && make check >> make.log
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... build-aux/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
Verifying my Blockstack ID is secured with the address 1J3kjdbtAkQjQU5RcTYwC4gCPzKd4keayE https://explorer.blockstack.org/address/1J3kjdbtAkQjQU5RcTYwC4gCPzKd4keayE
@andywenk
andywenk / blockchain.js
Created September 28, 2017 07:47
Blockchain in JS
// Example for a minimal Blockchain. Written by Savjee
// https://www.youtube.com/watch?v=zVqczFZr124
// before running, install crypto-js via npm
const SHA256 = require('crypto-js/sha256');
class Block {
constructor(index, timestamp, data, previousHash = '') {
this.index = index;
@andywenk
andywenk / gist:06c3419c031ff029fe930e9b4ca57a84
Created November 30, 2016 20:43
trying to update phoenix_ecto
Generated ecto app
==> phoenix_ecto
Compiling 4 files (.ex)
== Compilation error on file lib/phoenix_ecto/html.ex ==
** (KeyError) key :model not found in: %Phoenix.HTML.Form{data: nil, errors: {:form_for_errors, [line: 12], [{{:., [line: 12], [{:changeset, [line: 12], nil}, :errors]}, [line: 12], []}]}, hidden: [], id: {:name, [line: 10], nil}, impl: Phoenix.HTML.FormData.Ecto.Changeset, index: nil, name: {:name, [line: 11], nil}, options: [], params: %{}, source: {:changeset, [line: 8], nil}}
(stdlib) :maps.update(:model, {:model, [line: 13], nil}, %Phoenix.HTML.Form{data: nil, errors: {:form_for_errors, [line: 12], [{{:., [line: 12], [{:changeset, [line: 12], nil}, :errors]}, [line: 12], []}]}, hidden: [], id: {:name, [line: 10], nil}, impl: Phoenix.HTML.FormData.Ecto.Changeset, index: nil, name: {:name, [line: 11], nil}, options: [], params: %{}, source: {:changeset, [line: 8], nil}})
lib/phoenix_html/form.ex:170: anonymous fn/2 in Phoenix.HTML.Form.__struct__/1
(elixir) lib/enum.ex:1623: Enu
@andywenk
andywenk / oneill.md
Last active April 2, 2017 07:09
Paul O'Neill The Irreducible Components of Leadership

Paul O'Neill The Irreducible Components of Leadership

  • A true leader has to articulate non arguable goals

  • Finance should not be an objective but a consequence of excellence

  • In an organisation that has the 'potential' for greatness, the people in the organisation can say every day without reservation or hesitation yes to these three questions:

    • I am treated every day with dignity and respect by everyone I encounter, without respect to my gender or my nationality or my race or my educational atainment or my rank or any other discrimination disqualifier.
  • I am given the things I need - training, education, tools, encouragement - so that I can make a contribution that gives meaning to my life.

[notice] 2016-09-12T16:05:36.349295Z couchdb@127.0.0.1 <0.323.0> -------- chttpd_auth_cache changes listener died database_does_not_exist at mem3_shards:load_shards_from_db/6(line:327) <= mem3_shards:load_shards_from_disk/1(line:315) <= mem3_shards:load_shards_from_disk/2(line:331) <= mem3_shards:for_docid/3(line:87) <= fabric_doc_open:go/3(line:38) <= chttpd_auth_cache:ensure_auth_ddoc_exists/2(line:187) <= chttpd_auth_cache:listen_for_changes/1(line:134)
[error] 2016-09-12T16:05:36.349373Z couchdb@127.0.0.1 emulator -------- Error in process <0.450.0> on node 'couchdb@127.0.0.1' with exit value:
{database_does_not_exist,[{mem3_shards,load_shards_from_db,"_users",[{file,"src/mem3_shards.erl"},{line,327}]},{mem3_shards,load_shards_from_disk,1,[{file,"src/mem3_shards.erl"},{line,315}]},{mem3_shards,load_shards_from_disk,2,[{file,"src/mem3_shards.erl"},{line,331}]},{mem3_shards,for_docid,3,[{file,"src/mem3_shards.erl"},{line,87}]},{fabric_doc_open,go,3,[{file,"src/fabric_doc_open.erl"},{line,38}]},{chttpd_auth_
@andywenk
andywenk / gist:2aa6e974e637ad93bde9
Created June 15, 2015 09:20
lograge error stacktrace
{"message":"Could not log \"process_action.action_controller\" event. ArgumentError: wrong number of arguments (0 for 1..2) [\"/var/www/production/shared/bundle/ruby/2.2.0/gems/actionpack-4.2.1/lib/action_controller/metal/exceptions.rb:22:in `initialize'\", \"/var/www/production/shared/bundle/ruby/2.2.0/gems/lograge-0.3.2/lib/lograge/log_subscriber.rb:72:in `new'\", \"/var/www/production/shared/bundle/ruby/2.2.0/gems/lograge-0.3.2/lib/lograge/log_subscriber.rb:72:in `get_error_status_code'\", \"/var/www/production/shared/bundle/ruby/2.2.0/gems/lograge-0.3.2/lib/lograge/log_subscriber.rb:64:in `extract_status'\", \"/var/www/production/shared/bundle/ruby/2.2.0/gems/lograge-0.3.2/lib/lograge/log_subscriber.rb:13:in `process_action'\", \"/var/www/production/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/subscriber.rb:100:in `finish'\", \"/var/www/production/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/log_subscriber.rb:83:in `finish'\", \"/var/www/production/shared/bu
==> rel (compile)
==> couchdb-2.0 (compile)
Building Fauxton
npm WARN package.json url@0.7.9 url is also the name of a node core module.
npm WARN package.json url@0.7.9 No README data
npm WARN package.json couchapp@0.11.0 No repository field.
npm WARN package.json urls@0.0.4 No repository field.
/bin/sh: 1: grunt: not found
make: *** [share/www] Error 127