Skip to content

Instantly share code, notes, and snippets.

@ThinkZ
ThinkZ / web.config
Created April 1, 2017 07:46
IIS.URL Rewriter rule for let's encrypt
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="let's encrypt" enabled="true" stopProcessing="true">
<match url="^.well-known/acme-challenge/.+$" />
<action type="None" />
</rule>
<rule name="Rewrite to example.com" enabled="true">
@ThinkZ
ThinkZ / centos6.5_nginx
Created April 14, 2017 07:08 — forked from ifels/centos6.5_nginx
centos 6.5 nginx安装与配置
第一步,在/etc/yum.repos.d/目录下创建一个源配置文件nginx.repo:
cd /etc/yum.repos.d/
vim nginx.repo
填写如下内容:
[nginx]
name=nginx repo
使用 wget 下载一个目录下的所有文件
谁能看出标题配的图有什么问题?好吧,标题的图和本文没有任何关系!
今天想下载 MIT 的李代数课程笔记,参见网页:http://math.mit.edu/classes/18.745/Notes/. 突然间忘了 wget 的用法,如果直接将上述 URL 作为 wget 的参数的话,只会下载 index.html 文件。上网搜了一下,发现需要用到以下参数,所以写此日志记录之. 我参考了以下网站 http://bmwieczorek.wordpress.com/2008/10/01/wget-recursively-download-all-files-from-certain-directory-listed-by-apache/
基本上,只要:
wget -r -np -nH -R index.html http://url/including/files/you/want/to/download/
解释一下各个参数的含义:
1. nginx
安装
sudo apt-get install nginx
启动、停止和重启
sudo /etc/init.d/nginx start
sudo /etc/init.d/nginx stop
sudo /etc/init.d/nginx restart
或者
sudo service nginx start
@ThinkZ
ThinkZ / gist:55432ba2857e2ad44191e1c5d4a2b130
Last active August 5, 2017 16:23
SQL Server SHRINKFILE
Select name from data.sys.database_files where type=1;
DUMP TRANSACTION data with NO_LOG;
Backup LOG data with NO_LOG;
DBCC SHRINKFILE('Data_log');
@ThinkZ
ThinkZ / gist:26a5b51dadb3d95d5f32af5f09ca4771
Created August 28, 2017 08:00
git clone 所有远程分支
git clone 所有远程分支
git clone只能clone远程库的master分支,无法clone所有分支,解决办法如下:
1. 找一个干净目录,假设是git_work
2. cd git_work
3. git clone http://github.xxx.com/project/.git ,这样在git_work目录下得到一个project子目录
4. cd project
5. git branch -a,列出所有分支名称如下:
remotes
@ThinkZ
ThinkZ / ffmpeg.md
Created September 17, 2017 03:48 — forked from v5tech/ffmpeg.md
ffmpeg视频合并、格式转换、截图

使用ffmpeg合并MP4文件

ffmpeg -i "Apache Sqoop Tutorial Part 1.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i "Apache Sqoop Tutorial Part 2.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "Apache Sqoop Tutorial Part 3.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate3.ts
ffmpeg -i "Apache Sqoop Tutorial Part 4.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate4.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts|intermediate3.ts|intermediate4.ts" -c copy -bsf:a aac_adtstoasc "Apache Sqoop Tutorial.mp4"
@ThinkZ
ThinkZ / openwrt
Created July 11, 2018 09:05
linux public ip check
wget -q -O - http://checkip.dyndns.org
wget -q -O - http://icanhazip.com
wget -q -O - http://ifconfig.io/ip
wget -q -O - http://ip.appspot.com
wget -q -O - http://ipecho.net/plain
wget -q -O - http://ipinfo.io/ip
wget -q -O - http://myip.ipip.net
wget -q -O - http://www.trackip.net/ip
wget -q -O - http://curlmyip.com
@ThinkZ
ThinkZ / curl ifconfig...
Created November 29, 2018 10:39
what is my ip address
curl icanhazip.com
curl ifconfig.me
curl ifconfig.io
curl ifconfig.co
curl ipinfo.io/ip
curl curlmyip.com
curl ip.appspot.com
curl ipecho.net/plain
curl www.trackip.net/ip
# GLiNet MT300N-V2 安装 SSR plus 插件
GLiNet 是一家 生产 便携路由的国内厂商 好像外销为主。
最主要的是他家 路由系统采用的是开源 OpenWrt 系统 并在github 上开源 并提供sdk 和 很多插件
但是国内政策的关系 国内买到的路由器固件内 并没有提供直接安装 SS SSR V2ray 的方法。
经过在 恩三论坛 学习了下(www.right.com.cn) 已经成功把lean 开源的(https://github.com/coolsnowwolf/lede.git) SSR plus 插件 成功的安装到了 MT300N-V2 固件中,下面记录一些安装步骤。