Skip to content

Instantly share code, notes, and snippets.

View hackerzgz's full-sized avatar

hackerzgz hackerzgz

View GitHub Profile
@hackerzgz
hackerzgz / 0_reuse_code.js
Created July 6, 2017 09:30
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@hackerzgz
hackerzgz / protobuf import issue.md
Last active July 9, 2017 14:13
import prefix issue in protobuf
@hackerzgz
hackerzgz / clean_git_history.sh
Last active May 27, 2020 03:24
clean up top large files in git commit history
#!/bin/bash
# INSPIRED BY:
# http://luren5.com/2017/05/11/%E6%8F%90%E4%BA%A4%E5%A4%A7%E6%96%87%E4%BB%B6%E5%AF%BC%E8%87%B4-git-objects-pack%E7%9B%AE%E5%BD%95%E5%BE%88%E5%A4%A7%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95/
TOP_FILES=top-files
CLEAN_FILES=clean-files
function find_top_files() {
TOP=$1
git rev-list --objects --all | \
@hackerzgz
hackerzgz / watch_rx_packets.sh
Created May 27, 2020 13:46
watch rx packets
#!/bin/bash
DEVICE=$1
if [[ "${DEVICE}" == "" ]];
then
echo "no special device, exit"
echo "usage: ./watch_rx_packets \$DEVICE"
exit 1
fi
@hackerzgz
hackerzgz / graceful_kill.sh
Created July 7, 2020 03:16
kill a process gracefully
#!/bin/sh
pid=$1
count=$2
n=0
if [ ! -n $count ];then
count=10
fi
while [[ $n -lt $count ]]
@hackerzgz
hackerzgz / defaultme.vim
Created August 13, 2020 06:01
vim dark color scheme with black background and green foreground colors
" Vim color file
" Maintainer: Maria
" Last Change: 2013 Dec
" From: http://storiesofmaria.blogspot.com/2013/12/vim-green-black-color-scheme.html
" This is a Vim dark color scheme with black background and green foreground colors
hi clear
if version > 580
@hackerzgz
hackerzgz / start_wxwork.sh
Last active October 26, 2020 02:41
Running wxwork on Linux by docker
#!/bin/env bash
# reference: https://github.com/BoringCat/docker-WXWork
WXWORK_NAME=wxwork
# enable xhost server
xhost +
sudo docker ps -a | grep -q "${WXWORK_NAME}"
if [ "$?" -eq "0" ]; then