Firefox和FoxyProxy

三年不用Firefox了,最近由于需要进行手机端和电脑端资源同步,chrome在国内不安装谷歌套件无法使用,所以又切换回了firefox。 在安装完成autoproxy后发现,订阅gfwlist.txt一直无法成功,网上找了找消息,说是autoproxy已经跟不上firefox开发脚步,无法继续使用。于是在firefox的addon站点重新找代理插件,最终选定foxyproxy。 以下是foxyproxy设置socks代理,和订阅gfwlist.txt的一些设置方法。 安装foxyproxy 去主页http://getfoxyproxy.org/,安装完成后重启firefox 添加代理服务器 双击地址栏和搜索栏中间的foxyproxy图标,进入到设置 代理服务器选项卡中点击新建代理服务器 常规选项卡中设置代理名称,如ss 代理服务器细节中设置具体参数,以下是我的设置截图,可以参考 设置订阅gfwlist.txt 在模式订阅选项卡中,空白处点击右键,添加新的模式订阅 参考下图设置,注意勾划出来的地方 将foxyproxy的工作模式选择为使用基于其预定义模版的代理服务器。

2016年2月13日 · jqx

windows7开启telnet客户端

安装完成windows7后,默认可能没有开启telnet功能,这样在cmd下输入telnet时会提示无命令,可以参考下文开启telnet功能。 开始 -> 控制面板 -> 程序和功能 在左侧边栏找到打开或关闭windows功能 在打开的窗口中找到Telnet客户端,勾选,确认。 Over!

2016年2月10日 · jqx

使用net_speeder加速VPS

当使用国外服务器时,经常会发现,下载速度只有十几k。平时可能不太注意,认为服务器带宽不足,或者自己使用的宽带不给力,其实很有可能原因并不在此。 由于光速的局限性,延迟会比较高(即使光沿直线传播,太平洋一个往返也要一百多毫秒)。并且由于距离较远,途径路由跳数较多,并且网络拥堵的原因。经常会发生丢包的情况。 对于平时使用最广泛的TCP协议来讲,发送端发出包后,接收端会回复ACK,表示自己收到了。用这种机制来保证可靠性。但对于高延迟链路来讲,如果每发送一个包都等待应答,那么大部分时间都在等待数据包到达,而链路则空置了。为此一般会采用滑动窗口技术。即在窗口满之前,发送端一直发送包,然后收到应答后将确认收到的包从窗口中移除。这样可以提高链路利用率。 TCP还有一个特性则是拥塞控制。当发送端检测到链路发生丢包时,则会主动缩小窗口大小以减慢发送速度,避免拥塞。不过对于跳数较多的链路来讲,只要有一个路由不够稳定丢包,就会被发送端判断为拥塞,从而影响网络速度。 为了解决丢包问题,最简单粗暴的方法就是双倍发送,即同一份数据包发送两份。这样的话在服务器带宽充足情况下,丢包率会平方级降低。 这种方式下,直接优点是降低丢包率,直接缺点是耗费双倍流量。一些延伸影响是更容易触发快速恢复逻辑,避免了丢包时窗口缩减过快。一定程度也能提高网络速度。 最近比较忙,空闲时间做了一个最简单的程序,试用效果很好,在一台VPS上测试后发现,未开启时单线程下载、ssh管道速度在十几K级别。开启后可以达到平均300KB+的速度。效果非常明显。但对于不加速就可以跑满带宽的类型来讲(多线程下载),开启后反而由于多出来的无效流量,导致速度减半。所以对于多线程/高速链路,这个方案是不适合的。 目前版本是最简单的逻辑,未来会进行细化(主动触发快速恢复、快速重传等),降低流量浪费,提升加速效果。 目前程序起名net-speeder,相对于修改协议栈来讲,由于后者需要重新升级编译内核,使用用户态程序部署更方便,稳定性更高,兼容性更好。缺点则是性能开销稍大和自由度有损失。总体比较起来,个人使用还是使用用户态程序更合适一些,特别是在虚拟机中使用(OpenVZ,LXC等虚拟机无法自己定制内核)。 摘自http://www.snooda.com/read/324 net_speeder项目主页 https://github.com/snooda/net-speeder 安装net_speeder apt-get install libnet-dev libpcap-dev -y git clone https://github.com/snooda/net-speeder.git cd net-speeder sh build.sh mv net_speeder /usr/local/bin/ 使用net_speeder 使用ifconfig查看网卡端口,我的端口为venet0 nohup net_speeder venet0 "ip" >/dev/null 2>&1 & 添加到开机启动 echo 'nohup net_speeder venet0 "ip" >/dev/null 2>&1 &' >> /etc/rc.local

