The cmd do following actions:
- get phpcs result
- normalize string
- normalize zero and non-zero numbers
- normalize functions
- normalize vars
- uniq and sort
- output
#!/bin/bash | |
domains=`ls /etc/letsencrypt/archive/` | |
for domain in $domains; do | |
max=`ls -v /etc/letsencrypt/archive/${domain} | grep cert | tail -n 1 | grep -oP "\d+"` | |
echo "create symlink for ${domain} version ${max}" | |
cd /etc/letsencrypt/live/${domain} | |
rm cert.pem privkey.pem chain.pem fullchain.pem | |
ln -s ../../archive/${domain}/cert${max}.pem cert.pem | |
ln -s ../../archive/${domain}/privkey${max}.pem privkey.pem |
// 文件类型-category | |
{1:"全部视频",2:"全部音乐",3:"全部图片",4:"全部文档",6:"其它文件",7:"全部种子"} | |
{1:"video",2:"audio",3:"image",4:"doc",5:"app",6:"other",7:"bt",100:"visio",101:"ppt",102:"pdf",103:"txt",104:"word",105:"excel",106:"ipa",107:"apk",108:"zip"} | |
// 昵称 | |
{101:"昵称已被他人占用",102:"昵称含敏感词, 请修改后再试",103:"昵称仅支持中/英文、数字及符号-和_"} | |
{0:"昵称最长为12个字",1:"请输入至少一个字或两个字符",2:"仅支持中/英文、数字及符号-和_"} | |
// 文件分享 | |
{0:"成功","-1":"由于您分享了违反相关法律法规的文件,分享功能已被禁用,之前分享出去的文件不受影响。","-2":"用户不存在,请刷新页面后重试","-3":"文件不存在,请刷新页面后重试","-4":"登录信息有误,请重新登录试试","-5":"host_key和user_key无效","-6":"请重新登录","-7":"该分享已删除或已取消","-8":"该分享已经过期","-9":"访问密码错误","-10":"分享外链已经达到最大上限100000条,不能再次分享","-11":"验证cookie无效","-14":"对不起,短信分享每天限制20条,你今天已经分享完,请明天再来分享吧!","-15":"对不起,邮件分享每天限制20封,你今天已经分享完,请明天再来分享吧!","-16":"对不起,该文件已经限制分享!","-17":"文件分享超过限制","-30":"文件已存在","-31":"文件保存失败","-33":"一次支持操作999个,减点试试吧","-32":x,"-70":"你分享的文件中包含病毒或疑似病毒,为了你和他人的数据安全,换个文件分享吧",2:"参数错误",3:"未登录或帐号无效",4:"存储好像出问题了,请稍候再试",108:"文件名有敏感词,优化一下吧",110:"分享次数超出限制,可以到“我的分享”中查看已分享的文件链接",114:"当前任务不存在,保存失败",115:"该文件禁止分享",112:'页面已过期,请<a href="javascript: |
The cmd do following actions:
sublime.error_message(string) | |
sublime.message_dialog(string) | |
sublime.ok_cancel_dialog(string, <ok_title>) | |
sublime.yes_no_cancel_dialog(string, <yes_title>, <no_title>) | |
sublime.get_clipboard(<size_limit>) | |
sublime.set_clipboard(string) | |
sublime.View.file_name() | |
sublime.View.is_dirty() | |
sublime.View.is_scratch() |
# coding: utf-8 | |
import json | |
import codecs | |
import sys | |
def parse_json(data): | |
global depth | |
depth += 1 | |
if type(data) == list: |
{ | |
"workspaces": { | |
"recent_workspaces": [ | |
"/D/coding/project/demo.sublime-workspace" | |
] | |
}, | |
"settings": { | |
"new_window_settings": { | |
"menu_visible": true, | |
"output.mdpopups": { |
# coding: utf-8 | |
import re | |
import os | |
import codecs | |
import shutil | |
# prepare a folder as backup place | |
backup_path = 'd:\\backup' | |
# the conflict files path list, copy from everything | |
files = codecs.open("sync-conflict.txt", "r", "utf-8").read().strip() |
173.245.48.0/20 | |
103.21.244.0/22 | |
103.22.200.0/22 | |
103.31.4.0/22 | |
141.101.64.0/18 | |
108.162.192.0/18 | |
190.93.240.0/20 | |
188.114.96.0/20 | |
197.234.240.0/22 | |
198.41.128.0/17 |
cat /var/log/apache2/mysite_access.log | awk '{print $1}' | sort | uniq -c | sort -nr |
cnt=`ps | grep "kcptun" | grep -v "grep" | wc -l` | |
if [ $cnt -eq 0 ];then | |
/usr/bin/kcptun-client -c /var/etc/kcptun/client.general.json | |
echo "restart kcptun service at `date`" >> /root/check.log | |
else | |
echo "$cnt kcptun service on at `date`" | |
fi | |
# add this line to cron with `crontab -e` | |
# * * * * * /root/openwrt_process_watchdog.sh |