##shadowsocks

  • server

    • config

      1
      2
      3
      4
      5
      6
      7
      8
      {
      "server": "1.1.1.1",
      "server_port": 1111,
      "local_port": 1123,
      "password": "lt1610990",
      "timeout": 600,
      "method": "aes-256-cfb"
      }
    • command
      ssserver -c /etc/shadowsocks.json -d start

  • client

    • config

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      {
      "server": "1.1.1.1",
      "server_port": 1111,
      "local_address": "127.0.0.1",
      "local_port": 1123,
      "password": "pwd",
      "timeout": 600,
      "method": "aes-256-cfb",
      "fast_open": false,
      "workers": 1
      }
    • command
      sslocal -c /etc/ssConfig.json

  • lambda表达式

    Lambda 表达式是对象,他们必须依附于一类特别的对象类型——函数式接口(functional interface),即单一方法的接口,例如Runnable,View.OnclickListener.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    Button bt = (Button) findViewById(R.id.test);
    //传统方法
    bt.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
    Log.d(TAG, "onClick: old");
    }
    });
    //lambda
    bt.setOnClickListener(view -> Log.d(TAG, "onCreate: lambda"));
    bt.setOnLongClickListener(view -> {
    Log.e(TAG, "onCreate: long");
    return false;
    });
    Runnable r = () -> System.out.println("lambda test ");
  • stream简单应用
    遍历List<>

    1
    2
    3
    4
    5
    6
    7
    8
    List<String> list = new ArrayList<>();
    //old
    for (String s:list){
    System.out.println(s);
    }
    //lambda
    list.forEach(s -> System.out.println(s));

linux默认输出颜色意义

白色:表示普通文件
蓝色:表示目录
绿色:表示可执行文件
红色:表示压缩文件
浅蓝色:链接文件
红色闪烁:表示链接的文件有问题
黄色:表示设备文件
灰色:表示其他文件

shadowsocks 配置



## shadowsocks

server config

{
"server": "1.1.1.1",
"server_port": 1111,
"local_port": 1123,
"password": "lt1610990",
"timeout": 600,
"method": "aes-256-cfb"
}
</pre>" style="border: 0px; display: block;font-family: Consolas, Inconsolata, Courier, monospace; font-weight: bold; white-space: pre; margin: 0px;border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); padding: 0px 5px; margin: 0px 2px;font-size: 1em; letter-spacing: -1px; font-weight: bold;">{ "<span class="hljs-attribute" style="color: rgb(181, 137, 0);">server</span>": <span class="hljs-value"><span class="hljs-string" style="color: rgb(42, 161, 152);">"1.1.1.1"</span></span>, "<span class="hljs-attribute" style="color: rgb(181, 137, 0);">server_port</span>": <span class="hljs-value"><span class="hljs-number" style="color: rgb(42, 161, 152);">1111</span></span>, "<span class="hljs-attribute" style="color: rgb(181, 137, 0);">local_port</span>": <span class="hljs-value"><span class="hljs-number" style="color: rgb(42, 161, 152);">1123</span></span>, "<span class="hljs-attribute" style="color: rgb(181, 137, 0);">password</span>": <span class="hljs-value"><span class="hljs-string" style="color: rgb(42, 161, 152);">"lt1610990"</span></span>, "<span class="hljs-attribute" style="color: rgb(181, 137, 0);">timeout</span>": <span class="hljs-value"><span class="hljs-number" style="color: rgb(42, 161, 152);">600</span></span>, "<span class="hljs-attribute" style="color: rgb(181, 137, 0);">method</span>": <span class="hljs-value"><span class="hljs-string" style="color: rgb(42, 161, 152);">"aes-256-cfb"</span> </span>} </code></pre> * commandssserver -c /etc/shadowsocks.json -d start* **client** * config<pre class="json hljs" style="border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 0.5em;display: block; overflow-x: auto; padding: 0.5em; color: rgb(101, 123, 131); background: rgb(253, 246, 227);">{
"server": "1.1.1.1",
"server_port": 1111,
"local_address": "127.0.0.1",
"local_port": 1123,
"password": "pwd",
"timeout": 600,
"method": "aes-256-cfb",
"fast_open": false,
"workers": 1
}
“ style=”border: 0px; display: block;font-family: Consolas, Inconsolata, Courier, monospace; font-weight: bold; white-space: pre; margin: 0px;border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); padding: 0px 5px; margin: 0px 2px;font-size: 1em; letter-spacing: -1px; font-weight: bold;”>{
server“: “1.1.1.1”,
server_port“: 1111,
local_address“: “127.0.0.1”,
local_port“: 1123,
password“: “pwd”,
timeout“: 600,
method“: “aes-256-cfb”,
fast_open“: false,
workers“: 1
}


* command
sslocal -c /etc/ssConfig.json

java8新特性 部分



lambda表达式

Lambda 表达式是对象,他们必须依附于一类特别的对象类型——函数式接口(functional interface),即单一方法的接口,例如Runnable,View.OnclickListener.

Button bt = (Button) findViewById(R.id.test);
//传统方法
bt.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Log.d(TAG, "onClick: old");
}
});
//lambda
bt.setOnClickListener(view -&gt; Log.d(TAG, "onCreate: lambda"));

bt.setOnLongClickListener(view -&gt; {
Log.e(TAG, "onCreate: long");
return false;
});

Runnable r = () -&gt; System.out.println("lambda test ");
`“ style=”border: 0px; display: block;font-family: Consolas, Inconsolata, Courier, monospace; font-weight: bold; white-space: pre; margin: 0px;border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); padding: 0px 5px; margin: 0px 2px;font-size: 1em; letter-spacing: -1px; font-weight: bold;”> Button bt = (Button) findViewById(R.id.test);
//传统方法
bt.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Log.d(TAG, “onClick: old”);
}
});
//lambda
bt.setOnClickListener(view -> Log.d(TAG, “onCreate: lambda”));

bt.setOnLongClickListener(view -> {
Log.e(TAG, “onCreate: long”);
return false;
});

Runnable r = () -> System.out.println(“lambda test “);
stream简单应用
遍历List<>

`
List&lt;String&gt; list = new ArrayList&lt;&gt;();
//old
for (String s:list){
System.out.println(s);
}
//lambda
list.forEach(s -&gt; System.out.println(s));
“ style=”border: 0px; display: block;font-family: Consolas, Inconsolata, Courier, monospace; font-weight: bold; white-space: pre; margin: 0px;border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); padding: 0px 5px; margin: 0px 2px;font-size: 1em; letter-spacing: -1px; font-weight: bold;”>
List<String> list = new ArrayList<>();
//old
for (String s:list){
System.out.println(s);
}
//lambda
list.forEach(s -> System.out.println(s));