记录生活
herolee
该用户没有分享资料
herolee
【置顶】SSH代理服务器使用教程
十 23rd
之前,我写过一篇使用DreamHost的SSH服务做为代理服务器,具体做法是使用SSH帐号+Putty设置代理服务器,但是,用Putty的时候会有一个讨厌的DOS窗口最小化在任务栏,很碍眼,而且,当你打开代理的时候,想要不通过代理访问某些网站,只有两种办法:一是关闭代理服务器,二是在浏览器的代理服务器中设置不使用代理访问的网站,都是比较繁琐的.有没有更简单的,而且一劳永逸的办法呢?当然有!请看下文:
首先,我们必须准备3个东西:
- 一个SSH帐号(具体怎么获得SSH就不说了);
- 一个叫MyEnTunnel的小软件,猛击此处下载;
- Firefox浏览器(猛击此处到官网下载);
- 用firefox访问AutoProxy扩展官网(猛击此处)安装之.如果无法下载或者安装失败,请尝试点击此处手动下载安装文件,下载完毕后将安装文件直接拖到firefox的窗口内进行安装。
以上步骤准备好后,将下载来的MyEnTunnel解压缩到一个目录中,运行” myentunnel”,切换到”设置”选项卡,按下图设置即可:
其中,你需要修改的只有”SSH服务器”,”用户名”,”密码短语”这3项.当然,如果你的SSH帐号所在的服务器不是使用默认的22端口,就需要修改SSH端口号,”1080”是你作为代理服务器的端口,如果1080已经被其他服务占用,就改一个空闲的端口号即可.
信息都填写完毕后,点击”保存”, MyEnTunnel就会将配置保存到当前目录的一个配置文件中.
点击左下角的”连接”或者”断开”即可连接你的SSH服务器.
第一次连接服务器时,会弹出对话框问你是否要保存密钥,选”Yes”,则将必要保存到注册表,下次连接就不会再提示;如果选“No”,则下次连接时还会继续提示。
当连接成功后, MyEnTunne的图标会由黄色变为绿色,这个时候你就可以使用IP为127.0.0.1,端口为1080的socks5类型代理上网了.
点击”隐藏”,就可以将它隐藏到系统托盘,不会占用你的任务栏,完美吧?
下面要谈谈firefox的AutoProxy扩展,安装好这个扩展并重启firefox以后,会自动弹出这个窗口:

选中”gfwList”,再点击”确定”,这样就能得到每天自动更新的需要使用代理服务器才能访问的网站列表.这时候你再看firefox顶部的工具栏右侧(也有可能在底部状态栏右侧)是不是有个红色”福”字的按钮?点击这个按钮就可以打开”AutoProxy首选项”,打开后,点击”代理服务器”菜单,选择”编辑代理服务器”,打开设置代理服务器的窗口:

把最右侧的”删除”复选框全部打上勾,然后点击”删除代理”按钮,我们自己再添加代理(当然,你也可以只留下一个,把剩下的删除).我把代理全部都删除了,它不爽了:

赶紧点击”添加代理”重新设置一下吧,别忘了必须选中socks5:

