Skip to content

Instantly share code, notes, and snippets.

View wederbrand's full-sized avatar

Andreas Wederbrand wederbrand

  • Bjärred, Sweden
View GitHub Profile
@wederbrand
wederbrand / index.php
Created October 2, 2018 22:30
insomnia cookie error
<?php
setcookie ( "insomnia-cookie", "expires soon", time()+10)
?>
Hello
@wederbrand
wederbrand / doIt.sh
Created July 4, 2018 21:26
rabbit flow test
#!/bin/bash
# start rabbit
docker rm -f rabbit
date
docker run \
-d \
-p 15671:15671 \
-p 15672:15672 \
--hostname rabbit \
@wederbrand
wederbrand / DiceTest.java
Created June 1, 2018 10:44
simple dice test
import java.util.Random;
public class DiceTest {
public static void main(String[] args) {
Random random = new Random();
int A = 0;
int B = 0;
@wederbrand
wederbrand / testIt.sh
Last active May 28, 2018 07:33
mysql 5.7.22 XA Error
#!/bin/bash -x
# clear out the old stuff
docker rm -f master
docker rm -f slave
cat > my.cnf <<CONFIG
[client]
user=root
password=root
#!/bin/sh
sudo route add -net 172.17.0.0 netmask 255.255.0.0 docker0

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@wederbrand
wederbrand / README.md
Last active September 1, 2017 19:46
Replicate mysql bug 83295

Background

See this for mysql, it shows the bug this gist demonstrates. https://bugs.mysql.com/bug.php?id=83295

Setup

Download my.cnf and test.sql to an empty directory

Run these in order to see the bug in action

docker run -d -v $(pwd):/etc/mysql/conf.d -e MYSQL_ALLOW_EMPTY_PASSWORD=yes --name mysql mysql:5.7.17

$ docker run -e KEY=<your API-key goes here> -it --rm wederbrand/exercism-go
The configuration has been written to /root/.exercism.json
Your exercism directory can be found at /root/exercism
New: 16 problems
go (Clock) /root/exercism/go/clock
go (Difference Of Squares) /root/exercism/go/difference-of-squares
go (Etl) /root/exercism/go/etl
go (Food Chain) /root/exercism/go/food-chain
go (Gigasecond) /root/exercism/go/gigasecond
@wederbrand
wederbrand / post-checkout
Created January 11, 2013 08:29
git post checkout hook for gerrit
#!/bin/bash
BRANCH=`git symbolic-ref -q HEAD`
if [ "$BRANCH" == "" ]; then
BRANCHNAME=master
else
BRANCHNAME=`basename $BRANCH`
fi
# remote should always be origin