Skip to content

Instantly share code, notes, and snippets.

Ahmet Alp Balkan ahmetb

Block or report user

Report or block ahmetb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ahmetb
ahmetb / list-archive-files.sh
Created Nov 7, 2019
list all files in archives hosted in a krew-index (run from repo root)
View list-archive-files.sh
#!/bin/bash
set -euo pipefail
files=$( grep -hRE '\.(tar\.gz|zip)' plugins/* | \
sed -E 's/^\s+(-\ )?uri:\s//g' | \
sed -E 's/"//g' | \
sort | \
uniq )
for f in $files; do
@ahmetb
ahmetb / pelican-frontmatter-to-hugo.sh
Created Oct 21, 2019
convert pelican frontmatter (YAML) to hugo (YAML) by adding --- separators
View pelican-frontmatter-to-hugo.sh
# prepend --- to every doc
sed -i '1i---' *.md
# append --- to first empty line (\n\n)
# (use GNU sed)
sed -i '0,/^$/s//---\n/' *.md
@ahmetb
ahmetb / probe.go
Created Aug 28, 2019
api/probe.go
View probe.go
// Package handler (directory named 'api/') is recognized
// by ZEIT Now v2 Lambda platform.
package handler
import (
"net/http"
)
func init() { log.SetFlags(log.Lmicroseconds) }
@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 Dec 8, 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
You can’t perform that action at this time.