中国谷歌开发者社区论坛上线

以后终于不用翻山越岭出去了,这样更方便开发者的交流。以下随附Bill Luan致广州GTUG的信:
............................................
广州谷歌开发者社区的各位朋友们:大家好!

自从我们的社区成立以来,这个像全球其它社区一样的基于Google Groups的官方的社区论坛,由于受到防火墙的屏蔽影响,绝大多数时间都无法进行正常的访问,严重影响了我们社区成员之间的互相交流。全国各地的各个谷歌开发者社区,一直以来也没有一个可以供大家方便使用的在线交流平台,让我们全国各地的开发者们,能够就共同感兴趣的话题进行交流、互相学习和互相帮助,无法充分发挥我们全国谷歌开发者社区所具备的有大量开发人才的优势。 目前我们全国各地的谷歌开发者社区,已经发展壮大到了包括香港在内的11个城市、近万人的一个巨大的社区,而且我们还会继续发展壮大。我们这么一个巨大的社区大家庭,有这么多具有共同爱好的技术专家和人才,到目前为止却一直无法发挥我们人多势众的优势,通过交流来帮助我们自己的学习和成长,实在是一件十分可惜的事情。

今天,我谨在此宣布,我们将为大家彻底解决这一互相交流的瓶颈和困境:一个新建立的、在防火墙内运行的、面向全中国谷歌开发者社区的在线交流论坛,现在正式上线运行了! 论坛是:中国谷歌开发者社区论坛,地址是非常好记的域名:www.ChinaGDG.com

全国各地的所有GDG社区的成员们,大家可以不用"翻墙"、随时可以方便地登陆这个新的全国论坛,通过自由的讨论、交流、和分享,帮助我们自己更好地学习各种谷歌开发技术、以及你们所感兴趣的各种开放型互联网开发技术、移动开发技术、以及各种开源技术等等。 除了和来自全国各地的开发者讨论你所感兴趣的技术话题之外,你们也可以在你们自己城市的GDG社区的专门分论坛里,讨论你们GDG社区自己所关心的问题,组织你们自己的活动等等。

热烈欢迎我们这里的每一位成员和朋友,来加入我们新的中国谷歌开发者社区论坛,和大家一起来享受在我们这个全国大家庭里一起学习和成长的快乐!

谷歌 开发技术推广部 大中华区主管 栾跃

Google的Blog服务开始支持SSL访问

对于大陆用户来说,Google Blogger支持Https绝对是个好消息,现在,我们可以直接通过Https的方式来访问Google Blogger写日志了,不过只能写而已,要想看的话,blogspot.com还是无法直接访问。

说实话,Google Blogger早就应该支持HTTPS了,连Google图片搜索都能支持Https,Blogger就更应该支持了,因为很多Blog写的其实是个人的隐私,否则,在一个危险的网络访问Blogger,就有可能会泄漏个人隐私。

在Blogger支持Https之前,大陆用户写日志要使用特殊手段,或者通过邮件的方式发布,很麻烦,现在,用户就可以直接登录网站来发布文章了。

自从微软关闭Windows Live Spaces之后,Google Blogger和Wordpress.com就成为仅剩下的两个主要的BSP提供商,总的来看,Blogger的稳定性相比Wordpress更胜一筹,此外,Google Blogger还支持免费域名绑定,用户可以使用自己的域名,而Wordpress.com的域名绑定就需要每年10美元的费用。

解密喷射字符,教你DIY自己的喷射符

关于这个符号。。。。估计大家也没少见,第一次见的可能也猛一下不知所以然。其实我也是今天才后知后觉地注意到这个东西,然后就顺便把它解剖了。另外考虑到最初试图用各种关键字组合向谷歌度娘求教都未果,所以把个人研究过程和成果码出来供大家交流学习。

(注:文中为防止涉及编码被浏览器自动转换为符号,全部采用了全角字符,自行实验时需要用半角。) 继续阅读

使用密钥自动登录ssh

比对 SSH 主机公钥是否与本机获取的一致,避免中间人攻击

ssh-keygen -l -E md5 -f /etc/ssh/ssh_host_rsa_key

编辑 ssh 配置文档

sudo vi /etc/ssh/sshd_config

Protocol 2 ← 这行表示仅使用SSH2
ServerKeyBits 768 ← 如果需要可以改成 1024 ,而 puttygen.exe 默认是1024 bit
PermitRootLogin no ← 这行表示不允许用root进行登录
PermitEmptyPasswords no ← 这行表示禁止空密码进行登录
PasswordAuthentication no ← 添加这行表示不允许密码方式的登录增加安全性,按需设置

