Skip to content

Instantly share code, notes, and snippets.

View wilbeibi's full-sized avatar
:octocat:

Hongyi Shen wilbeibi

:octocat:
View GitHub Profile
@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",
@wilbeibi
wilbeibi / Makefile
Last active July 14, 2017 00:13
Chinese encryption SM4 cbc demo
CFLAGS=-g -std=gnu99 -Wall -pedantic-errors
all: encrypt decrypt
encrypt: encrypt.o
gcc -o encrypt encrypt.o ./GmSSL/libcrypto.a -lpthread -ldl
encrypt.o: encrypt.c
gcc -c -o encrypt.o encrypt.c -I/usr/local/include
decrypt: decrypt.o
gcc -o decrypt decrypt.o ./GmSSL/libcrypto.a -lpthread -ldl
decrypt.o: decrypt.c
gcc -c -o decrypt.o decrypt.c -I/usr/local/include
@wilbeibi
wilbeibi / uuid_test.c
Created June 2, 2017 23:31 — forked from yoggy/uuid_test.c
libuuid sample program
//
// libuuid sample program
//
// library install for debian
// $ sudo apt-get install uuid-dev
//
// compile
// $ gcc uuid_test.c -luuid -o uuid_test
//
#include <stdio.h>
@wilbeibi
wilbeibi / brew_leaves.txt
Created October 4, 2016 17:38
my brew leaves
ant
apache-spark
aria2
asciidoc
aspell
boot2docker
cheat
clang-format
cloc
elasticsearch