Skip to content

Instantly share code, notes, and snippets.

👟
Running

Ahmet Alp Balkan ahmetb

View GitHub Profile
@ahmetb
ahmetb / _README.md
Created May 27, 2018
BSD grep segmentation fault
View _README.md

I'm getting garbage characters on my screen and eventually segmentation fault from BSD grep "2.5.1-FreeBSD".

Repro

Download attached files and run:

/usr/bin/grep -E --color -f dirs_pattern.txt rp_dirs_used_in_deps.txt
@ahmetb
ahmetb / gcpauth.go
Created May 22, 2018
Authenticating to GKE cluster with client-go, IAM service account and a Google auth plugin written from scratch
View gcpauth.go
package main
import (
"context"
"fmt"
"log"
"net/http"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
@ahmetb
ahmetb / tmux.md
Created Dec 18, 2017 — forked from andreyvit/tmux.md
tmux cheatsheet
View tmux.md

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

# remap prefix to Control + a
@ahmetb
ahmetb / gcrgc.sh
Last active Apr 12, 2019
Script to clean up Google Container Registry images pushed before a particular date
View gcrgc.sh
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
View keybase.md

Keybase proof

I hereby claim:

  • I am ahmetb on github.
  • I am alp (https://keybase.io/alp) on keybase.
  • I have a public key ASB3Us2SJzEmVMqSFuc4nHcOh1xbv3QZfwp0Izayulo8vgo

To claim this, I am signing this object:

View keybase.md

Keybase proof

I hereby claim:

  • I am ahmetalpbalkan on github.
  • I am alp (https://keybase.io/alp) on keybase.
  • I have a public key whose fingerprint is BF91 C773 DD1E 2E87 AFE9 616F F84A 66B2 CBC2 9F60

To claim this, I am signing this object:

View -
#cloud-config
disable_root: false
manage_etc_hosts: true
# The modules that run in the 'init' stage
cloud_init_modules:
- migrator
- ubuntu-init-switch
- seed_random
- bootcmd
View docker-extension.log
gkahuna@lmp-swarm-i-master:~$ cat docker-extension.log
[DockerExtension] 2015/07/09 15:02:14 ----------------------------------------
[DockerExtension] 2015/07/09 15:02:14 Extension handler launch args: "./bin/docker-extension install"
[DockerExtension] 2015/07/09 15:02:14 Status 'transitioning' not reported for operation 'Install Docker' (by design)
[DockerExtension] 2015/07/09 15:02:14 distro info: Ubuntu 14.04
[DockerExtension] 2015/07/09 15:02:14 using distro driver: driver.UbuntuUpstartDriver
[DockerExtension] 2015/07/09 15:02:14 user: root uid:0 gid:0
[DockerExtension] 2015/07/09 15:02:14 env['PATH'] = /usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
[DockerExtension] 2015/07/09 15:02:14 + starting: 'install'
[DockerExtension] 2015/07/09 15:02:14 ++ install docker
View mac tools.md
View speedtest-registry-directly.sh
#!/bin/bash
set -e
image='tianon/speedtest'
layer='b31651d7665036bcf58a0b6b0d7aca173daff87b003ec50621cb0fde8d68864f'
# docker inspect b31651d7665036bcf58a0b6b0d7aca173daff87b003ec50621cb0fde8d68864f | grep '"Size"'
# "Size": 580580561,
# ("Content-Length: 228991341" though...)
token="$(curl -sSL -o /dev/null -D- -H 'X-Docker-Token: true' "https://index.docker.io/v1/repositories/$image/images" | awk -F ':[[:space:]]*|\r' '$1 == "X-Docker-Token" { print $2 }')"
You can’t perform that action at this time.