Skip to content

Instantly share code, notes, and snippets.

Avatar

Andreas Wederbrand wederbrand

  • Bjärred, Sweden
View GitHub Profile
@wederbrand
wederbrand / index.php
Created Oct 2, 2018
insomnia cookie error
View index.php
<?php
setcookie ( "insomnia-cookie", "expires soon", time()+10)
?>
Hello
@wederbrand
wederbrand / doIt.sh
Created Jul 4, 2018
rabbit flow test
View doIt.sh
#!/bin/bash
# start rabbit
docker rm -f rabbit
date
docker run \
-d \
-p 15671:15671 \
-p 15672:15672 \
--hostname rabbit \
View DiceTest.java
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
mysql 5.7.22 XA Error
View testIt.sh
#!/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
View fixRoutesAfterEpicCiscoFuckUp.sh
#!/bin/sh
sudo route add -net 172.17.0.0 netmask 255.255.0.0 docker0
View keybase.md

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 Sep 1, 2017
Replicate mysql bug 83295
View README.md

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

View example of using docker with exercism
$ 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 Jan 11, 2013
git post checkout hook for gerrit
View post-checkout
#!/bin/bash
BRANCH=`git symbolic-ref -q HEAD`
if [ "$BRANCH" == "" ]; then
BRANCHNAME=master
else
BRANCHNAME=`basename $BRANCH`
fi
# remote should always be origin