Skip to content

Instantly share code, notes, and snippets.

@fuxu
fuxu / vimrc
Last active October 14, 2015 16:36
vimrc
syntax on
set expandtab
set tabstop=4
set shiftwidth=4
set autoindent
set smartindent
set foldmethod=indent
set bs=2
set hlsearch
set ruler
@fuxu
fuxu / blockip.sh
Created January 14, 2013 13:51
A shell blocking ips running in crontab every minute via reading nginx log
#!/bin/sh
log_path=/path/to/nginx/log
debug_log_path=/path/to/debug/log
tmp_file=/tmp/blockiplog.tmp
tmp_ipfile=/tmp/blockip.tmp
# don't block these ips
safe_ip=""
# don't block these user agents
safe_ua="google|yahoo|baiduspider|bingbot|FeedSky|sogou|360Spider|JikeSpider|YoudaoBot"
/*
-----------------------------------
Emoji - natural display for the web
-----------------------------------
These font face definitions allows to display emoji glyphs intermingled with
arbitrary characters outside emoji unicode blocks.
Usage
@fuxu
fuxu / diff.sh
Created August 30, 2018 15:03
analyze status of `istio.github.io` Chinese translate
#!/bin/sh
# Run in root path of repo `istio.github.io`
for ORIG in $(find content -type f ! -name "*.png" ! -name "*.svg"); do
CHINESE=content_zh/${ORIG#content/}
if [ ! -f $CHINESE ]; then
echo "\033[31m[MISSING]\033[0m: $CHINESE"
else