javasgl

step by step


  • Home

  • Archives

  • Tags

  • Categories

  • About

  • Search

iptables使用笔记

Posted on 2017-03-17 | In Linux | Visitors

Linux 下防火墙 iptables 命令使用笔记

  • 查看目前iptables设置 iptables -vnL --line-numbers

    • -v verbose 详细信息
    • -n 显示数字端口等
    • -L list ,默认会显示filter表的规则
    • --line-numbers 显示序号,删除、插入时有用
  • 删除规则iptables -t table -D INPUT ruleNumber

    • -t table name,默认filter表,filter|Nat|Mangle|Raw
    • -D delete
    • INPUT chain name,INPUT|OUTPUT|FORWARD|PREROUTING|POSTROUTING
    • ruleNumber rule number,可以使用--line-numbers参数查看
  • 查看状态/etc/init.d/iptables status

  • 保存修改/etc/init.d/iptables save,规则保存在/etc/sysconfg/iptables文件中
  • 开启|重启|关闭/etc/init.d/iptables start|restart|stop
Read more »

Go Get安装一些第三方库-网络问题

Posted on 2017-03-08 | In go | Visitors

go在go get 一些 package时候的会由于众所周知的原因而无法下载。比如在安装 bee的时候有可能会遇到无法下载 golang.org/x/sys/unix 的问题。

1
unrecognized import path "golang.org/x/sys/unix"

解决方案:手动从github下载相应的package

1
2
git clone --depth=1 https://github.com/golang/xxx.git
git clone --depth=1 https://github.com/golang/xxx.git

注:xxx 为对应的需要的库

下载完成后,软链或者复制 到 $GOPATH/src/golang.org/x/ 下即可。

1
2
3
4
5
6
7
golang.org/
└── x
├── net
├── sys
└── tools

4 directories

更为简便的方法:

1
2
3
4
5
mkdir -p $GOPATH/src/golang.org/x/
cd !$
git clone https://github.com/golang/net.git
git clone https://github.com/golang/sys.git
git clone https://github.com/golang/tools.git

Atom 调整左侧目录字体大小

Posted on 2017-03-07 | In tools | Visitors

刚刚安装好 atom的时候, 左侧的 tree 目录字体特别小,可以通过一下方式来设置

  • 打开Atom-Stylesheet

  • 找到 .tree-view

    1
    2
    3
    4
    // style the background color of the tree view
    .tree-view {
    // background-color: whitesmoke;
    }
  • 给 .tree-view 添加 font-size 即可:

    1
    2
    3
    .tree-view {
    font-size:16px;
    }
  • 当然,添加其他属性也是可以的,可以自己定制样式,颜色,字体,字号等,CSS语法

Atom设置代理

Posted on 2017-03-07 | In tools | Visitors

由于众所周知的原因,Atom有时候安装插件的时候很慢甚至无法安装。可以通过设置代理来解决。
前提是已经有一个可以使用的http代理。参考之前的文章:将socks5转为http代理

  • atom自带了一个工具 apm(atom package management) 这个工具可以用来设置一些系统配置

  • 可以用apm config list 查看现有的系统配置信息

下面开始设置 http代理:

Read more »

Mac上使用Privoxy 将 socks5转换为 http 代理

Posted on 2017-03-06 | In tools | Visitors

shadowsocks 挺不错的,但是有些时候需要使用http代理来爬墙。这时候可以使用privoxy来将 socks5 代理转换为 http代理。

配置

步骤如下:

  • 首先,确保 shadowsocks 已经正常起来的,默认的本地socks5端口号为 1080,可以使用 netstat 和 lsof 命令查看端口情况。

  • 安装privoxy, mac 使用 brew install privoxy 即可

  • 安装完成后,修改privoxy配置文件

    Read more »
1…1112
javasgl

javasgl

A journey of a thousand miles begins with single step

60 posts
13 categories
94 tags
RSS
GitHub Wechat
© 2020 javasgl
Powered by Hexo
Theme - NexT.Mist
0%