#设置完成不要忘了 check 配置文件,使用 /usr/sbin/sshd -t 也可以

sshd -t

重启 SSH 服务前建议多保留一个会话以防不测

service sshd restart

sudo vi /etc/hosts.deny
sshd: ALL ← 添加这一行,屏蔽来自所有的SSH连接请求
sudo vi /etc/hosts.allow
sshd: 192.168.0. ← 添加这一行,只允许来自内网的SSH连接请求

下面生成公钥和私钥,在普通用户下:
ssh-keygen -t rsa ← 建立公钥与私钥
Enter file in which to save the key (/home/comet/.ssh/id_rsa): ← 钥匙的文件名,这里保持默认直接回车
Enter passphrase (empty for no passphrase): ← 输入私钥密码
Enter same passphrase again: ← 再次私钥输入密码
Your identification has been saved in /home/comet/.ssh/id_rsa ← 私钥的路径
Your public key has been saved in /home/comet/.ssh/id_rsa.pub ← 公钥的路径
cd ~/.ssh ← 进入 /home/comet/.ssh
cp id_rsa.pub authorized_keys ← 复制公钥为验证文件
chmod 400 authorized_keys ← 设置验证文件为 root 只读
复制 id_rsa 到 windows 的机器上。
使用 PUTTYGEN.EXE 转换成 putty 可以使用的。
打开 PUTTYGEN.EXE ,点击 Load,选取服务器端生成的私钥,如果上面设置了私钥密码,这里就会提示输入。修改一下 key comment,如果需要密码,可以在 key passphrase 输入并确认。
点击“Save private key”,保存为 .ppk 文件,这里是 uServer.ppk
在 putty 中使用转换后的私钥登录。
打开 putty.exe ,设置好IP,然后在 Connection - SSH - Auth 的 Private key file for authentication 中选择 uServer.ppk 。然后 open 就可以使用密钥登录而不用密码了。
如果在生成 uServer.ppk 的时候没有输入密码,那么可以在 putty.exe 的 Connection - Data 的 Auto-login username 中输入私钥的用户,那么打开 session 之后就可以自动。

参考链接
设置 SSH 通过密钥登录
SSH远程登录配置文件sshd_config详解

How to enable IPv6 on Vista & Win7

Windows Vista and Windows 7 both come equipped with dual stack IPv4/IPv6, and it can be enabled on Windows XP/SP2. On a default installation of Vista/Win7, IPv6 should already be operational. In order to fully test your IPv6 readiness, you will also need the services of a Tunnel Broker. A Tunnel Broker is a server that sits on both an IPv6 network and an IPv4 network. IPv6 packets are encapsulated inside an IPv4 packet and sent out over the IPv4 network. The server strips the IPv4 info and sends the packet on to the IPv6 server. Return packets follow the reverse route.

Vista/Win7 come equipped with the Teredo Tunnel, but it is not functional by default. To get all these working, the following services must be running:
IP Helper – Automatic Started
Windows Firewall – Automatic Started
Base Filtering Engine – Manual Started
Don’t ask me why the Firewall has to run, but Microsoft says that the Teredo Tunnel is a security risk. To the best of my knowledge, the Teredo Tunnel is the only one that will work behind a NAT router that does not support IPv6. It uses a technique similar to PPP networks, with a specific UDP port being used to maintain contact.

One of the major differences with IPv6 is that there can be multiple IP addresses. Since there is no longer a Netmask to determine if an address is on the local network, or if it has to be routed through a gateway, they have introduced something called a link-local address. If you go to the command prompt and enter the “ipconfig /all” command, you should see an address beginning with “fe80::” and ending with “%x” under the Local Area Connection. The “%x” is a random ID number assigned to the interface, and will be necessary to use at times (more on that later).

If the system only has a link-local and a Teredo tunnel IP address, the DNS will not return an IPv6 address. To overcome this limitation, we have to fool the system by adding another IPv6 address. If you are fortunate enough to have a router that supports IPv6 DHCP, one will already have been assigned to you. If not, you must manually enter it. Go to the Properties of your LAN or WiFi interface, and change it to have a static IPv6 address. The easiest solution is to use the converted IPv4 address with a netmask of 48. For example, a static IPv4 address of “192.168.1.2” converts to “2002:c0a8:102::” (192 = c0h, 168 = a8h, 1 = 01h, 2 = 02h). Don’t configure a default gateway for this address, because there isn’t one. You will also need to configure IPv6 DNS servers. You can use any that you might have access to. Both OpenDNS and Google offer free public servers:
OpenDNS: 2620:0:ccc::2 & 2620:0:ccd::2
Google: 2001:4860:4860::8888 & 2001:4860:4860::8844
I personally use one of each.

