Skip to content

Instantly share code, notes, and snippets.

View fanlushuai's full-sized avatar
🟢

auh fanlushuai

🟢
View GitHub Profile
#!/bin/bash
echo "Install Shadowsocks on CentOS 7"
CONFIG_FILE=/etc/shadowsocks.json
SERVICE_FILE=/etc/systemd/system/shadowsocks.service
SS_METHOD=aes-256-cfb
SS_IP=`ip route get 1 | awk '{print $NF;exit}'`
GET_PIP_FILE=/tmp/get-pip.py
@fanlushuai
fanlushuai / change_ubuntu_sourcelist_to_aliyun.sh
Last active January 9, 2021 23:34
修改Ubuntu apt源到 aliyun镜像。支持多版本Ubuntu。
#!/bin/bash
# feature: ubuntu /etc/apt/sources.list change to aliyun
# usage:bash <(curl -s http://…….sh)
# look os CODENAME
CODENAME=$(lsb_release -c | awk '{print $2}')
# test aliyun webdir whether exist for spec CODENAME
URL_ALIYUN_CODENAME="http://mirrors.aliyun.com/ubuntu/dists/"$CODENAME"/"
@fanlushuai
fanlushuai / surfingkeys-config.txt
Last active March 31, 2024 03:32
surfingkeys-config
//=========================enjoy !!!=============================================
// 1. 输入流畅理念。修改F键的导航功能,按键生成策略。采用左边前两排+v,b的字符。保证不会生成rx,一些让手指弯曲过度的组合按键。使得输入更加流畅
// 2. 高频快速直达理念。搜索,使用独立的s关键字,使用最少的按键,来处理最高频的功能。同理,最直达的逻辑优化。h,直达历史,以及内置的b书签。通过原始的o前缀虽然也挺快,但是,还是处在一种没有优先级的状态。
// 3. 添加快速搜索的能力(可以抛弃一键切换插件)(注:xx可以表达为,域名的缩写,比如,github-gh,google-gg。自己可以改配置,加搜索引擎):
// a. ";+xx",携带当前关键字,切换搜索引擎进行搜索】(独有扩展)
// b. ";;+xx", 使用当前选中的内容,进行浏览器的搜索(内置,使用s+。这种更加易于,减轻快捷键的记忆负担。)
// c. ";;;+xx", 使用用户输入,在当前页面打开输入框,进行搜索(内置,使用s+,这种减轻记忆负担。同时因为在使用频率上,也就s频率高。所以,单独抽取了一个s键)
// d. "alt+s",快速的自动切换搜索引擎,按照顺序进行搜索
// e. "oa+xx",使用关键字,同时打开相同类型的搜索引擎,进行搜索。比如,一个关键字将同时打开,google,baidu。
// 4. 添加导航的功能,使用"m+xx"的方式,直接跳转到目标网站(独有扩展。可以抛弃导航插件了)
@fanlushuai
fanlushuai / darken-wsl2-dircolors.sh
Last active January 17, 2021 21:53
wsl2默认的dircolor非常亮眼,难受。可以修改一下。
#!/usr/bin/bash
set -euxo pipefail
cd ~/
dircolors_file='.dircolors'
dircolors -p > ${dircolors_file}
@fanlushuai
fanlushuai / zshrc
Last active January 25, 2021 02:01
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
@fanlushuai
fanlushuai / clean_img_no_ref_by_markdown.sh
Created January 27, 2021 09:44
clean imgs has no referrence by markdown files
#!/usr/bin/bash
#===================
# clean imgs not used in *.md
#===================
# if current sh locate in .github/reurces/scripts/clean_imgs.sh
# this kind must excute by "xsh path/name.sh" ,due to $0 can get ./ if according ./xx.sh excute
EXCUTE_PATH=$(dirname ${0})/
# make both "bash ./a/x.sh" and "././a/x.sh" can excute
# but alse exist a little bug if same name sh scripts exist in nearby dir
@fanlushuai
fanlushuai / hugo_add_default_draft_true.sh
Last active January 17, 2022 16:55
add draft true if draft not exsit in hugo front matter,which make to must spec draft field if make all files public
#!/usr/bin/bash
set -e # if a command fails it stops the execution
set -u # script fails if trying to access to an undefined variable
################################
# add draft:false if draft not exist
################################
# this kind must excute by "xsh path/name.sh" ,due to $0 can get ./ if according ./xx.sh excute
EXCUTE_PATH=$(dirname "${0}")/
https://raw.githubusercontent.com/LightDestory/qBittorrent-Search-Plugins/master/src/engines/academictorrents.py
https://raw.githubusercontent.com/LightDestory/qBittorrent-Search-Plugins/master/src/engines/btetree.py
https://raw.githubusercontent.com/qbittorrent/search-plugins/master/nova3/engines/ettv.py
https://raw.githubusercontent.com/LightDestory/qBittorrent-Search-Plugins/master/src/engines/glotorrents.py
https://raw.githubusercontent.com/LightDestory/qBittorrent-Search-Plugins/master/src/engines/ilcorsaronero.py
https://raw.githubusercontent.com/LightDestory/qBittorrent-Search-Plugins/master/src/engines/kickasstorrents.py
https://raw.githubusercontent.com/LightDestory/qBittorrent-Search-Plugins/master/src/engines/nitro.py
https://raw.githubusercontent.com/LightDestory/qBittorrent-Search-Plugins/master/src/engines/pirateiro.py
https://raw.githubusercontent.com/qbittorrent/search-plugins/master/nova3/engines/rarbg.py
https://raw.githubusercontent.com/LightDestory/qBittorrent-Search-Plugins/master/src/eng
@fanlushuai
fanlushuai / qbit-plugins.txt
Created March 18, 2023 18:41
qBittorrent plugins
https://raw.githubusercontent.com/qbittorrent/search-plugins/master/nova3/engines/rarbg.py
https://gist.githubusercontent.com/BurningMop/fa750daea6d9fa86c8fe5d686f12ed35/raw/16397ff605b1e2f60c70379166c3e7f8df28867d/one337x.py
https://raw.githubusercontent.com/LightDestory/qBittorrent-Search-Plugins/master/src/engines/academictorrents.py
https://raw.githubusercontent.com/hannsen/qbittorrent_search_plugins/master/ali213.py
https://raw.githubusercontent.com/nindogo/qbtSearchScripts/master/anidex.py
https://raw.githubusercontent.com/nklido/qBittorrent_search_engines/master/engines/audiobookbay.py
https://raw.githubusercontent.com/kjjejones44/b4tg_search_plugin/master/bt4g.py
https://raw.githubusercontent.com/LightDestory/qBittorrent-Search-Plugins/master/src/engines/btetree.py
https://raw.githubusercontent.com/msagca/qbittorrent_plugins/main/btmulu.py
https://raw.githubusercontent.com/MaurizioRicci/qBittorrent_search_engine/master/cinecalidad.py
@fanlushuai
fanlushuai / wechat-group-monitor.py
Created December 4, 2023 09:16
分析微信消息情感,对某一个用户消极情感,进行关爱提醒。
# -*- coding: utf-8 -*-
import cntext
from itchat.content import *
import itchat, time
import requests
# {'a': {'lastTime': 1701659203, 'banScore': 0}, 'b': {'lastTime': 1701659203, 'banScore': 0}, 'c': {'lastTime': 1701659201, 'banScore': 2}}
banStatistics = {}
cnDiction = cntext.load_pkl_dict("DUTIR.pkl")["DUTIR"]