制作 SSR shadowsocksr 订阅脚本

参考制作 SSR shadowsocksr 订阅简单教程

使用了

https://www.ssrtool.com/tool/ssr

https://www.ssrtool.com/tool/Base64

两个页面的api

用 python 脚本简单包装一下

import requests

#for convert ssr config to ssr subcribtion file

f = open(“gui-config.json”, “r”)
json_content=f.read()
# print(json_content)
r = requests.post(“https://www.ssrtool.com/tool/api/SSR_JsonToSSR”,data={“json_content”:json_content})
# print(r.text)

ssr_content=r.text.replace(“\””,””).replace(“,”,”\n”).replace(“[“,””).replace(“]”,””)
r2 = requests.post(“https://www.ssrtool.com/tool/api/enBase64″,data={“content”:ssr_content})
# print(r2.text)
resJson=r2.json()
fssr=open(“ssr.txt”,”w”)
fssr.write(resJson[“data”])
# print(resJson[“data”])

print(“Generate finished.”)

把gui-config.json放到脚本目录下,

运行脚本

然后把生成的ssr.txt 放到订阅服务器的相关位置即可。

win10 分辨率1080p时显示虚化

win10,连接到外置的显示器,1080p,如果设置缩放100%,字体太小,看的累,

如果设置125%,字体虚,模糊

参考:https://www.zhihu.com/question/34304515

你只需要Windows 10 DPI blurry fix这个小工具。顾扯淡的回答在点上,但是治标不治本。

链接贴在下面。

http://windows10_dpi_blurry_fix.xpexplorer.com/

cba41ebf-a3c4-479f-9202-3b8b0abf1271

DPI 按照设置内的推荐值设置即可。
如果现在是 100,尝试 125

重启之后OK。

Windows替换任务管理器

实现方法:这里其实是使用了一个非常著名的IFEO调试器方法,它可以在某个程序运行的状态下,直接使用注册表中添加的程序信息对其进行替换和调试。在
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe

子键下。只要在其右侧,直接添加“Debugger”字符串值,并手工指定其调试用程序路径,就可以替换已有程序。”C:\PORTABLE\PROCESSEXPLORER\PROCEXP64.EXE”


替换回来:
删除debuger选项

zsh和oh my zsh 配置

zsh 设置

ohmyzsh安装

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

git extras[https://github.com/tj/git-extras]安装

$ git clone https://github.com/tj/git-extras.git
$ cd git-extras
# checkout the latest tag
$ git checkout $(git describe --tags $(git rev-list --tags --max-count=1))
$ [sudo] make install

bash complete

when building android source, need to source >build/envsetup.sh
will complain "complete not found"

because android build use bash as default,complete is bash embed function

add below to .zshrc
bash
autoload -U compinit && compinit
autoload -U bashcompinit && bashcompinit

if build android source still error, and using bash is ok,
try to use

emulate bash

before make.

just ensure you have "#!/usr/bin/env bash" at the first line of your script

emulate sh -c '. ./myscript.sh'

git 命令卡死,cpu 占用率到100%

http://superuser.com/questions/458906/zsh-tab-completion-of-git-commands-is-very-slow-how-can-i-turn-it-off
添加到.zshrc
bash
__git_files () {
_wanted files expl 'local files' _files
}

autojump

autojump is a faster way to navigate your filesystem. It works by maintaining a database of the directories you use the most from the command line.

Directories must be visited first before they can be jumped to.

https://github.com/wting/autojump
bash
git clone git://github.com/joelthelion/autojump.git
cd autojump
./install.py or ./uninstall.py

add the following line(s) to ~/.zshrc:

[[ -s ~/.autojump/etc/profile.d/autojump.sh ]] && source ~/.autojump/etc/profile.d/autojump.sh
autoload -U compinit && compinit -u

GDB debug setting for lazarus

GDB_on_OS_X_Mavericks_or_newer_and_Xcode_5_or_newer

Codesigning gdb

https://sourceware.org/gdb/wiki/BuildingOnDarwin#Method_for_Mac_OS_X_10.5_.28Leopard.29_and_later

Mac(os x)下使用gdb的问题

codesign 之后,运行出现

sudo codesign -fs gdb-cert /usr/local/bin/gdb

The GDB command:
"-gdb-set confirm off"
did not return any result.

终端执行gdb

dyld: Library not loaded: /usr/local/opt/mpfr/lib/libmpfr.6.dylib
Referenced from: /usr/local/bin/gdb
Reason: image not found
[1] 25803 trace trap gdb

参考:
cannot run gdb on mac's terminal even after codesign

build gdb from source

  1. download source from
    ftp://sourceware.org/pub/gdb/releases/
  2. build

    ./configure
    make
    sudo make install

    build error

probe.c:63:28: error: default initialization of an object of const type 'const any_static_probe_ops' without a user-provided default

https://news.ycombinator.com/item?id=16275140

fixed: remove const

- const any_static_probe_ops any_static_probe_ops;
+ any_static_probe_ops any_static_probe_ops;

vps + onedrive 挂载实验

参考(https://www.moerats.com/archives/491/)

教程写得很详细,按照步骤来即可。
中间碰到几个问题

  1. rclone authorize 获取校验
    vps上没有办法启动browser,只能使用no,手动校验

因为使用的是mac,安装mac版的rclone
macos-installation-from-precompiled-binary

教程很详细,基本上,全部copy即可。

在mac上运行,rclone authorize "onedrive"
浏览器跳出授权校验,然后rclone即可显示key

Waiting for code…
Got code
Paste the following into your remote machine —>
{"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IlNTUWRoSTFjS3ZoUUVEU0p4RTJnR1lzNDBRMCIsImtpZCI6IlNTUWRoSTFjS3ZoUUVEU0p4RTJnR1lzNDBRMCJ9.eyJhdWQiOiJodHRwczovL2FwaS5vZmZpY2UuY29tL2Rpc2NvdmVyeS8iLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC85OGQ0YmE1ZC1lM2RlLTRkZDMtODc5ZC0wNzAwYjhiZDY2NTAvIiwiaWF0IjoxNTIxMTI4MTEwLCJuYmYiOjE1MjExMjgxMTAsImV4cCI6MTUyMTEzMjAxMCwiYWNyIjoiMSIsImFpbyI6IlkYtMjc0OC00YTVlLWJlOTYtOTIwZjQ2MTNhMDYwIiwib25wcmVtX3NpZCI6IlMtMS01LTIxLTI3NjU5ODg3ODYtMjQ4MTA1MzIyMy00MDkxOTg3MTMtNTUyMzU3IiwicHVpZCI6IjEwMDMzRkZGQTdFMDlDNDciLCJzY3AiOiJNeUZpbGVzLlJlYWQgTXlGaWxlcy5Xcml0ZSBVc2VyLlJlYWQiLCJzdWIiOiI1ZjB4c0Q0U1VJSkRTOUdhZ3JRdXU1UlBmRF9EZi1KdEs2SzBLcnEzVWU0IiwidGlkIjoiOThkNGJhNWQtZTNkZS00ZGQzLTg3OWQtMDcwMGI4YmQ2NjUwIiwidW5pcXVlX25hbWUiOiJ3bWluZ3lhbmdAc3R1ZGVudC5jY2MuZWR1IiwidXBuIjoid21pbmd5YW5nQHN0dWRlbnQuY2NjLmVkdSIsInV0aSI6ImRxandYT0xoTDBxbGEwbHRBRFZlQUEiLCJ2ZXIiOiIxLjAifQ.lCWSGusZhaFoIf-1Funf3rCugguFWFY-KxgMCA80YegHqgZLRuvWWI6In3wYNwySh0iK4KPFns1CMlvmIZWatT7Fsd93si_UQMntfJ3LJPRkvdt4OdwepBjAQxb8wlBc8l00ffGPwI5tWOzsFBgmQIx6dzN8lj__o7k5uWTNlIMEi7fZbWkDrm98dBvtHInalBId-U-GWTXZuwgslf0mBQy6oBfdQXigUa1_2rk7oj0QUbnWY0mX7zEno57jmzyY_4uia9S4QfDT42bsG6jDzXE72r9kW8rNQa4T_DgRfO9Msgm5Ea-9cY0xXxE8LrfD-eJvhG7ZNoYB8C59gIp-NQ","token_type":"Bearer","refresh_token":"AQABAAAAAABHh4kmS_aKT5XrjzxRAtHzR4InVUf4plQaM9x9UOZCVY1cKJ98cyPT3RpmmzYTxT83V_fYngu18vNrxMVemhzmm1ymSIV8sON9xPI37DycKgWOndvnxB7Cwpp-KojRTVTqPplii_3j2DbgXzXJzpFTQLb8s55PhfCLL8E_8E3-91cptM0sZHHOZrBvNnV4IC1JURAa2p4edOH6km5r7Xi_ZZXLBTMZ1Y0DKwU_LrR5yNSLKwzq8oBCWgkgSIG2w81wbVxwOjsf_6wQ8Thi4XZE4kp4McBqwheJWv7c06IKBlzMPxZwuQE5gW2BMXHkILTGhTrMm8rACDxkAiJMuFP68AVylh0GaSeE_w6TSa0DNJTiqR2cd4uMf3xDm8Pr__QlnZSAA","expiry":"2018-03-16T00:40:09.97948688+08:00"}
<—End paste%

把大括号里面的内容粘贴到vps上的rclone上,即可配置完成。

  1. mount的时候,参数需要修改
    >rclone mount onedrive_ccc:ebooks /opt/onedrive –copy-links –no-gzip-encoding –no-check-certificate –allow-other –allow-non-empty –umask 000

报错,才发现,只有kvm的vps才行,openVZ的不行,只好换了bwg的

  1. 然后顺利配置自动启动,一路顺利。

  2. 测试写入文件到vps的目录下,onedrive即可看到。

使用vps的ipv6网络,架设shadowsocksr,使本地通过ssr访问ipv6网络

参考:使用vps的ipv6网络

https://www.leavesongs.com/SHARE/ipv6-via-ss.html

检查现有的ssr配置,基本上都是配置OK,可设置ipv6作为代理,都无法上网。

  1. bwg
    ifconfig 可以看到ipv6 地址,但是无法ping通
    参考
    >http://www.bandwagonhost.net/512.html

原来kvm的,没有ipv6,难怪没找着启用的地方
该文章有提供思路,可参考。

  1. vultr

配置里面选择ipv6,即可激活一个ipv6 网络,需要重启vps

启用后,ping6 本机地址 OK

修改ssr配置,dns_ipv6 修改为true,重启ssr,

service shadowsocks-r restart

"redirect":"",
"dns_ipv6":true,
"fast_open":false,
"workers":1

然后,ssr 客户端,设置服务器的ipv4的地址即可

http://ipv6.blcu6.edu.cn/resource.asp

ps:bwg cn2 在移动宽带下,访问比vultr慢多了。