Skip to content

Instantly share code, notes, and snippets.

View tongpu's full-sized avatar
🏁
I'm at the FIA WEC 6 Hours of Spa-Francorchamps

Lukas Grossar tongpu

🏁
I'm at the FIA WEC 6 Hours of Spa-Francorchamps
View GitHub Profile
BEGIN MESSAGE.
t3mgI6JrauGZiGl A8FLki7GtYubR6h yI1J3t2ZcjWKSAc bOO5fXFJTN7vgir
mZbvqTXhK7zv2Mj j6sHV4Uk8mHTCKq 6Xr2MZHgg75YW0N IGw1wLk8vefU2FL
8a64V7lfCPU9q7K R97D6HVgkYEZfJ8 3N0dxfSwadtINN8 zXrg9PbNo51JZKE
22AhBA69qRTUKSq nHVEKyst6WRvqaV 1NJxK21.
END MESSAGE.
@tongpu
tongpu / github-raw-function.zsh
Created October 16, 2019 07:57
A simple shell function to replace /blob/ with /raw/ in a GitHub URL to download the raw file
function github-raw() {
# replace /blob/ in the GitHub URL with /raw/
curl --silent --location --remote-name ${1:s#/blob/#/raw/#}
}
@tongpu
tongpu / PKGBUILD
Last active June 12, 2018 09:09
Updated PKGBUILD for stern-bin to include bash and zsh completion
# Maintainer: Simon Weald <simon[at]simonweald[dot]com>
pkgname=stern-bin
pkgdesc="Multi pod and container log tailing for Kubernetes"
pkgver=1.6.0
pkgrel=2
arch=('x86_64')
url="https://github.com/wercker/stern"
license=('apache')
_stern_file=stern_linux_amd64
@tongpu
tongpu / aws-open-role-console.py
Created May 25, 2018 12:43
Open the AWS console with an AWS role secured by `ExternalID`
#!/usr/bin/env python
import click
import configparser
import json
import os
import requests
import webbrowser
from boto.sts import STSConnection
@tongpu
tongpu / aws-env.sh
Created March 5, 2018 16:14
Shell script to export AWS_* environment variables based on the specified profile
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
if [ ${#} = 0 ]; then
profile=default
else
profile=${1}
@tongpu
tongpu / PKGBUILD_sysbench_pgsql.patch
Created October 19, 2017 13:35
Patch for sysbench PKGBUILD to add support for PostgreSQL
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,12 +5,12 @@
pkgname=sysbench
pkgver=1.0.9
-pkgrel=2
+pkgrel=3
pkgdesc="Benchmark tool for evaluating OS parameters that are important for a system running a database under intensive load."
url="https://github.com/akopytov/sysbench"
@tongpu
tongpu / kubectl-bin_PKGBUILD_completion.patch
Last active June 17, 2017 12:34
kubectl-bin bash-completion
--- PKGBUILD 2017-06-17 14:26:50.520424308 +0200
+++ PKGBUILD.completion 2017-06-17 14:29:26.654709540 +0200
@@ -17,4 +17,8 @@
package() {
install -Dm 755 "$srcdir/$_kubectl_file" "$pkgdir/usr/bin/kubectl"
+ install -d 755 "$pkgdir/usr/share/bash-completion/completions"
+ "$pkgdir/usr/bin/kubectl" completion bash > "$pkgdir/usr/share/bash-completion/completions/kubectl"
+ install -d 755 "$pkgdir/usr/share/zsh/site-functions"
+ "$pkgdir/usr/bin/kubectl" completion zsh > "$pkgdir/usr/share/zsh/site-functions/_kubectl"
@tongpu
tongpu / phantomjs-revealjs-slide-capture.js
Last active November 17, 2016 15:56 — forked from soxofaan/phantomjs-revealjs-slide-capture.js
PhantomJS script to capture/render screenshots of the slides of a Reveal.js powered slideshow.
/**
* PhantomJS script to capture/render screenshots of the slides of a Reveal.js powered slideshow.
*/
var page = require('webpage').create();
var args = require('system').args;
// Get url to render from command line.
var url;
if (args.length < 2) {
@tongpu
tongpu / uci-guest-wifi.sh
Last active July 14, 2023 12:20
uci script for OpenWRT guest WiFi configuration
#!/bin/sh
uci batch << EOF
add network switch_vlan
set network.@switch_vlan[-1].device='switch0'
set network.@switch_vlan[-1].ports='1t 5t'
set network.@switch_vlan[-1].vlan='2'
set network.guest='interface'
set network.guest.type='bridge'

Keybase proof

I hereby claim:

  • I am tongpu on github.
  • I am tongpu (https://keybase.io/tongpu) on keybase.
  • I have a public key whose fingerprint is 1E96 34C1 837F F412 EB1A D7AB D807 26D9 F4F0 14C4

To claim this, I am signing this object: