清空Github上某個檔案的歷史
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch app/img/*' --prune-empty --tag-name-filter cat -- --all git push origin master --force rm -rf .git/refs/original/ git reflog expire --expire=now --all git gc --prune=now git gc --aggressive --prune=now
使用iconv 對大檔案編碼轉換GB2312 - UTF8
iconv -f gb2312 -t utf-8//IGNORE av-ed2k-合集.data > 日文教學日文教學.txt av-ed2k-合集.data
Nginx 上限制單IP 單位時間的請求數,以及單IP 的並發連線數
http {
limit_req_zone $binary_remote_addr zone=one:10m rate=8r/s; server { location /search/ { limit_req zone=one burst=5; }
使用Nginx 限制頁存取權
命令行登陸權限sudo apt-get install apache2-utils sudo htpasswd -c /etc/nginx/.htpasswd myusername server { listen 80; server_name ip_address; location /backend { root /var/www/sunzhongwei.com; index index.html index.htm; auth_basic "Restricted"; auth_basic_user_file /etc/nginx/.htpasswd; } } sudo /etc/init.d/nginx reload
ssh-keygen -t rsa -C "郵件"
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/MZero/.ssh/id_rsa):
$ ssh -T git@github.com
若有You've successfully authenticated提示,說明成功了
service iptables restart
grant all on aaa.* to "root"@xx .yy.zz.cc identified by "123";
flush privileges; aaa.* to "root"@"%" identified by "123";
ssh 設定密碼登入
ssh-keygen -t rsa -C "you@homestead"
$ sudo vim /etc/ssh/sshd_config
RSAAuthentication yesPubkeyAuthentication yes
AuthorizeKeyFile ~/.ssh/authorized_keys
service sshd restart
將公鑰檔案的內容追加到~/.sk/authorized_hdkeysauthorized_hdkeys600,000,000 且將檔案帶. /authorized_keys
$ vim .bash_profile
alias c14='ssh [username]@[server_ip] (-i ~/.ssh/[私鑰檔案])'
$ c14
$
Nginx 報502 的解決思路
nginx報錯,查看nginx日誌排錯
nginx報502 bad gate way一般是因為沒有配置好php-fpm
修改nginx或php-fpm設定檔之後重啟生效和http2 模組支援
curl https://nginx.org/download/ng... |
tar xzf - && cd nginx-* # get latest nginx & extract it./configure [old_config_arguments] --withHun-http_ssl_ssl_ --with-http_v2_module # 前面[old_config_arguments] 可以從nginx -V 裡copy
make
sudo make install
listen 443 ssl http2;
ssl_certificate /home/brook/ssl/home/brook/ssl/homessl_certificate/home/brook/ssl/home/brook/ssl/ /domain.key;
ssl_dhparam /home/brook/ssl/dhparams.pem;
ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:RSACDH+A2562628:RSA RSA+ 3DES:!MD5;
ssl_prefer_server_ciphers on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_session_cache shared:SSL:50m; -Transport-Security max-age=31536000;
service reload nginx
pphpmyadmin 缺少mcrypt 擴充
sudo apt-get install php-mcrypt libmcrypt libmcrypt-devel
sudo ln -s /etc/php5/bache-mcrypt-devel
sudo ln -s /etc/php5/aches-mcrypt-devel
sudo-ln -s /etc/php5/bache-mcrypt-devel .
curl指令查看請求回應時間方法
curl -o /dev/null -s -w %{time_namelookup}::%{time_connect}::%{time_starttransfer}::%{time_total}::%{speed_download} "n" http://www.36nu.com
0.014::0.015::0.018::0.019::1516256.00
用github來展示你的前端頁
創建專案新分支透過專案新專案通過專案/(user_name|org_name).g... 存取
一個更簡單的方式來實現:將程式碼上傳至倉庫後在settings裡配置下GitHub Pages為你想展示的分支就行了