Skip to content

Instantly share code, notes, and snippets.

@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;
}
@KyonLi
KyonLi / ViewController.m
Created March 22, 2017 02:20
UITableView built-in animation complete callback
[CATransaction begin];
[CATransaction setCompletionBlock:^{
[_tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionMiddle animated:YES];
}];
[_tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
[CATransaction commit];
@KyonLi
KyonLi / configuration.xml
Created September 2, 2016 09:47
click-to-run
<Configuration>
<Add OfficeClientEdition="64" >
<Product ID="O365ProPlusRetail" >
<Language ID="zh-cn" />
<ExcludeApp ID="Access" />
<ExcludeApp ID="Groove" />
<ExcludeApp ID="InfoPath" />
<ExcludeApp ID="Lync" />
<ExcludeApp ID="OneNote" />
<ExcludeApp ID="Outlook" />