上次写了一个单用户的脚本可以修改配置文件的密码并重启服务,这次在上次脚本的基础上做了些改进,对多用户版的配置文件进行修改。
Archive | DEV
用BashScript脚本自动修改shadowsocks密码
最近闲着无聊,了解了一下bash命令,写了一个自动修改shadowsocks密码的脚本
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
#!/bin/bash #================================================================ # Script for Shadowsocks Single User Password Renewing on Ubuntu/Debian # @author minirplus # Usage: ./ss-password-renew.sh # More info: https://blog.minirplus.com/5800/ #================================================================ # get old password old_password=$(grep password /etc/shadowsocks.json) password_index=$(expr index "$old_password" :) old_password=${old_password:password_index} old_password=${old_password%%,*} old_password=${old_password// /} old_password=${old_password:1:$((${#old_password}-2))} echo "your old password is $old_password" # generate new password new_password=$RANDOM echo "your new password is $new_password" # replace old password to new password echo "replace new password $new_password to the shadowsocks config file..." sed -i 's/'"$old_password"'/'"$new_password"'/g' /etc/shadowsocks.json # restart shadowsocks service echo "Restarting shadowsocks service..." /usr/local/bin/ssserver -c /etc/shadowsocks.json -d restart # All Done! echo "All Done!" echo "You can now use new password $new_password to login shadowsocks service now!" |
运行结果如下
1 2 3 4 5 6 7 8 9 10 |
root@vps:~# /usr/local/sbin/change-shadowsocks-password your old password is 28882 your new password is 20713 replace new password 20713 to the shadowsocks config file... Restarting shadowsocks service... INFO: loading config from /etc/shadowsocks.json 2016-02-15 17:17:33 INFO loading libcrypto from libcrypto.so.1.0.0 stopped started All Done! You will now can use new password 20713 to login shadowsocks service |
shadowsocks配置文件如下
1 2 3 4 5 6 7 8 9 10 |
{ "server":"0.0.0.0", "server_port":8381, "local_address": "127.0.0.1", "local_port":1080, "password":"20713", "timeout":300, "method":"aes-256-cfb", "fast_open": false } |
Clear URL Redirection 更新自动识别
通过在manifest.json中添加自动注入,可以自动识别网站并清除跳转URL了。
VeryCD Download Link Crack 分析获取VeryCD下载资源
今天在VeryCD找PDF资源的时候发现 VeryCD下载破解插件失效了,看了下插件的代码,原来是通过获取VeryCD的资源ID,然后去第三方镜像站通过资源ID查询资源插入到VeryCD页面中。
Clear URL Redirection 用Chrome插件还原链接真实地址
很多网站为了隐藏来源地址和赚零花钱,都把外部链接先跳转到第三方网站,这直接导致使用效率的降低,每次都要等待各种读秒各种验证后才能继续访问。