按照上面的输入即可,端口号是之前在” MyEnTunnel”中设置的端口.当然,你可以自己取一个好听点的名字。
好了,点击”确定”就设置完了,如果你打开了AutoProxy后发现还是有些网站被墙了怎么办?解决办法:在”AutoProxy首选项”中,打开”代理规则”,选择”添加规则”,输入网址后点击确定即可.当然,” AutoProx”还有其他一些个性化的设置,如显示位置什么的,就不再多做说明了.
如果使用代理后无法观看youtube视频,在firefox地址栏输入:about:config,打开设置页面,搜索network.proxy.socks_remote_dns,将其值设为true即可用firefox观看。
如果你想让MyEnTunnel开机就自动启动,请创建一个myentunnel.exe的快捷方式,放到开始菜单-所有程序中的”启动”菜单中即可.
小广告:SSH帐号,一月只需5元.
2010年4月10日更新:
chrome的设置:安装Proxy Switchy!扩展,安装完毕之后,打开Proxy Switchy的设置页面,在Proxy Profiles中新建一个Profile,命名为“自动切换”,在右侧的设置中,选中Automatic Configuration,并在URL中填入http://autoproxy2pac.appspot.com/pac/socks/127.0.0.1/1080 (注意:如果你的本地socks5代理端口不是1080,请将1080替换成你设置的端口号),保存,然后点击工具栏中的Proxy Switchy!图标,选择之前建立的“自动切换”规则即可。
常见问题(不定期更新):
1. 为什么我按上面的设置了,图标也变成绿色了,可还是无法打开网页?
有可能是你的本地代理端口被其他程序占用,请先断开SSH服务器连接,同步修改MyEnTunnel和Autoprosy中的端口号,建议修改为随机4位数,如果修改后问题依旧存在,请再更换端口号重试。
2. Mac下如何设置?
请参考以下两篇文章:
PhotonVPS安装配置全记录
二 20th
前几天,在PhotonVPS买了一款512M内存的VPS,使用优惠码 “TENOFF”打九折后每月为$9.86。目前,我的博客和推特中文圈都放在了这个VPS上。购买这个VPS的原因主要是有中文 客服,就是hostloc.com上的 PhotonVPS-Jasmi。
一般来说,VPS都是最小化安装的,很多服务,比如php,mysql,ftp等等,都需要自己手动安装。VPS可以算是一台独立的主机,开放了root 权限,和一般的虚拟主机相比,配置起来很有乐趣,自由度很高。我对linux也不是很熟悉,有些资料也是google来的,对于新手来说,配置好 LAMP环境后看到网站正常运行,一定会觉得很有成就感。注:其他使用CentOS 5 的VPS应该也和这个类似。
以下的一些安装信息使用了VPS侦探的相关教程和资源,先表示感谢。
一、修改时区
1.运行tzselect,选择Asina/shanghai
2.运行cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime,会提示是否覆盖,覆盖即可
二、配置IP封禁,阻止ssh暴力破解
如果没有修改默认的SSH端口,就会遭到一些黑客的扫描和恶意破解root密码,配合logwatch(后有安装教程),可以把相关的IP加到封禁列表, 提高安全性。
运行vim /etc/hosts.deny
加入:
sshd:114.203.35.2:deny
其中,114.203.35.2就是你要阻止登陆的IP
三、安装php
由于在CentOS上用yum安装的PHP版本为5.1,现在很多程序需要5.2的运行环境,所以需要修改相关配置才能安装5.2版本的PHP
1.rpm –import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
2.vim /etc/yum.repos.d/CentOS-Base.repo
在最后增加下面信息:
[utterramblings]
name=Jason’s Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
3.安装php:yum install php
4.安装gd扩展:yum install php-gd
5.安装mysql扩展:yum install php-mysql
6.安装其他扩展:yum install php-mcrypt php-mbstring
四、安装mysql
1.yum install mysql-server
2.yum install mysql-devel
3.运行ntsysv,在mysqld前加*号,将其加入系统服务
4.运行service mysqld start,测试是否能够成功启动mysql
5.运行mysqladmin -u root password **** 修改mysql的root密码,将****替换为你重新设置的密码
五、安装gcc
由于安装一些软件时,需要自行编译后再安装,而PhotonVPS默认没有安装gcc,因此也需要安装。
运行yum install gcc安装。
六、安装日志分割软件
使用apche的默认设置会使日志过于臃肿,会占用大量的磁盘空间,解决办法就是用cronolog分割日志,便于管理。
1.下载:wget http://cronolog.org/download/cronolog-1.6.2.tar.gz
2.建立安装目录:mkdir -p /usr/local/cronolog
3.解压缩:tar zxvf cronolog-1.6.2.tar.gz
4.进入解压缩的目录:cd cronolog-1.6.2
5.编译,安装:
./configure –prefix=/usr/local/cronolog
make
make install
6.检查是否正确安装:
cd /usr/local/cronolog/sbin
./cronolog -V
如果显示:cronolog version 1.6.2,则表示已经安装成功了。
七、apache虚拟主机配置
1.建立配置文件:vim /etc/httpd/conf.d/hosts.conf
2.输入以下内容:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /var/www/www.fishnote.net
ServerName fishnote.net
ErrorLog logs/error_log
CustomLog “|/usr/local/cronolog/sbin/cronolog /var/log/httpd/www.fishnote.net-access.log.%Y%m%d” combined
</VirtualHost>
其中,每组<VirtualHost *:80></VirtualHost>就是一个网站配置,按照上面的设置,CustomLog是按照日期分割的:每天产生一个日志文件,文件名包含当天日期。
八、开启自定义.htaccess支持
默认情况下,apache已经开启Rewrite支持,我们还需要打开支持自定义.htaccess。
vim /etc/httpd/conf/httpd.conf
找到
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
将AllowOverride None修改为AllowOverride All
九.安装配置logwatch
1.安装:yum install logwatch
2.修改/usr/share/logwatch/default.conf/logwatch.conf
如果需要将报告发送到邮箱,把MailTo root中的root修改为email地址即可。
如果只需要特定服务的报告,先在Service = All前加#将其注释,然后,如果需要sshd报告,则在后面加上:Service = sshd
在/usr/share/logwatch/default.conf/services目录下可以查看logwatch支持的所有服务名称。
如果需要查看更详细的报告,可以修改Detail的值,High为最高。
3.运行logwatch –print,可以直接查看报告。
十、安装流量监控
为了便于观察每天的流量,可以选择安装流量监控。
1.安装vnsta
(1)下载:wget http://soft.vpser.net/status/vnstat/vnstat-1.9.tar.gz
(2)解压,进入目录
tar zxvf vnstat-1.9.tar.gz
cd vnstat-1.9
(3)编译,安装:
make
make install
2.安装vnstat PHP frontend
(1)下载:http://soft.vpser.net/status/vnstat/vnstat_php_frontend- 1.4.1.tar.gz
(2)解压文件夹改名为vnstat,然后上传到某个网站根目录下,这样就可以用http://www.yourdomain.com/vnstat访问
3.建立流量数据库:
(1)运行ifconfig,查看需要监控的网卡,如:venet0
(2)生成数据库:
/usr/bin/vnstat -u -i venet0
(3)设置定时更新数据库,通过cron的方式:
vim /etc/cron.d/vnstat
输入以下内容,每5分钟分析一次:
0-55/5 * * * * root vnstat -u -i venet0
0-55/5 * * * * root vnstat –dumpdb -i venet0 >/var/lib/vnstat/vnstat_dump_venet0
(4)修改vnstat中的config.php相关内容
$iface_list = array(‘venet0′);
$iface_title['venet0'] = ‘Photon VPS’;
$vnstat_bin = ‘/usr/bin/vnstat’;
$data_dir = ‘/var/lib/vnstat/’;
至此,安装完成,可以通过http://www.yourdomain.com/vnstat访问。
陈冠中《盛世:中国2013》各版本下载
二 4th
首先感谢豆瓣上的luan、公卯虚与毛姆舅舅同学,特别是luan同学提供手工输入的原始版本。
txt版本:https://dl.dropbox.com/u/3608812/2013.rar
doc版本:https://dl.dropbox.com/u/3608812/2013.doc
pdf版本:https://dl.dropbox.com/u/3608812/2013.pdf
全部3版本打包:https://dl.dropbox.com/u/3608812/2013_all.rar
《2013》豆瓣页 https://www.douban.com/subject/4112874/
更要感谢陈冠中老师,以下是他亲自校对的简体中文doc和pdf原版:
doc版本:https://dl.dropbox.com/u/3608812/sheng%20shi%202013%20CN.doc
pdf版本:https://dl.dropbox.com/u/3608812/sheng%20shi%202013%20CN.pdf
转txt版本:https://dl.dropbox.com/u/3608812/sheng%20shi%202013%20CN.rar
3版本打包:https://dl.dropbox.com/u/3608812/2013-pdf-word-txt.rar
Google发表声明,考虑退出中国大陆业务
一 13th
2010年1月12日,google在其官方blog发表了一篇文章,表示可能退出中国大陆业务.由于google的博客服务商blogspot早已被GFW屏蔽,因此国内访客无法查看原文,因此将其原文转载如下:
A new approach to China
Like many other well-known organizations, we face cyber attacks of varying degrees on a regular basis. In mid-December, we detected a highly sophisticated and targeted attack on our corporate infrastructure originating from China that resulted in the theft of intellectual property from Google. However, it soon became clear that what at first appeared to be solely a security incident–albeit a significant one–was something quite different.
First, this attack was not just on Google. As part of our investigation we have discovered that at least twenty other large companies from a wide range of businesses–including the Internet, finance, technology, media and chemical sectors–have been similarly targeted. We are currently in the process of notifying those companies, and we are also working with the relevant U.S. authorities.
Second, we have evidence to suggest that a primary goal of the attackers was accessing the Gmail accounts of Chinese human rights activists. Based on our investigation to date we believe their attack did not achieve that objective. Only two Gmail accounts appear to have been accessed, and that activity was limited to account information (such as the date the account was created) and subject line, rather than the content of emails themselves.
Third, as part of this investigation but independent of the attack on Google, we have discovered that the accounts of dozens of U.S.-, China- and Europe-based Gmail users who are advocates of human rights in China appear to have been routinely accessed by third parties. These accounts have not been accessed through any security breach at Google, but most likely via phishing scams or malware placed on the users’ computers.
We have already used information gained from this attack to make infrastructure and architectural improvements that enhance security for Google and for our users. In terms of individual users, we would advise people to deploy reputable anti-virus and anti-spyware programs on their computers, to install patches for their operating systems and to update their web browsers. Always be cautious when clicking on links appearing in instant messages and emails, or when asked to share personal information like passwords online. You can read more here about our cyber-security recommendations. People wanting to learn more about these kinds of attacks can read this U.S. government report (PDF), Nart Villeneuve’s blog and this presentation on the GhostNet spying incident.
We have taken the unusual step of sharing information about these attacks with a broad audience not just because of the security and human rights implications of what we have unearthed, but also because this information goes to the heart of a much bigger global debate about freedom of speech. In the last two decades, China’s economic reform programs and its citizens’ entrepreneurial flair have lifted hundreds of millions of Chinese people out of poverty. Indeed, this great nation is at the heart of much economic progress and development in the world today.
We launched Google.cn in January 2006 in the belief that the benefits of increased access to information for people in China and a more open Internet outweighed our discomfort in agreeing to censor some results. At the time we made clear that “we will carefully monitor conditions in China, including new laws and other restrictions on our services. If we determine that we are unable to achieve the objectives outlined we will not hesitate to reconsider our approach to China.”
These attacks and the surveillance they have uncovered–combined with the attempts over the past year to further limit free speech on the web–have led us to conclude that we should review the feasibility of our business operations in China. We have decided we are no longer willing to continue censoring our results on Google.cn, and so over the next few weeks we will be discussing with the Chinese government the basis on which we could operate an unfiltered search engine within the law, if at all. We recognize that this may well mean having to shut down Google.cn, and potentially our offices in China.
The decision to review our business operations in China has been incredibly hard, and we know that it will have potentially far-reaching consequences. We want to make clear that this move was driven by our executives in the United States, without the knowledge or involvement of our employees in China who have worked incredibly hard to make Google.cn the success it is today. We are committed to working responsibly to resolve the very difficult issues raised.
附中文翻译(转至163):
标题:中国新路径
内文:
与其他很多著名组织一样,我们经常会碰到各种各样的网络攻击。去年12月中旬,我们检测到一次来自中国的,对我们集团网络设备高度精密和有针对性的网络攻击,在此次攻击中,谷歌公司的知识产权遭到窃取。我们很快就查清这并非只是一场单纯的安全事件。
首先,此次攻击并非仅仅针对谷歌。我们在调查中发现,至少有其他20家大型公司也成为了类似的攻击目标,这些公司所在的行业分布广泛—包括互联网、金融、科技、媒体和化工行业。我们目前正在通知这些公司,并与美国有关部门携手展开调查。
第二,我们有证据表明攻击者的主要目标是入侵中国人权活动者的Gmail邮箱账户。根据我们掌握的调查数据,我们确信他们的攻击还未能达此目的。只 有两个Gmail账户有被侵入过的迹象,而入侵者的活动范围也仅限于账户信息(如账户创建时的数据)和邮件主题,而不是邮件内容。
第三,我们在对谷歌案件的调查中发现,有很多拥护人权活动,注册地在美国、中国和欧洲的Gmail邮箱账户似乎经常受到第三方侵入。入侵者并非是通过Google的安全漏洞进行攻击,而极有可能是通过在用户的电脑内植入钓鱼网页或是恶意软件来达到目的。
我们已经利用从这次攻击中所获取的资料,改善基础设施及架构,提高谷歌及我们用户的安全。从个人用户来说,我们我们建议他们在自己的电脑上安装信誉 好的反病毒和反间谍软件程序,给他们的操作系统安装补丁,并更新所使用的网络浏览器。在点击即时信息和电子邮件的链接时,或要求在线提供个人密码等个人资 料时,要保持警惕。在这里,你能够阅读到更多我们所提出的关于电子安全方面的建议。如果希望获得更多关于这种类型攻击情况,请阅读美国政府的这份报告 (PDF)。
我们已采取了非同寻常的措施来分享这些攻击信息,这不仅仅是因为我们已发现的信息涉及到网络安全和人权问题,也是因为这些信息已成为一场范围更为广 泛的对于言论自由的全球辩论的焦点。在过去的二十年里,中国的经济改革计划以及中国公民的企业经营才能已帮助上亿中国人摆脱了贫困。毫无疑问,这个伟大的 国家将在今天的世界里取得更为巨大的经济进步和发展。
2006年1月,虽然我们对一些搜索结果将受到审查而感到不适,但为了加强与中国用户的联系以及建立一个更为开放的互联网环境,我们还是发布了 Google.cn。从发布之日起我们就有着明确的运营思路—我们将仔细审视中国的运营环境,包括新法律的发布以及对我们所服务领域的其他规定。如果 我们认为我们无法取得既定目标,我们将毫不犹豫的重新考虑我们在中国的发展策略。
这些未经报道的攻击和监视,以及过去几年来政府试图进一步限制互联网上的言论自由已使我们得出结论,我们应重新审视我们在中国的业务运营。我们已决 定我们将不再继续审查Google.cn上的搜索结果,且如有可能的话,未来几周内我们将与中国政府就我们是否可以依法运营一个未经过滤的搜索引擎展开讨 论。我们认识到这可能意味着我们不得不关闭Google.cn,并有可能关闭我们设在中国的办公部门。
审查我们在中国的业务运营一直非常困难,我们知道这将可能导致深远的后果。我们希望解释的是,此举是由我们美国管理层推动,与我们中国雇员无关,正是由于他们的卖力工作才使得Google.cn取得今天的成功。我们愿意负责任地解决所发生的这一相当困难的问题。
发布者:高级副总裁、企业发展及首席法律官大卫·德鲁蒙德(David Drummond)

