Skip to content

Instantly share code, notes, and snippets.

@herry13
herry13 / configflow.yaml
Created October 3, 2019 20:46
declarative configuration
---
# resources
project-sandbox:
kind: gcloudproject
cluster-sa:
kind: serviceaccount
spec:
project: project-sandbox
cluster-1:
kind: gke
global
log 127.0.0.1 local0 notice
maxconn 50000
daemon
stats socket /tmp/proxystats level admin
defaults
log global
mode http
option httplog
option dontlognull
@herry13
herry13 / color.sh
Created July 6, 2018 00:08
Generate color-codes supported in bash
#!/bin/bash
color=16;
while [ $color -lt 245 ]; do
echo -e "$color: \\033[38;5;${color}mhello\\033[48;5;${color}mworld\\033[0m"
((color++));
done
@herry13
herry13 / downscale.sh
Created June 5, 2018 21:01 — forked from lanceli/downscale.sh
sips downscale image by percentage in Mac OS X
#!/bin/bash
if [ $1 ]
then
echo Processing file $1;
else
for var in `find *.png`;
do
echo Processing file $var;
sips -Z $(($(sips -g pixelWidth "$var" | cut -s -d ':' -f 2 | cut -c 2-) / 2)) "$var" --out "resized_$var" &> /dev/null
#!/bin/bash
# ----------------------------------------------------------------------
# mikes handy rotating-filesystem-snapshot utility
# ----------------------------------------------------------------------
# this needs to be a lot more general, but the basic idea is it makes
# rotating backup-snapshots of /home whenever called
# ----------------------------------------------------------------------
# Reference:
# - http://www.mikerubel.org/computers/rsync_snapshots/#Extensions
# ----------------------------------------------------------------------
@herry13
herry13 / keybase.md
Created March 11, 2018 20:36
keybase.md

Keybase proof

I hereby claim:

  • I am herry13 on github.
  • I am herry (https://keybase.io/herry) on keybase.
  • I have a public key ASAFd4FJc571PhQd3WqBDyH5nYUQEMv71G27jKtOhJSS1wo

To claim this, I am signing this object:

@herry13
herry13 / stuns
Created March 2, 2018 00:29 — forked from zziuni/stuns
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
@herry13
herry13 / parted-disk.py
Last active October 26, 2021 20:47
An example on how to use pyparted to create partitions on disk
#!/usr/bin/env python
#
# Requirements:
# - python
# - python-dev
# - pyparted
import parted
# Create a disk image then attach it to a loopback device (e.g. /dev/loop0)
@herry13
herry13 / gitconfig
Last active September 23, 2021 13:17
[user]
name = Your Name
email = youemail@foo.bar
[init]
defaultBranch = main
[pull]
rebase = false