Skip to content

Instantly share code, notes, and snippets.

rm -rf /Applications/Thunder.app/Contents/PlugIns/webgame.xlplugin #遊戲
rm -rf /Applications/Thunder.app/Contents/PlugIns/livestream.xlplugin #美女直播
rm -rf /Applications/Thunder.app/Contents/PlugIns/featuredpage.xlplugin #精選頁面
rm -rf /Applications/Thunder.app/Contents/PlugIns/xlbrowser.xlplugin #迅雷瀏覽器(會導致在迅雷內無法開啟網頁)
rm -rf /Applications/Thunder.app/Contents/PlugIns/xlplayer.xlplugin #迅雷播放器
rm -rf /Applications/Thunder.app/Contents/PlugIns/softmanager.xlplugin #應用卸載
rm -rf /Applications/Thunder.app/Contents/PlugIns/activitycenter.xlplugin #活動中心
rm -rf /Applications/Thunder.app/Contents/PlugIns/myvip.xlplugin #會員中心
rm -rf /Applications/Thunder.app/Contents/PlugIns/advertising.xlplugin #廣告
@xfyuan
xfyuan / gist:dcf94a9572eef8dea130c52b96dc39da
Created July 26, 2019 01:18 — forked from bessarabov/gist:674ea13c77fc8128f24b5e3f53b7f094
One-liner to generate data shown in post 'At what time of day does famous programmers work?' — https://ivan.bessarabov.com/blog/famous-programmers-work-time
git log --author="Linus Torvalds" --date=iso | perl -nalE 'if (/^Date:\s+[\d-]{10}\s(\d{2})/) { say $1+0 }' | sort | uniq -c|perl -MList::Util=max -nalE '$h{$F[1]} = $F[0]; }{ $m = max values %h; foreach (0..23) { $h{$_} = 0 if not exists $h{$_} } foreach (sort {$a <=> $b } keys %h) { say sprintf "%02d - %4d %s", $_, $h{$_}, "*"x ($h{$_} / $m * 50); }'
#用户 用户组
user www www;
#工作进程,根据硬件调整,有人说几核cpu,就配几个,我觉得可以多一点
worker_processes 5;
#错误日志
error_log logs/error.log;
#pid文件位置
pid logs/nginx.pid;
worker_rlimit_nofile 8192;
@xfyuan
xfyuan / git.migrate
Created May 29, 2019 03:18 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
let g:projectionist_heuristics['mix.exs'] = {
\ 'apps/*/mix.exs': { 'type': 'app' },
\ 'lib/*.ex': {
\ 'type': 'lib',
\ 'alternate': 'test/{}_test.exs',
\ 'template': ['defmodule {camelcase|capitalize|dot} do', 'end'],
\ },
\ 'test/*_test.exs': {
\ 'type': 'test',
\ 'alternate': 'lib/{}.ex',
@xfyuan
xfyuan / server.md
Created February 8, 2018 08:24 — forked from jtadeulopes/server.md
Server setup with ubuntu, nginx and puma for rails app.

Update and upgrade the system

sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get autoremove
sudo reboot

Configure timezone

@xfyuan
xfyuan / ssl_puma.sh
Created February 7, 2018 06:11 — forked from tadast/ssl_puma.sh
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@xfyuan
xfyuan / crontab
Created February 7, 2018 06:00 — forked from alea12/crontab
Nginx + Let's Encrypt + Rails5 + Puma
00 05 01 * * /home/alea12/letsencrypt/letsencrypt-auto certonly --webroot -w /var/www/html -d example.net --renew-by-default && nginx -t && nginx -s reload
@xfyuan
xfyuan / nginx.conf
Created February 6, 2018 06:35 — forked from micho/nginx.conf
nginx config for http/https proxy to localhost:3000
First, install nginx for mac with "brew install nginx".
Then follow homebrew's instructions to know where the config file is.
1. To use https you will need a self-signed certificate: https://devcenter.heroku.com/articles/ssl-certificate-self
2. Copy it somewhere (use full path in the example below for server.* files)
3. sudo nginx -s reload
4. Access https://localhost/
Edit /usr/local/etc/nginx/nginx.conf:
@xfyuan
xfyuan / gist:cc28cb84fde6e258d89e11cebf7a5b9f
Last active December 7, 2017 16:27 — forked from bbonamin/gist:96be60bad7fa5164a092
SSL in Development with Nginx + Rails
  1. Install nginx brew install nginx
  2. Cd into the nginx directory /usr/local/etc/nginx
  3. Create a ssl directory, change and generate a dummy ssl cert: mkdir ssl cd ssl penssl req -new -newkey rsa:2048 -sha1 -days 365 -nodes -x509 -keyout server.key -out server.crt (just accept the default empty settings)
  4. Go back to the nginx directory cd ..
  5. Create or edit nginx.conf with the following settings:
events {