Skip to content

Instantly share code, notes, and snippets.

@h-otter
h-otter / gist:5a3f048f99ff22c928ffad8d07ce8c0c
Created September 15, 2017 07:17
iperf3 on kubernetes
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
labels:
test-iperf3: server
name: iperf3-server
spec:
replicas: 1
revisionHistoryLimit: 10
// vscode v1.10.2
// like bash, less
// @h-otter
[
// cursor like emacs
{ "key": "right", "command": "cursorRight",
"when": "editorTextFocus" },
{ "key": "ctrl+f", "command": "cursorRight",
"when": "editorTextFocus" },
{ "key": "alt+f", "command": "cursorWordRight",
#!/bin/bash -eu
usage_exit() {
echo "Usage: $0 [-d user] [-u user]" 1>&2
echo " -d: disable deny access from user" 1>&2
echo " -u: kick $1 and deny access from user" 1>&2
exit 1
}
kick_user(){
[Unit]
Description=Keep reverse portforward tunnel
After=network.target
[Service]
User=root
Restart=always
RestartSec=5
Type=simple
ExecStart=/usr/bin/ssh -NTv \
@h-otter
h-otter / bogo.cpp
Last active December 20, 2016 07:03
#include <algorithm>
#include <iostream>
#include <iterator>
#include <random>
#include <stdio.h>
#define N 100
template <typename RandomAccessIterator, typename Predicate>
int bogo_sort(RandomAccessIterator begin, RandomAccessIterator end, Predicate p) {
@h-otter
h-otter / bogo.cpp
Last active January 10, 2017 06:15
#include <algorithm>
#include <iostream>
#include <iterator>
#include <random>
#define N 100
template <typename RandomAccessIterator, typename Predicate>
int bogo_sort(RandomAccessIterator begin, RandomAccessIterator end, Predicate p) {
std::random_device rd;
@h-otter
h-otter / rc.lua
Created September 14, 2016 03:51
awesome
-- Standard awesome library
local gears = require("gears")
local awful = require("awful")
awful.rules = require("awful.rules")
require("awful.autofocus")
-- Widget and layout library
local wibox = require("wibox")
-- Theme handling library
local beautiful = require("beautiful")
-- Notification library
export GOPATH="$HOME/.go"
export PATH=$PATH:$HOME/.go/bin
# Set up the prompt
autoload -Uz promptinit
promptinit
PROMPT='
%K{blue}%n@%m%k %B%F{cyan}%~%f%b
%# '
#RPROMPT='[%(?.%?.%B%F{red}%?%f%b), %D %*] # process result
setopt histignorealldups sharehistory
# -- default shell --
set-option -g default-shell /bin/zsh
set-option -g default-command /bin/zsh
# -- prefix --
set -g prefix C-s
unbind C-b
# -- line max --
set -g history-limit 50000