Skip to content

Instantly share code, notes, and snippets.

Avatar
🥱
Have nothing to do all day long.

Kaiyuan Xie Kaiyuan

🥱
Have nothing to do all day long.
View GitHub Profile
@Kaiyuan
Kaiyuan / firewalld_cloudflare_whitelist.sh
Created Apr 24, 2019
CentOS firewalld 添加 Cloudflare 和百度云加速白名单 访问 080 和 443 端口
View firewalld_cloudflare_whitelist.sh
#!/bin/bash
firewall-cmd --add-rich-rule="rule family="ipv4" source address="173.245.48.0/20" port protocol="tcp" port="80" accept" ; firewall-cmd --add-rich-rule="rule family="ipv4" source address="103.21.244.0/22" port protocol="tcp" port="80" accept" ; firewall-cmd --add-rich-rule="rule family="ipv4" source address="103.22.200.0/22" port protocol="tcp" port="80" accept" ; firewall-cmd --add-rich-rule="rule family="ipv4" source address="103.31.4.0/22" port protocol="tcp" port="80" accept" ; firewall-cmd --add-rich-rule="rule family="ipv4" source address="141.101.64.0/18" port protocol="tcp" port="80" accept" ; firewall-cmd --add-rich-rule="rule family="ipv4" source address="108.162.192.0/18" port protocol="tcp" port="80" accept" ; firewall-cmd --add-rich-rule="rule family="ipv4" source address="190.93.240.0/20" port protocol="tcp" port="80" accept" ; firewall-cmd --add-rich-rule="rule family="ipv4" source address="188.114.96.0/20" port protocol="tcp" port="80" accept" ; firewall-cmd --add-rich-rule="rule fa
View 2gif.bat
set filelink=%1
set filecolor=%1.png
ffmpeg -i %filelink% -r 24 -vf fps=24,scale=240:-1:flags=lanczos,palettegen -y %filecolor% && ffmpeg -v warning -i %filelink% -i %filecolor% -r 4 -lavfi fps=24,scale=240:-1:flags=lanczos[x];[x][1:v]paletteuse -y %filelink%.gif && del /F /S /Q %filecolor%
exit
@Kaiyuan
Kaiyuan / 2gif.bat
Last active Nov 14, 2019
用 ffmpeg 和 gifski 将视频转为高画质 GIF 的 bat。
View 2gif.bat
set filelink=%1
set filedir=%1_
mkdir %filedir%
ffmpeg -i %1 %filedir%\frame%%04d.png && gifski --fps 25 --quality 80 --quiet -o %filelink%.gif %filedir%\frame*.png && rmdir /s/q %filedir%
exit
@Kaiyuan
Kaiyuan / cloudflare.sh
Last active May 1, 2019
Cloudflare DDNS 脚本
View cloudflare.sh
#!/bin/bash
NEW_IP=`curl ip.changeip.com|sed -e 's/<.*$//'`
NOWTIME=`date`
CURRENT_IP=`cat /var/tmp/current_ip.txt`
LOG_FILE="/var/log/cloudflare_ddns.log"
IP_FILE="/var/tmp/current_ip.txt"
ZONE_ID='Domain Zone ID'
LOGIN_MAIL='login@mail.com'
API_KEY='Global API Key'
DDNS_ZONE='ddns-zone-key'
@Kaiyuan
Kaiyuan / README.md
Last active Feb 28, 2020
node 唤醒设备模块
View README.md

Npm Install express body-parser wol silly-datetime

npm install express body-parser wol silly-datetime --sava

sudo npm install pm2 -g

sudo pm2 start /volume1/web/node/pm2_config.json
@Kaiyuan
Kaiyuan / Wordpress-nginx.conf
Created Jan 23, 2017
Wordpress 使用 nginx 禁止不带参数访问 xmlrpc.php 和 wp-login.php
View Wordpress-nginx.conf
location ~* /(xmlrpc.php)$ {
if ($is_args = '') {
rewrite ^(.*) http://127.0.0.1/ permanent;
}
# location ~ .*\.php?$args {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index xmlrpc.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/$fastcgi_script_name;
include fastcgi_params;
# }
View Atom 使用 SS 代理.sh
apm config set https-proxy socks5://127.0.0.1:1080
@Kaiyuan
Kaiyuan / boxks-cse-style.css
Created Sep 13, 2016
BOXKS blog Google cse style
View boxks-cse-style.css
/**
* Default Theme, v2.
*
*/
/* Slight reset to make the preview have ample padding. */
#SearchPageBox {
height: 40px;
border: 1px solid #d7d7d7;
border-radius: 6px;
width: -moz-calc(100% - 2px);
@Kaiyuan
Kaiyuan / AndroidCaptivePortalServer.md
Last active Sep 7, 2016
Android 5.0 解决叹号提示的问题
View AndroidCaptivePortalServer.md

现在网上下载 ADB,然后解压好。我打包的: http://pan.baidu.com/s/1jIdKJ1G

手机打开开发者 USB 调试,然后用 USB 线连接电脑授权调试。

然后运行 CMD输入下面的命令。

ADB所在所在目录\adb shell "settings put global captive_portal_server captive.v2ex.co"
@Kaiyuan
Kaiyuan / donated.html
Last active Apr 27, 2016
使用 JS 提交 Post 的 PayPal 捐赠按钮。
View donated.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Donate</title>
</head>
<body>
<input id="ppButton" class="ppButton" type="submit" border="0" name="button" alt="PayPal" value="Donate">
</body>
</html>
You can’t perform that action at this time.