2016年2月7日 · jqx

显示cp等命令的执行进度

Linux中进行文件拷贝和移动时,我们是看不到具体命令的执行情况,不知道还需要多久才可以执行完成。在此推荐一个软件名为progress,用它可以查看一些命令的具体执行情况,包括进度、时间等等。 该软件的具体解释为Coreutils Progress Viewer,即核心程序进度查看,用它可以监视很多linux程序的执行情况,比如cp、mv、dd、tar,、gzip、cat等等,甚至于firefox的下载进度或者nginx的运行情况。 安装progress progress主页 https://github.com/xtod/progress 可以使用apt,dnf,pacman、zypper、brew等管理工具直接安装progress,或者使用以下手动安装。 手动安装progress方法 git clone https://github.com/xtod/progress.git cd progress make make install 使用progress 简单的执行方法 ➜ ~ progress No command currently running: cp, mv, dd, tar, bsdtar, cat, rsync, scp, grep, fgrep, egrep, cut, sort, md5sum, sha1sum, sha224sum, sha256sum, sha384sum, sha512sum, adb, gzip, gunzip, bzip2, bunzip2, xz, unxz, lzma, unlzma, 7z, 7za, zip, unzip, zcat, bzcat, lzcat, coreutils, split, gpg, or wrong permissions. 几个示例: 监控所有可监控软件的执行情况 watch progress -q 然后进行文件操作即可看到如下内容: ...

2016年2月4日 · jqx

使用Google Authenticator两步验证加强SSH登录

Google Authenticator开源版主页 https://github.com/google/google-authenticator 安装Google Authenticator Ubuntu通过以下命令安装: apt-get install libpam-google-authenticator CentOS通过以下命令安装: yum install google-authenticator 其他系统可以通过源码编译安装 git clone https://github.com/google/google-authenticator-libpam.git cd google-authenticator-libpam/ ./bootstrap.sh ./configure make make install 注意:在Debian7中执行./configure时可能存在以下错误提示 configure: error: Unable to find the PAM library or the PAM header files 在此需要安装libpam0g-dev和libtool apt-get -y install libpam0g-dev libtool 设置Google Authenticator 在手机端搜索安装Google Authenticator google-authenticator Do you want authentication tokens to be time-based (y/n) y 然后出现二维码,使用手机端Google Authenticator扫码,接下来服务器端继续设置 如果没有出现二维码,可以将提示的以https://www.google.com/chart?开头的连接复制到浏览器中,就可以看到二维码了 Do you want me to update your "/root/.google_authenticator" file (y/n) y Do you want to disallow multiple uses of the same authentication token? This restricts you to one login about every 30s, but it increases your chances to notice or even prevent man-in-the-middle attacks (y/n) Do you want to disallow multiple uses of the same authentication token? This restricts you to one login about every 30s, but it increases your chances to notice or even prevent man-in-the-middle attacks (y/n) y By default, tokens are good for 30 seconds and in order to compensate for possible time-skew between the client and the server, we allow an extra token before and after the current time. If you experience problems with poor time synchronization, you can increase the window from its default size of 1:30min to about 4min. Do you want to do so (y/n) y If the computer that you are logging into isn't hardened against brute-force login attempts, you can enable rate-limiting for the authentication module. By default, this limits attackers to no more than 3 login attempts every 30s. Do you want to enable rate-limiting (y/n) y 接下来将Google Authenticator验证配置到SSH登录中 ...

2016年1月28日 · jqx