Skip to content

Instantly share code, notes, and snippets.

View bwesterb's full-sized avatar
⚛️

Bas Westerbaan bwesterb

⚛️
View GitHub Profile

Keybase proof

I hereby claim:

  • I am bwesterb on github.
  • I am bwesterb (https://keybase.io/bwesterb) on keybase.
  • I have a public key ASBVVTirqo8sdlMvu6UNw0G6ezPiVkTX5LjALk1J_20Dbgo

To claim this, I am signing this object:

@bwesterb
bwesterb / Gatecount for circuit in original gate set
Last active September 12, 2016 19:12
Gatecount of the circuit to break example instance of binary MQ (using the first oracle) compared to the gate count of the circuit automatically translated to Clifford+T. Note that this translation is not optimal: it can be done better by hand.
-----------------------------------------------------------
81: "H, arity 1"
81: "Init0"
1221250362838: Subroutine: grover-iteration, shape ([Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q],())
Total gates: 1221250363000
Inputs: 0
Outputs: 81
Qubits in circuit: 81
Subroutine: "grover-iteration"
import timeit
print timeit.timeit('PasswordHasher(time_cost=1).hash("")',
setup='from argon2 import PasswordHasher',
number=1000) * 2
print timeit.timeit('PasswordHasher(time_cost=2).hash("")',
setup='from argon2 import PasswordHasher',
number=1000)
Conditionally mitigated
136.243.176.81; 136.243.176.126;
Our investigation has determined that the above IP(s) qualify for
conditional mitigation. These IP(s) have been unblocked, but may be
subject to low daily email limits until they have established a good
reputation.
Please note that mitigating this issue does not guarantee that your
email will be delivered to a user’s inbox.
-- vif-route 2014-09-02 08:20:19.000000000 +0200
+++ our-vif-route 2016-01-26 08:57:14.557343864 +0100
@@ -23,11 +23,37 @@
dir=$(dirname "$0")
. "${dir}/vif-common.sh"
+ip6_of()
+{
+ ip -6 addr show "$1" | perl -wane '/scope global/ && /inet6 (([0-9a-f]+:*)+)/ && print $1;'
+}
keys:
laptop: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI...
desktop: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI...
oldDesktop: ssh-rsa AAAAC3NzaC1lZDI1NTE5AAAAI...
servers:
[email protected]:
present:
- laptop
- desktop
absent:
# autogenerated by Vagrantfile---
secrets:
chucknorris: 4fc80eba58ec111d80c428777b8607e2
mysql_forum: bfb170afc7d2751589f20bb98a8ff7c8
django_secret_key: 0a92901e77362f27240de17efae8e3fb
mysql_wiki: 3fe280c48f7820b3da7dffcdf4b09ffb
mysql_wolk: d8f4d98841e84ae9716a49548647015f
apikey: e363fb6984515c72522692d920870559
mailman_default: 0a9d5b9aed2f6cfa0ffb417b6da79f00
ldap_infra: 7d40946647e37313ac99f0169b8fed6c
--- /etc/xen/scripts/vif-route 2013-01-22 17:41:48.000000000 +0100
+++ /etc/xen/scripts/our-vif-route 2015-05-16 20:52:46.000000000 +0200
@@ -23,11 +23,37 @@
dir=$(dirname "$0")
. "${dir}/vif-common.sh"
+ip6_of()
+{
+ ip -6 addr show "$1" | perl -wane '/scope global/ && /inet6 (([0-9a-f]+:*)+)/ && print $1;'
+}
@bwesterb
bwesterb / bug.py
Created June 25, 2015 14:35
Popen bug in pypy?
import subprocess
while True:
p = subprocess.Popen(['cat'], stdin=subprocess.PIPE,
stdout=subprocess.PIPE)
p.stdin.close()
p.wait()
@bwesterb
bwesterb / gist:a699d64fe1d7d4f78bb9
Created October 31, 2014 07:10
recurse through directories
#!/bin/python
import os
import os.path
base_path = '.'
todo = [base_path]
while todo:
current_dir = todo.pop()