Skip to content

Instantly share code, notes, and snippets.

View wilbeibi's full-sized avatar
🍼
0 */3 * * * changeDiaper

Hongyi Shen wilbeibi

🍼
0 */3 * * * changeDiaper
View GitHub Profile

brew install bash sudo bash -c "echo $(brew --prefix)/bin/bash >> /private/etc/shells"

@wilbeibi
wilbeibi / ncp
Created July 31, 2018 17:51 — forked from godber/ncp
ncp - Netcat and Pigz based network file copy (faster than scp, but unencrypted)
#! /usr/bin/bash
# ncp - Netcat and Pigz based network file copy (faster than scp, but unencrypted)
# From this blog post
# http://intermediatesql.com/linux/scrap-the-scp-how-to-copy-data-fast-using-pigz-and-nc/
FILE_FULL=$1
REMOTE_HOST=$2
FILE_DIR=$(dirname $FILE_FULL)
# Reference:
https://www.cloudgear.net/blog/2015/5-minutes-kubernetes-setup/
# install homebrew and cask
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install virtualbox
brew cask install virtualbox
# install dockertoolbox
@wilbeibi
wilbeibi / README.md
Created February 12, 2018 20:30 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
@wilbeibi
wilbeibi / docker-cleanup-resources.md
Created February 9, 2018 18:50 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@wilbeibi
wilbeibi / docker-cleanup-resources.md
Created February 9, 2018 18:50 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@wilbeibi
wilbeibi / rsync_on_change.sh
Created January 31, 2018 21:56 — forked from JohannesBuchner/rsync_on_change.sh
rsync loop that updates remote directory when local directory changes (using inotify)
while true
do
rsync -avz ./ user@host:remote/directory/
inotifywait -r ./
done
@wilbeibi
wilbeibi / postgres cheatsheet.md
Created November 11, 2017 01:29 — forked from apolloclark/postgres cheatsheet.md
postgres cheatsheet

Postgres Cheatsheet

This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.

Setup

installation, Ubuntu

http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL

@wilbeibi
wilbeibi / reeder_starred_to_csv
Last active April 3, 2021 18:10
Export Reeder starred iterms to csv
#!/usr/bin/env python3
import getpass
import sqlite3
import csv
RKIT_PATH = "/Users/" + getpass.getuser() + "/Library/Containers/com.reederapp.rkit2.mac/Data/Library/Application Support/Reeder/rkit/"
conn = sqlite3.connect(RKIT_PATH + "rkit.db")
DATA_DB_PATH = RKIT_PATH + "rkit-data.db"
@wilbeibi
wilbeibi / c_cpp_properties.json
Last active October 2, 2017 21:55
VSCode Mac C/C++ include config for Mac
{
"configurations": [
{
"name": "Mac",
"includePath": [
"/usr/local/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include",
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include",