See the series photo of Blue grotto and Get your own Slide show

| 0 评论

 

Picasa Web AlbumsFullscreen

 

想要这个效果? follow me

  1. Open the album you want to display in Picasa Web Album.
  2. Right-click on the button and "Copy shortcut" (?).
    or just open Slideshow, and copy the address of the page.
    e.g. http://picasaweb.google.com/zcambridge/MaltaBlueGrotto#slideshow
  3. Replace http://picasaweb.google.com/zcambridge/MaltaBlueGrotto#slideshow by your copied address in the code below:

  4. Now you can embedded your code in your blog anywhere you want.

There is a more convinent website doing this , but I don't want the advertisment on it. Thus my version is posted here. haha .

enjoy!!

[+/-] Read More...

linux下vnc终于设置好了,总结

| 0 评论

搜集网上资料,整理适合自己情况,主要是为了远程等服务器跑cadence。

 

1. 检查vnc客户端和服务器是否已经安装在你的系统中:
[user@centos ~]$ rpm -q vnc vnc-server
package vnc is not installed
vnc-server-4.0-11

 

2、设置登陆到Gnome/KDE桌面
a.
[root@ics-pc ~]# cat /etc/sysconfig/vncservers
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the line below to start a VNC server on display :1
# as my 'myusername' (adjust this to your own).  You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that. 
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted!  For a secure way of using VNC, see
# <URL:http://www.uk.research.att.com/vnc/sshvnc.html>.
VNCSERVERS="1:username"
VNCSERVERARGS[1]="-geometry 800x600 -alwaysshared -depth 24"
 
注:
1. 红色部分就是被修改或增加的部分
2. -alwaysshared代表允许多用户同时登录 -depth代为色深,参数有8,16,24,32。
3. 我试验了,要想跑cadence用24没问题。 因为cadence只支持8或24.
b.
[root@ics-pc ~]# vi /root/.vnc/xstartup
#!/bin/sh
# Uncomment the following two lines for normal desktop:
 unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session & #set starting GNOME desktop
#startkde & #kde desktop
#twm & #Text interface
注:
1. 红色部分就是被修改或增加的部分
2. 普通用户的xstartup在~/.vnc/xstartup.
3. 想用什么样的桌面就怎么配,最后3行里选一个就行。

c.

重启VNC即可。

3、VNC的启动/停止/重启
$ service vncserver start/stop/restart
关闭具体的vncserver命令:
$ vncserver -kill :1
$ vncserver -kill :2
4、设置密码
# vncpasswd
$ vncpasswd
 

5、客户端登陆

  • 用vnc客户端(viewer)登陆:
服务器地址可以是:IP或域名
端口通过以下两种办法查:
# netstat -tlnp |grep vnc
启动服务的时候也会出现如下红色

[centospub@localhost ~]$ vncserver

New 'localhost.localdomain:7 (centospub)' desktop is localhost.localdomain:7

Starting applications specified in /home/centospub/.vnc/xstartup
Log file is /home/centospub/.vnc/localhost.localdomain:7.log

 
这个例子里是7,则用: IP或域名:7  登陆。
 
  • 用浏览器登陆:
服务器地址: 一样
端口:要加个5800到原来的端口上
同样的例子: 用: IP或域名:5807  登陆。
 
6. 其他技巧:

