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 / auto-capture.scpt
Created March 22, 2022 20:53 — forked from jonobr1/auto-capture.scpt
A small AppleScript to take a screenshot every 30 seconds for 8 hours. Saves to an Image Sequence in a desktop folder. Great for recording your workday.
set dFolder to "~/Desktop/screencapture/"
do shell script ("mkdir -p " & dFolder)
set i to 0
repeat 960 times
do shell script ("screencapture " & dFolder & "frame-" & i & ".png")
delay 30 -- Wait for 30 seconds.
set i to i + 1
end repeat
use std::future::Future;
use std::pin::Pin;
use std::task::{Context, Poll};
use std::time::{Duration, Instant};
struct Inspect<F>(F);
impl<F: Future> Future for Inspect<F> {
type Output = F::Output;
@wilbeibi
wilbeibi / show-douban-id-and-gender.js
Created December 9, 2019 08:33 — forked from naoyeye/show-douban-id-and-gender.js
显示豆瓣用户id和性别
// ==UserScript==
// @name 显示豆瓣用户id和性别
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author J.Y Han
// @match https://www.douban.com/people/*
// @grant showDoubanIdAndGender
// ==/UserScript==
@wilbeibi
wilbeibi / ansible.cfg
Created January 23, 2019 06:07 — forked from nazarewk/ansible.cfg
Ansible SSH Agent forwarding with Jump (bastion) host
[defaults]
sudo_flags = SSH_AUTH_SOCK="$SSH_AUTH_SOCK" -H -S -n
[ssh_connection]
ssh_args=-o ForwardAgent=yes
@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