Skip to content

Instantly share code, notes, and snippets.

Avatar
✈️
Jet lag again and again ...

Chai Feng chaifeng

✈️
Jet lag again and again ...
View GitHub Profile
View ipaddresses.txt
1.255.48.0/20
2.59.128.0/22
3.0.0.0/15
3.5.0.0/16
3.6.0.0/15
3.8.0.0/13
3.16.0.0/13
3.24.0.0/14
3.34.0.0/15
3.80.0.0/12
View transfer.sh
transfer() {
if [ $# -eq 0 ]; then
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md";
return 1;
fi
tmpfile="$( mktemp -t transferXXX )";
query="$1";
[[ -z "$query" ]] && exit 1;
if ! tty -s; then
View keybase.md

Keybase proof

I hereby claim:

  • I am chaifeng on github.
  • I am chaifeng (https://keybase.io/chaifeng) on keybase.
  • I have a public key ASAZ6nDh_A9Wq_2C14rT8rSekONNNtguhyyuDHRRFkcVpQo

To claim this, I am signing this object:

@chaifeng
chaifeng / tomcatctl
Last active May 3, 2018
Tomcat control script, init.d autostart
View tomcatctl
#!/bin/sh
# Tomcat Control Script
#
# Usage:
# ln -s /path/to/tomcatctl $HOME/apache-tomcat-6.0.37/
# sudo ln -s $HOME/apache-tom-6.0.37/tomcatctl /etc/init.d/tomcatctl
# sudo /etc/init.d/tomcatctl status
#
# In crontab
# */1 * * * * $HOME/apache-tomcat-6.0.37/tomcatctl monitor http://localhost:8080/ > /dev/null || $HOME/apache-tomcat-6.0.37/tomcatctl condrestart > /dev/null
You can’t perform that action at this time.