Skip to content

Instantly share code, notes, and snippets.

@KyonLi
KyonLi / .gitignore
Created January 31, 2018 02:45
xcode ignore
.git
.svn
*.DS_Store
.AppleDouble
.LSOverride
._*
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
@KyonLi
KyonLi / websocket.conf
Created February 17, 2018 13:41
Apache2 websocket proxy
<VirtualHost *:443>
ServerName mysite.com
ServerAlias www.mysite.com
SSLEngine on
SSLProxyEngine on
ProxyPreserveHost on
ProxyRequests Off
SSLCertificateFile /etc/apache2/ssl/mysite.com.crt
@KyonLi
KyonLi / newifi_asuswrt.md
Last active September 4, 2018 07:12
Build AsusWRT for newifi mini

[GUIDE] Build AsusWRT for newifi mini on Ubuntu 14.04 32bit

Manually preparing the build environment

install packages

apt-get install libncurses5 libncurses5-dev m4 bison gawk flex libstdc++6-4.4-dev g++-4.4 g++ \
git gitk zlib1g-dev autoconf autopoint libtool shtool autogen mtd-utils intltool sharutils \
docbook-xsl-* libstdc++5 texinfo dos2unix xsltproc make pkg-config
@KyonLi
KyonLi / S10cron
Created April 20, 2018 02:16 — forked from cmprescott/S10cron
optware cron startup script that also sets correct file permissions
#!/bin/sh
#
# Startup script for optware cron
#
# Fix file permissions
# Cron throws an error if these files are anything other than RW by owner
chmod 600 /opt/etc/crontab
chmod -R 600 /opt/etc/cron.d/
@KyonLi
KyonLi / frps
Created April 24, 2018 03:29
frps init.d script
#!/bin/sh
### BEGIN INIT INFO
# Provides: frps
# Required-Start: $local_fs $network
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: frps service deamon
# Description: frps service daemon
@KyonLi
KyonLi / fix_permission.sh
Created January 21, 2019 08:26
Fix www file permission
find /var/www -type f -exec chmod 644 {} \;
find /var/www -type d -exec chmod 755 {} \;
@KyonLi
KyonLi / S22v2ray
Created February 10, 2019 07:52
entware v2ray
#!/bin/sh
ENABLED=yes
PROCS=v2ray
ARGS="-config /opt/etc/v2ray/config.pb -format=pb"
PREARGS=""
DESC=$PROCS
PATH=/opt/sbin:/opt/bin:/opt/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
SRC_BYPASS_IP_FILE=/opt/etc/v2ray/src_bypass_ip.txt
@KyonLi
KyonLi / coin.go
Created April 1, 2019 07:56
Coin in go
func coin() {
backspace := "\b\b"
for i := 0; i < 5; i++ {
for _, c := range []string{"๐ŸŒ", "๐ŸŒ–", "๐ŸŒ—", "๐ŸŒ˜", "๐ŸŒš", "๐ŸŒ’", "๐ŸŒ“", "๐ŸŒ”"} {
fmt.Printf("%s%s", backspace, c)
time.Sleep(33333 * time.Microsecond)
}
}
rand.Seed(int64(time.Now().UnixNano()))
if rand.Uint32() % 2 == 0 {
@KyonLi
KyonLi / golang.sh
Created April 23, 2019 05:42
sets envs for golang
#!/bin/bash
# sets envs for golang
if [ -z "$GOPATH" ]; then
export GOROOT="/usr/local/go"
export GOPATH="$HOME/go"
export PATH="$PATH:$GOPATH/bin:$GOROOT/bin"
fi
@KyonLi
KyonLi / echo.go
Created May 22, 2019 07:56
echo server
package main
import (
"bytes"
"fmt"
"io"
"net/http"
"net/url"
"strings"
)