设置vncserver启动变量:
为了使vncserver在每次启动时保持不变的端口号(5801或1)
在/etc/rc.d/rc.local文件中添加命令:
rm -f /tmp/.X11-unix/X*
rm -f /.vnc/*.pid
rm -f /.vnc/*.log
这样,每次启机,系统会先把上次非正常关机时留下的临时文件删除。

附注:

[原创]vnc远程连接linux服务器显示问题

2007-10-12 15:40

今天在服务器上装了 ic5141,配置好环境变量后运行提示:
*ERROR* Failed to find either 24-bit TrueColor or 8-bit PseudoColor Visual .
*WARNING* Failed to find eiher 24-bit TrueColor or 8-bit PseudoColor Visual.


在vnc上设置显示模式示果
之后更改vnc设置文件(/usr/bin/vncserver)中depth参数,

由$depth = 16;改为$depth=24;
运行后正常。

我自己用的并未成功。直到用了文章中2-a的设置才可以跑cadence。

 

Useful Links:

庖丁解牛lagvin 写得心得

这个里边有很多技巧问答。

[+/-] Read More...

Using screen for remote interaction (ZZ)

| 0 评论

Using screen for remote interaction

By Phil Hollenback on August 22, 2006 (8:00:00 AM)

Recently I needed to do some distance education; one of my coworkers wanted me to show him how to do software builds on Linux. The only problem was that I'm on the East Coast and he is on the West. How could I show him the build and install process? After considering some alternatives, we found our solution in GNU Screen.



I considered using the standard Unix utility script to save a log of my typing. script has several problems, not the least of which is the horrible resulting output (script saves everything, including carriage returns and corrections). In addition, this would be completely non-interactive. If my coworker had a question or needed a clarification, we would have to correspond via email afterward. That would be a frustrating experience for both of us.

Another possible solution would be to use VNC. My coworker could connect to my display, and we could alternate control of the mouse and keyboard. That approach seemed like overkill, since what I wanted to demonstrate was purely command-line work. It would also be difficult to generate a log of a VNC session. Finally, technical limitations dictated that the only way he could connect to my machine for the demonstration was over a simple SSH connection, so this dictated a purely command-line solution.

Screen is one of those tools that is hard to explain but pure genius once you see it in operation. The description from its official Web site doesn't help much:

Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells.

Basically, screen allows you to create virtual terminals which are not connected to your actual xterms or console screens. You can then disconnect from a screen session and reconnect from somewhere else while preserving your shell or other running processes. For an introduction to screen, check out this Linux.com article.

This is just the beginning of screen's power and flexibility. You can connect to a session more than once using the -x argument to screen. That means you can for example leave your mail program running in a terminal (under screen) at work and then connect from home to read your mail in the same process. There's no need to disconnect at work, and when you come back in the next morning your mailer will be exactly as you left it, with all your state perfectly preserved.

Screen takes this feature, which is called multi-display mode, to the next level with multi-user mode. In multi-user mode more than one user can access and control a screen session. The problem with this mode is that it's not obvious how to set it up. Here's what I ultimately figured out with the help of some Google searching:

  1. Set the screen binary (/usr/bin/screen) setuid root. By default, screen is installed with the setuid bit turned off, as this is a potential security hole.

  2. The teacher starts screen in a local xterm, for example via screen -S SessionName. The -S switch gives the session a name, which makes multiple screen sessions easier to manage.

  3. The student uses SSH to connect to the teacher's computer.

  4. The teacher then has to allow multiuser access in the screen session via the command Ctrl-a :multiuser on (all screen commands start with the screen escape sequence, Ctrl-a).

  5. Next the teacher grants permission to the student user to access the screen session with Ctrl-a :acladd student where student is the student login ID.

  6. The student can now connect to the teacher's screen session. The syntax to connect to another user's screen session is screen -x username/session.

At this point the teacher and student both have control of the session. Note that there are security implications to this -- the student is operating the session as the teacher and could potentially do something to damage the system. If you don't trust your students then you should probably use a special teacher account and not your normal login account. The teacher can also make the student's session read-only. To do this, use the aclchg screen command to remove write access for the student: Ctrl-a :aclchg student -w "#". The student can then only observe the teacher's actions. Otherwise, the teacher will have to let the student work on the honor system.

While my example centers on one teacher and one student, many users could attach to one session. There could even be multiple teachers and students.

What about communication between teacher and student? Well, we used a telephone, but you could use instant messaging, IRC, or VoIP for asking questions. There is also an message feature in multiuser screen: Ctrl-a :wall message will write a message to all users connected to a screen session. One problem with this is that it uses the terminal status line. In an xterm this is the window titlebar area, which, depending on your window manager, may not be very obvious.

The final ingredient for using screen as a teaching tool is logging. With a log of all the terminal output, my coworker and I would have an exact transcript of what we did in case there were any questions later. As I mentioned earlier, the standard Unix tool script is the obvious answer, but it is a very limited tool and does not produce very readable output. You also can't turn it on and off inside a session if for example you want to run a full-screen tool such as a text editor.

Fortunately screen comes with a comprehensive logging facility that is much more sophisticated than what script can do. Screen's logging can be turned on or off at any time with Ctrl-a H, or you can use the -L switch when starting screen to enable it by default. The log file is written to the current directory under the name screenlog.n, where n is incremented by one for each new log.

The logfile will contain the output of your session with corrections and cursor movements already evaluated and applied. One caveat is that programs that send control sequences to the screen will still confuse the output. One example of this is GNU ls, which by default colorizes output. You should turn this off in your session by using something like the following bash alias:

 alias ls='ls --color=none'  

With that, all the pieces are in place: multiple users can share a screen session for any sort of command-line-based instruction. The teacher can at any time take control of the session by switching all other users to read-only access. Finally, you can turn on the logging facilities in screen to get an accurate and usable log of the entire session (or just portions of the session if you desire).

I found screen to work extremely well for this purpose, and my coworker was also pleased with the results. Some of the options and controls in screen can be hard to figure out because screen is so powerful and flexible. But I plan to use this tool in the future, and I encourage anyone in a similar situation to try it.

[+/-] Read More...

今天日全食

| 0 评论

可惜的是我起床晚了。在瑞典错过了,偏食观看时间。不过现在国内还没开始。希望老爸老妈在西安能看到,接近的全食。。。

2008年8月1日日全食食带图

[+/-] Read More...

symbian S60 3rd 简单破解 的确很简单

| 0 评论

第一步:XX手机:

我已经找不到出处了,但是至少在这里保留完整的引用:

最简单的破解手机19权限教程

前段时间,想装个最高权限的A4输入法,可其它的破解却试了多少次都不行,今天却让我发现一个最简单的手机破解方法,拿来与大家分享!现在可以安装那些高权限的软件了.从此XX你手机权限,全由手机来搞定!不再用电脑来破解或者刷机来担当风险了,手机就能解决!

如下:  解压文件后(下面附件里包括FP1《应该是二版机的吧,我没试过》和PreFP1型,按自己机型选择,我的N73是用PreFP1)把文件夹放在卡上,手机上安装X-plore管理器。步骤:打开X-plore管理器:选择-菜单-工具-设置,把显示隐藏文件、显示ROM磁盘、显示RAM磁盘、显示系统文件/文件夹后面的框框打上勾返回。然后再通过X-plore管理器把卡里面的HelloCarbide.sisx、CapsOff.sisx、CapsOn.sisx三个文件都安装文件装好在卡上,不要退出X-plore管理器!再在应用软件里运行刚才安装好HelloCarbide那个文件,进入-选项-选Menu1,后一路按Yes。再回到X-plore管理器看看,是不是sys和private文件夹都能进入了!再通过X-plore管理器把CProfDriver_SISX.ldd 与 installserver.exe复制到 C:\sys\bin\ 里面即可!退出重启手机!再进入手机安装没有签名的软件,是不是什么软件都能安装了! 现在还要用PC端来破解吗!全由手机来控制了.哈哈哈........记住:CapsOff是开启破解,CapsOn是关闭破解!

里边有几点注意:

  1. FP1,preFP1机型:

    非FP1机型:3250,E60,E70,N80,N92,N91(8G),E61,N71,5500,N93,N73,E50,N75,E61i,E62,N93i,E65
    FP1机型:N77,6290,N76,N95(8G),5700,6110N,6120c,E51,N81,N82,E90

  2. 用x-plore复制文件:
    选menu(目录选项)->edit(编辑)->copy(复制), 用右方向键进入想要进入文件夹而不是用OK建。
    然后menu(目录选项)->file(文件)->select(选择),搞定!!

的确又简单,又强大。

第二步:自己的根证书

但是我想用自己的根证书。怎么办。按照教程:

【OPDA独家首发】纯文字版的根证书制作傻瓜教程,看了就会!(12点有修改更新)

首先要感谢Ttuukk的教程,让我们都用上了自己的根证书,也许还有一部分朋友还没成功,但是相信你在看了这个教程后一定就能成功了。不要怀疑我,因为你不能怀疑自己的智商!
  这个教程就是在Ttuukk那个教程的基础上做的,相当的傻瓜化,以至于有点罗嗦,希望内行的朋友不要笑话我!因为我在一开始准备制作的时候连命令提示符都不知道怎么用,写得这么烦琐也是考虑到让和我一样没有基础的人能够看懂!再就是不希望更多的朋友和我一样在制作根证书上浪费太多的光阴。毕竟时间就是金钱!
  下面开始!
  安装OpenSSL后,先解压openssl.cnf.zip替换X:\OpenSSL\bin\openssl.cnf文件(X为盘符),然后打开命令提示符(可以通过Win+R后输入cmd来开启,也可以通过开始菜单-所有程序-附件-命令提示符来开启)。
  先定位到OpenSSL的安装目录,在命令提示符中输入:cd x:\openssl\bin(X为盘符)
  然后执行3个命令。
  第一个命令生成密匙对:
  openssl genrsa 2048 >selfsigned.key
  第二个命令是给自己颁发安全证书:
  openssl req -new -x509 -nodes -sha1 -days 3650 -key selfsigned.key >selfsigned.cer
  第二个命令完成后会依次要求输入:
  Country Name <2 letter code> [CN]:
  Organization Name <rg, company> []:
  Common Name <eg, YOUR name> []:
  Email Address []:
  其中Common Name我建议最好是输入8个字符(后面再说),Country Name和Organization Name也尽量简单的输入2-3个字符就够了。Email Address直接回车掉。(防止超过字节数,后面会说到)   不想填的地方直接输入" . "(去掉“ ”) ,回车,会比直接回车好,至于为什么,大家自己试试吧。
  第三个命令是生成DER格式文件:
  openssl x509 -in selfsigned.cer -outform DER -out selfsigned.der
  之所以在第二个命令时省去Email Address的输入并要求Country Name和Organization Name简单,是因为生成的der文件大小不能超过912字节数,所以当你生成der文件后可以马上通过十六进制编辑器打开生成的der文件selfsigned.der查看字节数是否超过规定大小。如果超过了则重新来一次,避免后面的麻烦!(PS:切记是der后缀的文件而不是cer后缀的文件。)
  确认无误后将selfsigned.der复制到你的手机上,然后用手机自带的文件管理器运行selfsigned.der,根据提示安装根证书,记住导入时的"栏目",并选择信任区域为"互联网"。导入完成后用文件管理器搜索文件CACerts.dat并将它复制到其他地方然后再复制到电脑上。
  这里又要说几点:
  第一,导入证书用手机自带的管理器,因为个别机型用第三方管理器无法安装证书(至少我用的N73不行)。
  第二,搜索CACerts.dat文件则用第三方管理器来搜索,或是直接到C:\PRIVATE\101f72a6下去复制。(我N73无法用自带的管理器搜索到CACerts.dat这个文件)
  第三,这里的"栏目"名就是之前我建议你在输入Common Name所输入的,所以并不用刻意去记,而且这个栏目名在后面还有用。
  现在,你可以删除你刚导入的证书了,工具-设置-安全性设置-证书管理。删除后你之前复制的CACerts.dat文件还是会在C:\PRIVATE\101f72a6下,但是删除前和删除后CACerts.dat文件的大小会产生变化,所以这里一定要按步骤来,我也不知道会不会有影响,但是只要按步骤来就一定不会错。
  在电脑上用十六进制编辑器打开CACerts.dat,搜索导入证书时的"栏目"名,一直搜索到最后一个,然后你就能看到这样的数值了:
  XX 00 00 00 00 52 XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
  XX表示任意数值。
  在这里出问题的最多了,我就在这里花了不少时间,Ttuukk的教程上要你记录52后的20组数值,也就是所谓的散列值。但是我建议把这总共26组数值都记下来。后面就会用到的。
  再用十六进制文件编辑器另打开swicertstore.dat文件,直接定位到文件尾部,在这里你能看到字串符:SymbianA,SymbianB等,代表栏目为SymbianA的证书,以此类推。
  我们要做的就是替换SymbianA这个栏目。
  首先,直接修改SymbianA这8个字串符,不要超过它的长度,为了能够达到统一,所以我一开始就建议你把栏目名设置成了8个字符。
  然后,在你所改的栏目名后面会有这样的数值:
  00 00 00 00 00 52 XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
  我们将之前记下来的散列值来覆盖它。
  看清楚了,之前的和现在的区别就是第一组数值,它不是XX而是00,千万要记得把它改成XX。
  接下来,替换根证书,由于栏目"SymbianA"是地一个出现的栏目,所以对应第一个根证书存储。
  der证书格式是以30 82 03 XX 30 82开头的,所以我们回到顶步找到第一个出现30 82 03 XX 30 82的位置和第二个出现30 82 03 XX 30 82的位置。将它们之间的内容(包括第一个30 82 03 XX 30 82,不包括第二个30 82 03 XX 30 82)选中,查看大小,der文件对应的大小为这里所查看的大好多小-2字节。(PS:我做了次都是914字节,也就是der文件不能超过912字节,这也就是我为什么在一开始就说明了cer文件中的字节大小不能超过912的原因)
  再用十六进制编辑器打开selfsigned.der,将其全部字节复制,然后覆盖上一步我们选来查看大小的那部分。这里一定要弄对了,只要你的selfsigned.der文件字节不超过912字节那就拿去覆盖那914字节的内容。
  OK了,根证书的制作就到这里了,另存文件为你喜欢的名字然后保存到哪里也不用我说了,还有什么存为只读,XX了权限的朋友都知道的。
  当证书制作成功的时候我明白了,其实并不是Ttuukk的教程写得太简洁,而是我在这方面根本就是个白痴所以无法理解。
  我花了一天一夜时间才能把证书做出来就错在散列值的替换,因为Ttuukk的教程上并没有说要替换XX 00 00 00 00 52中的XX,所以这里再强调一次。
  最后再次感谢Ttuukk为我们提供的方法!本来我也准备做个傻瓜化的图片教程的,但是处于某些因素没做!不过这个纯文字版的傻瓜教程应该够用了。
  我不反对转贴,只是希望能够标明来自OPDA,来自Ttuukk的教程和本人的傻瓜化,呵呵!
  制作过程中所需要用到的东西我也传上来!

其实如果后边自己改dat文件的过程可以通过mstore.v01这个软件完成。感谢作者。。

添加修改工具mstore,只需要散列值就可以生成证书存储。 
ttuukktool

只要生成DER文件后,运行并提供散列值,就可以生成00000001,不需要编辑器修改了。

把生成的selfsigned.der拷贝到mstore.exe同一个文件夹,然后运行软件,输入正确的“散列值”就可以自动生成00000001.dat文件(就是这个是你的根证书喽)。

将00000001.dat保存在XX过得手机的 c:\resource\SwiCertstore\dat\ 里边。

到证书管理里查看有没有自己的证书?呵呵

“证书管理”在 设置--》手机--》常规--》安全设置 里边。

要想不让手机重启后证书失效,需要吧dat文件设成“只读”。

 

第三点:疑问

unsigned软件都给装上了 真纳闷。。??

文件自己找吧。我放个列表好了:

X-plore官方中文版v1.21

有FP1,preFP1两个版本的:

HelloCarbide.sisx

CapsOff.sisx

CapsOn.sisx

CProfDriver_SISX.ldd

installserver.exe

根证书部分:

Win32OpenSSL_Light-0_9_8g.rar

openssl_cnf.zip

swicertstore.dat 

mstore.v01.zip

[+/-] Read More...

手机爆米花 (续)

| 0 评论

前边我说过,手机爆米花及我的试验结果

经过同志们的反馈,各方网上搜寻,加上物理常识。总结一小下。。

说是假的也不对,不过她们肯定是cheat了。

 

大多数说手机爆米花是纯粹胡说:

以下是两个从百度知道上的引用。

引用1:
呵呵!那是蒙人的。里面有机关的.而且上穿的人都说了不保证真实性。其实我现在可以告诉你一个很可行的办法来完成这个过程。那就是利用微波对爆米花进行定向加热就可以了。这只需要一个旧微波炉就可以了。将其磁控管拆下来,用微波束瞄准爆米花就可以了。况且视频中的两个人的表情看起来像是在演戏。

回答者:罂粟的眼泪 - 高级魔法师 六级 6-17 16:44

引用2:

呵呵 网上曾经盛传 俄罗斯科学家为测试手机对大脑的伤害做试验——把鸡蛋放在手机旁边 ,手机长时间通话
结果几个小时后鸡蛋被烤熟了
真的那么可怕吗?
后来……
真相大白 ,原来是那科学家的同事开的一个玩笑
同事因为肚子饿 刚好看到他那有个生鸡蛋 于是就……
过后觉得过意不去,买了个熟鸡蛋又放回去了
你要知道基站的发射功率比你看到的那些手机要大得多(一个基站同时可容纳上千个手机信号,发射距离也远) 如果真的能爆米花 ,中国移动维修基站的不知道要追认多少烈士

回答者:Panther2_A1 - 总监 八级 6-16 17:48

我觉得其实不是不可能,只是条件需要更极端:

  1. 米花可以用都快要爆好的已经加热的差不多的。不管怎么说爆米花都是个量变到质变的过程。我们可以push条件更接近threshold么。。。
  2. CDMA还是GSM或其他RF辐射其实问题不大。
    这要从加热原理来说,尽管微波炉的波段2.45GHz比较适合穿透食物,并且与里边的水或油分子共振
    但是900MHz,1.8/1.9GHz的GSM/GPRS,或者2G+的CDMA,BT,WLAN。。。不全属于微波炉的最佳频段,但是我觉得效果不会差太多。微波炉的优势在于:他有--一个金属共振腔。满足一定尺寸和波长的关系,波导发出的电磁波就能在炉子里转悠。来加热水油分子。而手机天线则需要开放式的传输接受无线电。按照立方反比规律,这个能量损失是很大的。
  3. 再者就是本身功率。
    手机发射功率按规定是不能超过1W的。(好像是美国规定,欧洲更严格点)。而我们的微波炉呢?动辄800W以上吧。
    也许我们有一天拿上几百个手机,放成一个锅一样的形状。里边就真的能爆出米花也说不定。

欢迎补充:

另外,谁知道为什么总是有一个手机是反过来的??

[+/-] Read More...

First Visa EMV dual interface card launched in China

| 0 评论

Friday, 18 July, 2008 (Age: 2 days)

The Industrial and Commercial Bank of China (ICBC), the largest financial institution in the world, is issuing its customers with the countrys first ever Visa EMV payment card allowing both contactless and contact-based payment. Cardholders can pay for purchases quickly and conveniently by simply swiping the Visa payWave card across a contactless POS terminal or alternatively inserting it into the slot of a card reader. The dual interface cards are being issued in partnership with the Asian retail group Parkson in China, whose customers can also use them to collect loyalty points. ICBC and Parkson are planning to issue the Peony Parkson credit card to several tens of thousands of bank and retail customers this year. The Chinese subsidiary of the German technology enterprise Giesecke & Devrient (G&D) has been selected to supply the cards to ICBC.

The chip embedded in the card complies with the EMV standard. The issue of the Peony Parkson card represents an important step towards wide-scale migration of payment cards in China to the international standard for chip-based payment methods. The existing Parkson loyalty program will be expanded, enabling customers to pay and collect points in supermarkets, fast-food restaurants, cinemas, parking lots and gas stations with this card.

Global IDentification: First Visa EMV dual interface card launched in China

[+/-] Read More...