Skip to content

Instantly share code, notes, and snippets.

View foru17's full-sized avatar
🎯
Focusing

Luo Lei foru17

🎯
Focusing
View GitHub Profile
@foru17
foru17 / ars_preclean.sh
Created September 27, 2017 04:01
预处理清理上传的文件夹和文件。
#!/bin/bash
# Author luolei
# Updated 2017-09-25
LOGFILE=/data/logs/ars/ars_preclean.log
ZERO=`date +%s%N`
echo '====================' >> $LOGFILE
echo 'Start the preclean process ...' >> $LOGFILE
echo 'Param: ' $1 >> $LOGFILE
@foru17
foru17 / yuegate.sh
Created May 8, 2017 04:39
quick run ngrok cilent
#!/bin/bash
#by luolei 快速启动ngrok穿透
pushd `dirname $0` > /dev/null
SCRIPTPATH=`pwd -P` #设置当前路径
popd > /dev/null
online='.pub.is26.com'
domain=$1
port=$2
@foru17
foru17 / watchSS.sh
Created May 5, 2017 05:30
watch ss server
#!/bin/bash
# 服务端 ss 进程watch
# crontab监控: * * * * * /data/runtime/watchSS.sh
PORT=8388
if lsof -Pi :$PORT -sTCP:LISTEN -t >/dev/null ; then
echo '[SS] shadowsocks is running'
else
echo '[SS] shadowsocks is down'
ssserver -p 8388 -k luolei -m aes-256-cfb -d start
@foru17
foru17 / quickcon.sh
Created May 2, 2017 10:27
quick connect to server by list
#!/bin/bash
#by luolei 方便快捷登录到指定服务器
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/root/bin
clear
serverListStore=/Users/yuewen-luolei/Desktop/all
serverListGen=/Users/yuewen-luolei/Desktop/.server_list
> $serverListGen
Num=1
function main(){
@foru17
foru17 / csscomb.js
Created November 26, 2015 04:52
Sublime Text CSScomb配置
{
//于CSScomb for sublime配置,根据 mozilla 官方推荐的CSS书写顺序整理而成,请根据实际IDE和构建config自定义配置
//参考: https://www.mozilla.org/css/base/content.css
//
// If plugin has trouble finding Node.js, replace this string with path
// to your `node` bin
"node-path" : ":/usr/local/bin",
// Full list of supported options and acceptable values can be found here:
// https://github.com/csscomb/csscomb.js/blob/master/doc/options.md
@foru17
foru17 / rename.sh
Created November 24, 2015 11:04
脚本批量改名 替换参数
#当前文件夹
for file in ACDC*.xxx; do
mv "$file" "${file//ACDC/AC-DC}"
done
#子目录
find . -type f -name "ACDC*" -print0 | while read -r -d '' file; do
mv "$file" "${file//ACDC/AC-DC}"
done
@foru17
foru17 / changsuffix.sh
Created August 4, 2015 03:18
修改文件后缀
#修改文件后缀
for f in *.txt; do
mv -- "$f" "${f%.txt}.text"
done
@foru17
foru17 / wechatua.js
Created June 18, 2015 04:02
微信UA
//微信安卓UA
mozilla/5.0 (linux; u; android 4.1.2; zh-cn; mi-one plus build/jzo54k) applewebkit/534.30 (khtml, like gecko) version/4.0 mobile safari/534.30 micromessenger/5.0.1.352
//微信iPhone UA
mozilla/5.0 (iphone; cpu iphone os 5_1_1 like mac os x) applewebkit/534.46 (khtml, like gecko) mobile/9b206 micromessenger/5.0
@foru17
foru17 / urlparam.js
Created June 12, 2015 06:41
获得URL中的参数
function getUrlParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
var r = window.location.search.substr(1).match(reg); //匹配目标参数
if (r != null) return unescape(r[2]);
return null; //返回参数值
}
@foru17
foru17 / node.conf
Created May 26, 2015 12:21
端口转发 nginx 配置
server {
listen 80;
server_name yitest.is26.com;
location /{
root /home/project/
index index.php index.html;
}