Windows will now resolve IPv6 domain names. The simplest way to test this is to ping your own computer name (find under System in the Control Panel), or another computer name on your local network that supports IPv6. It should resolve the link-local address and complete the ping. For example:
C:\>ping donna2-pc
Pinging Donna2-PC [fe80::8d22:1710:b68c:37d9%9] from fe80::a5bb:d4f:e017:e25c%9 with 32 bytes of data:
Reply from fe80::8d22:1710:b68c:37d9%9: time<1ms
Reply from fe80::8d22:1710:b68c:37d9%9: time<1ms
Reply from fe80::8d22:1710:b68c:37d9%9: time<1ms
Reply from fe80::8d22:1710:b68c:37d9%9: time<1ms
Ping statistics for fe80::8d22:1710:b68c:37d9%9:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
On one machine I had difficulty getting the ping command to use the correct interface. It wanted to use the Teredo link-local address instead of the ethernet adapter link-local address. I solved the problem by disabling the other Microsoft interface via the registry. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\DisabledComponents
This key probably won’t exist and must be added as a REG_DWORD. The value is a bit map:
· Bit 0 Set to 1 to disable all IPv6 tunnel interfaces, including ISATAP, 6to4, and Teredo tunnels.
· Bit 1 Set to 1 to disable all 6to4-based interfaces.
· Bit 2 Set to 1 to disable all ISATAP-based interfaces.
· Bit 3 Set to 1 to disable all Teredo-based interfaces.
· Bit 4 Set to 1 to disable IPv6 over all non-tunnel interfaces, including LAN interfaces and *Point-to-Point Protocol (PPP)-based interfaces.
· Bit 5 Set to 1 to modify the default prefix policy table to prefer IPv4 to IPv6 when attempting connections.
To disable the ISATAP interface, I changed the value to 4 (bit 2).

At this point, we need to expose you to a command that has always been there, but wasn’t really used much with IPv4.
C:\>netsh int ipv6 show teredo
Teredo Parameters
---------------------------------------------
Type : client
Server Name : teredo.ipv6.microsoft.com.
Client Refresh Interval : 30 seconds
Client Port : unspecified
State : dormant
Client Type : teredo host-specific relay
Network : managed
NAT : none (global connectivity)
“Int” is short for “interface”. If the state shows as “offline”, you may have to force Teredo into accepting your NAT router. This is done using the following command:
C:\>netsh int ipv6 set teredo type=enterpriseclient
Ok.
If Teredo is now functional, then you should be able to find the interface index using the “ipconfig /all” command:
Tunnel adapter Local Area Connection* 6:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
Physical Address. . . . . . . . . : 02-00-54-55-4E-01
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
IPv6 Address. . . . . . . . . . . : 2001:0:4137:9e76:142b:a209:30f9:a279(Preferred)
Link-local IPv6 Address . . . . . : fe80::142b:a209:30f9:a279%8(Preferred)
Default Gateway . . . . . . . . . : ::
NetBIOS over Tcpip. . . . . . . . : Disabled
In the example above, the interface index is %8 for the Teredo interface. We need this number for the next command, since there is no default route to allow traffic to flow to the Internet.
C:\>netsh int ipv6 add route ::/0 interface=8
Ok.
With this last step you should now be able to access IPv6 sites such as:
C:\>ping ipv6.google.com
Pinging ipv6.l.google.com [2001:4860:b006::69] from 2001:0:4137:9e76:249b:92d7:b464:60e9 with 32 bytes of data:
Reply from 2001:4860:b006::69: time=31ms
Reply from 2001:4860:b006::69: time=31ms
Reply from 2001:4860:b006::69: time=31ms
Reply from 2001:4860:b006::69: time=31ms
Ping statistics for 2001:4860:b006::69:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 31ms, Maximum = 31ms, Average = 31ms
It may take more than one attempt to activate the interface. Then try entering http://ipv6.google.com into your browser, and it should bring up Google’s IPv6 page.

Be aware that at this point in time, Windows will always prefer IPv4 over IPv6 if both exist for a given domain. We can change that behaviour by modifying the prefixpolicies table:
C:\>netsh int ipv6 show pre
Querying active state...
Precedence Label Prefix
---------- ----- --------------------------------
50 0 ::1/128
40 1 ::/0
30 2 2002::/16
20 3 ::/96
10 4 ::ffff:0:0/96
5 5 2001::/32
But I will leave that for you to investigate on your own.