Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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 / 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 / .gitignore
Created January 31, 2018 02:45
xcode ignore
.git
.svn
*.DS_Store
.AppleDouble
.LSOverride
._*
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items

Keybase proof

I hereby claim:

  • I am kyonli on github.
  • I am kyon (https://keybase.io/kyon) on keybase.
  • I have a public key ASClQJKzuCH1nV_82sfQeyo8H5Sx-UEibU8SIDz12LrsmQo

To claim this, I am signing this object:

@KyonLi
KyonLi / aria2
Last active May 17, 2023 19:11
Aria2 init.d script
#!/bin/sh
### BEGIN INIT INFO
# Provides: Aria2
# Required-Start: $network $local_fs $remote_fs
# Required-Stop:: $network $local_fs $remote_fs
# Should-Start: $all
# Should-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Aria2 - Download Manager
@KyonLi
KyonLi / cell.m
Created April 13, 2017 05:25
SDWebImage fade in effect
[photoImgeView setImageWithURL:[NSURL URLWithString:photoPath]
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType) {
if (cacheType == SDImageCacheTypeNone) {
photoImgeView.alpha = 0;
[UIView animateWithDuration:0.3 animations:^{
photoImgeView.alpha = 1;
}];
} else {
photoImgeView.alpha = 1;
}