Skip to content

Instantly share code, notes, and snippets.

View zimdo's full-sized avatar

Timo Mika Gläßer zimdo

View GitHub Profile
@zimdo
zimdo / EmbedCode.html
Last active January 15, 2018 21:39
Hushed Dating Infographic EmbedCode
<p>
<strong>Please include attribution to https://hushed.com/ with this graphic.</strong>
</p>
<p><a href='https://hushed.com/dating/-online-dating'><img src='http://hushed.com/wp-content/uploads/2017/12/Online-Dating-V7.jpg' alt='Online Dating Safety Infographic' width='700px' border='0' /></a></p>
@zimdo
zimdo / docker-compose.yml
Created April 20, 2017 15:57
A docker-compose file for running "rancher-ecr-credentials".
rancher-ecr-credentials:
environment:
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
AWS_SECRET_ACCESS_KEY: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
labels:
io.rancher.container.pull_image: always
io.rancher.container.create_agent: 'true'
io.rancher.container.agent.role: environment
tty: true
@zimdo
zimdo / policy.json
Created December 23, 2016 18:42
Make AWS CodeBuild work AWS ECS
{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "CodeBuildAccess",
"Effect": "Allow",
"Principal": {
"AWS": [
"arn:aws:iam::964771811575:root",
"arn:aws:iam::570169269855:root",
@zimdo
zimdo / static_linking_in_go.md
Created December 23, 2016 03:45
Static linking in GO!

Static linking in GO 1.5:

go build -ldflags "-extldflags -static" ...

Static linking in GO >= 1.6:

go build -ldflags "-linkmode external -extldflags -static" ...
@zimdo
zimdo / go_get_for_private_repos.sh
Last active December 7, 2016 21:07
go get github.com/my/private_repository
export GITHUB_TOKEN="MY_TOKEN"
git config --global url."https://${GITHUB_TOKEN}:x-oauth-basic@github.com/".insteadOf "https://github.com/"
go get github.com/my/private_repository
### Keybase proof
I hereby claim:
* I am zimdo on github.
* I am zimdo (https://keybase.io/zimdo) on keybase.
* I have a public key whose fingerprint is 50F5 9250 75FE AC1E 7CA2 1EC2 635D BA0C BC46 F869
To claim this, I am signing this object:
@zimdo
zimdo / portforwarding.md
Created August 30, 2016 18:19 — forked from kujohn/portforwarding.md
Port forwarding in Mavericks

Port Forwarding in Mavericks


Since Mavericks stopped using the deprecated ipfw (as of Mountain Lion), we'll be using pf to allow port forwarding.

####1. anchor file Create an anchor file under /etc/pf.anchors/<anchor file> with your redirection rule like:

@zimdo
zimdo / gist:f9fa5ab03cde2fa21393ef9fe71f3296
Created August 16, 2016 16:36 — forked from dmitshur/gist:6927554
How to `go get` private repos using SSH key auth instead of password auth.
$ ssh -A vm
$ git config --global url."git@github.com:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "git@github.com:"]
	insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!
@zimdo
zimdo / gist:5260970
Created March 28, 2013 05:46
Uninstall NodeJS
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom \
| while read i; do
sudo rm /usr/local/${i}
done
sudo rm -rf /usr/local/lib/node \
/usr/local/lib/node_modules \
/var/db/receipts/org.nodejs.*
@zimdo
zimdo / AccountPicker.java
Created November 5, 2012 17:43
Android Account Picker
AccountManager mAccountManager = AccountManager.get(this);
Account[] accounts = mAccountManager.getAccounts(); //.getAccountsByType();
for(Account account : accounts) {
Log.d(TAG,account.name);
Log.d(TAG,account.type);
}
startActivityForResult(AccountPicker.newChooseAccountIntent(null, null, new String[]{"com.google"}, false, null, null, null, null), PICK_ACCOUNT_REQUEST);
....