ssh登录后的X DISPLAY自动forwarding
在server 端的/etc/ssh/sshd_config中打开
X11Forwarding yes
在client端的/etc/ssh/ssh_config中打开
ForwardX11 yes
在server 端的/etc/ssh/sshd_config中打开
X11Forwarding yes
在client端的/etc/ssh/ssh_config中打开
ForwardX11 yes
把流控去掉试试
Ctrl +A -> Z -> O -> serial port setup -> F, G
save setup as dfl
只要执行sudo fontconfig-voodoo -f -s zh_CN即可
google“ubuntu 英文环境 中文 方块“ 出来的大部分都跟这个没关系
今天编译一个很普通的C++程序,如下:
1 #include 《iostream》
2
3 void function1(){
4 for(int i=0;i<1000000;i++);
5 }
6
7 void function2(){
8 function1();
9 for (int i=0;i<2000000;i++);
10 }
11
12 void function3(){
13 function1();
14 function2();
15 for (int i=0;i<3000000;i++);
16 function1();
17 }
18
19 int main(){
20 for(int i=0;i<10;i++)
21 function1();
22
23 for (int i=0;i<5000000;i++);
24
25 for(int i=0;i<10;i++)
26 function2();
27 for(int i=0; i<13;i++);
28 {
29 function3();
30 function2();
31 function1();
32 }
33 }
编译命令行: gcc -pg -o sample3 sample3.cpp
结果是:
/tmp/cck9wDpZ.o: In function `__static_initialization_and_destruction_0(int, int)':
sample3.cpp:(.text+0x12c): undefined reference to `std::ios_base::Init::Init()'
/tmp/cck9wDpZ.o: In function `__tcf_0':
sample3.cpp:(.text+0x183): undefined reference to `std::ios_base::Init::~Init()'
/tmp/cck9wDpZ.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
以前因为工作内容的关系,没用gcc编译过c++的代码。或者是其他同事已经写好了Makefile,没怎么关心过这个问题。不过以前和一个同事争论过,他说c++的代码必须要用g++编译,否则编译不过去,因为gcc是编译c code的,而g++才是编译c++的。我当时就知道肯定不对,因为gcc是gnu compiler collection的缩写,而不是gnu C compiler。理论上所有的gcc支持的不同语言的代码都可以用gcc编译(如果我错了请纠正我)。当时没空争论这个问题,结果今天自己碰上了
。google了一下,又试了试,确实用g++可以编译过去
g++ -pg -o sample3 sample3.cpp
不服不服,继续尝试发现用gcc也可以,不过要加上指定的标准c++库
如下:
gcc -pg -o sample3 sample3.cpp -lstdc++
所以,gcc是可以编译c++ 代码的,g++不过是隐含链接某些库
Working SSH Instructions by NerveGas
Previous instructions on the net have required the use of restore mode to set
binary permissions. Unfortunately, restore mode doesn’t work with all public
versions of iPhoneInterface I’ve tried. The instructions below work by
overwriting an existing binary on the system with chmod, and then calling it
with the appropriate arguments to set permissions. The result is a fully
functional SSH setup. You can then proceed to uploading your own world builds,
or other programs to execute via commandline.
Step 1: Key Creation
On your Mac or PC, download dropbear from here:
http://matt.ucc.asn.au/dropbear/dropbear.html
Run: ./configure && make
You don’t need to install the software, just run:
./dropbearkey -t rsa -f dropbear_rsa_host_key
./dropbearkey -t dss -f dropbear_dss_host_key
And copy the two new key files into your iPhoneInterface directory.
Step 2: Uploading dropbear and friends
Download the iphone-ssh kit and the iphone binaries kit:
http://www.abigato.com/iphone-ssh-kit-vr1.tar.bz2
http://netkas.freeflux.net/blog/
Rename sh6 from the kit to sh.
Use the jailbreak application to break out of jail, and then open
iPhoneInterface to connect.
mkdir /etc/dropbear
cd /etc/dropbear
putfile dropbear_rsa_host_key
putfile dropbear_dss_host_key
cd /bin
putfile chmod
putfile sh
cd /usr/bin
putfile dropbear
Step 3: Overwriting ‘update’ with ‘chmod’
While still connected to iPhoneInterface, make a backup copy of
/usr/sbin/update:
cd /usr/sbin
getfile update
Rename this to update.original on your local filesystem
Now copy the ‘chmod’ binary to ‘update’ and upload it back to the
iPhone:
cd /usr/sbin
putfile update
Step 4: Overwriting the update configuration
Now the ‘update’ binary is really ‘chmod’, and has execute permissions! We
just need to tell the iPhone to chmod next time it boots. To do this, we
download /System/Library/LaunchDaemons/com.apple.update.plist and add our
own arguments to ProgramArguments:
0 /usr/sbin/update
1 555
2 /bin/chmod
3 /bin/sh
4 /usr/bin/dropbear
Save the new plist and upload it back to the iPhone:
cd /System/Library/LaunchDaemons
putfile com.apple.update.plist
While we’re here, lets also:
putfile au.asn.ucc.matt.dropbear.plist
Step 5: Reboot the iPhone twice.
The first reboot should set the permissions on the dropbear and related
binaries. The second reboot should start dropbear, so you can ssh to it:
ssh -l root [IP ADDRESS]
The root password is ‘dottie’.
Step 6: Replace the original update and com.apple.update.plist files
Don’t forget to put the old update files back. Rename update.original back
to update, and delete the extra ProgramArguments you added to
com.apple.update.plist. Now put them back:
cd /System/Library/LaunchDaemons
putfile com.apple.update.plist
cd /usr/sbin
putfile update
Step 7: Change the root password
If you don’t like ‘dottie’, you can generate a new encrypted password
by running:
perl -e ‘print crypt(”MYPASSWORD”, “XU”);’
Where MYPASSWORD is the new password you want, and XU is a random two-letter
salt. Copy the encrypted output and replace the existing one in
/etc/master.passwd on the phone.
You’re done! Enjoy!
-NerveGas
realplayer在我的G4上坏了有一段时间。 mac osx在应该是他最擅长的多媒体播放上也远不是完美。最开始发现某些avi文件用vlc播放的时候会导致系统假死,渐渐的感觉规律是在播放的时候系统掉电然后当时播放的文件会有数据错误,这些都是猜测,以后有空拿md5sum检查一下是不是这样的。总之电影看着非常不爽,只好跳过那一小段。 再后来发现用rmvb也有类似的问题,在mac下一直用realplayer看rmvb,在linux下倒是一直用mplayer。因为mplayer的界面在osx下实在太简陋,远不如VLC,而linux下简陋是一种习惯,无所谓了。直到某天升级realplayer之后,realplayer再也不工作了。点了之后在任务栏上闪了闪,然后就一股青烟,没有了。在terminal上执行realplayer看到的segment fault,后来还看到过bus error。奇怪启动应用程序居然会导致bus error。重装了N次不同版本的realplayer始终解决不了问题。google也没有任何有用的信息,osx用的人还是太少。总基数太少还是osx太稳定导致没有有用信息这我就不知道了。倒是在国内的一个论坛上看到有人有类似的问题。rmvb虽然看得不多,但是国产电视剧还是在用这个格式。最后决定还是想想辙吧。mplayer既然能在linux/windows下播放所有的格式,在osx下播放rmvb自然也不在话下。下载了所有的codec,解压缩,发现README里说明所有codec要放在/usr/local/lib/mplayer下,但是osx下没发现/usr目录。最后google中文”mplayer osx codec 安装“,发现原来/usr在osx下是有的,只不过隐藏了起来。在terminal下ls都可以看到,在Finder里是看不到的,cp自然要sudo,不提了。最后终于成功用mplayer播放rmvb。于是删掉realplayer,不用它了,永远。
http://docs.info.apple.com/article.html?artnum=75459
最新的mac系统快捷键一览表!要成为高手请看!
中文版看这儿:
系统固定快捷键,Mac OS X适用
动作 快捷键
停止进程 Command + period
强制退出应用程序 Command + Option + Escape
强制重新启动 Command + Ctrl + 电源 key
屏幕捕捉
动作 保存为 快捷键
整个屏幕 PDF 格式在桌面 Command + Shift + 3
部分屏幕 PDF 格式在桌面 Command + Shift + 4
窗口/图标 PDF 格式在桌面 1. Command + Shift + 4
2. 空格
整个屏幕 剪贴板 Ctrl + Command + Shift + 3
部分屏幕 剪贴板 Ctrl + Command + Shift + 4
窗口/图标 剪贴板 1. Ctrl + Command + Shift + 4
2. 空格
屏幕快照的格式可以自Onyx等系统维护程序中更改为jpeg,png等。
计算机启动
动作 快捷键
启动到安全模式 Shift (在开机声音后)
打开登录窗口 Shift (当屏幕变成蓝色以后)
并闭打开的窗口 Shift (登录过程中)
从光盘启动 c
选择启动磁盘 Option
重置 Parameter RAM Command + Option + p + r
启动到 verbose 模式 Command + v
启动为单用户模式 Command + s
打开固件 Command + Shift + o + f
火线连接方式 t
Com或者command就是指的命令键(苹果键/花键)啦。
Dashboard F12
Finder 快捷键
动作 快捷键
隐藏 Finder Command + h
隐藏其它 Command + Option + h
清空废纸篓 Command + Shift + Delete
清空废纸篓 (不提示) Command + Option + Shift + Delete
获取信息 (静态窗口) Command + i
获取信息 (动态窗口) Command + Option + i
查找 … Command + f
弹出 Command + e
查看显示选项 Command + j
转到计算机 Command + Shift + c
转到个人主目录 Command + Shift + h
转到 iDisk Command + Shift + i
转到应用程序目录 Command + Shift + a
转到个人收藏 Command + Shift + f
转到目录 … Command + Shift + g
连接到服务器 … Command + k
注销… Command + Shift + q
注销 (不提示) Command + Option + Shift + q
这一段能默写下来的,算你狠。。。。。。
Finder中有关图标的快捷键
动作 快捷键
选择下一图标 Arrow keys
选择图标名字的首字母 Letter key
选择下一个(字母顺序) Tab
添加图标到选择的项目 Shift + click
选择相邻的图标 (列表显示) Shift + click
选择不相邻的图标 (列表显示) Command + click
编辑图标名字 Return
文件及目录快捷键
动作 快捷键
拷贝项目 Option + 拖拉
原位复制 Command + d
创建替身(拖拉方式) Command + Option + 拖拉
创建替身(命令方式) Command + l (L)
显示原身位置 Command + r
添加到个人收藏 Command + t
对齐项目 Command + 拖拉
在单独的窗口中打开目录 Command + 双击
打开项目 Command + Down Arrow
关闭目录 (转到上层目录) Command + Up Arrow
打开目录 (列表显示) Option + Right Arrow
关闭目录 (列表显示) Option + Left Arrow
打开选择的目录中的所有目录 (列表显示) Command + Option + Right Arrow
关闭选择的目录中的所有目录 (列表显示) Command + Option + Left Arrow
删除项目 Command + Delete
窗口快捷键
动作 快捷键
新 Finder 窗口 Command + n
关闭当前窗口 Command + w
最小化当前窗口 Command + m
关闭所有窗口 Option + click close button
最小化所有窗口 Option + click minimize button
适合屏幕 Option + click zoom button
隐藏应用程序 Option + click (Desktop, Dock item, …)
移动一个非当前窗口 Command + 拖拉窗口
查看路径 Command + 点击窗口标题
图标显示 Command + 1
列表显示 Command + 2
分栏显示 Command + 3
隐藏/显示栏 Command + b
dock快捷键
动作 快捷键
在 Finder 中显示项目 Command + click dock item
切换dock (全键盘操作) Ctrl + d
导航 (全键盘操作) Arrow Left, Arrow Right or Tab, Shift + Tab
打开项目 Space, Return, Enter
隐藏/显示Dock Command + Option + d
用户进程快捷键
动作 动作
查看活动的用户程序 Command + Tab
往回查看活动的用户程序 Command + Shift + Tab
对话框快捷键
动作 快捷键
选择下一区域 Tab
选择默认按钮 Return or Enter
关闭提示 Esc or Command + period
选择上层或者下层目录(保存/打开) Up Arrow, Down Arrow
向上滚动 (列表) Page up
向下滚动 (列表) Page down
全键盘操作
动作 快捷键
打开全键盘操作 Ctrl + F1
提示以及窗口任意控制 Ctrl + F7
高亮下一控制 Tab
高亮下一控制 (文本框) Ctrl + Tab
高亮下一窗口 Command + `
高亮在列表, 标签组或菜单中的项目 Arrow keys
移动滚动条 Arrow keys
高亮文本框相邻的控制 Ctrl + Arrow keys
选择高亮项目 Space bar
选择默认按钮 Return or Enter
点击取消按钮 Esc
不选择项目关闭菜单 Esc
反转高亮移动的顺序 Shift + “key”
动作(使用功能键) 快捷键
菜单条 Ctrl + F2
Dock Ctrl + F3
浏览窗口 Ctrl + F4 (Ctrl + Shift + F4)
工具栏 Ctrl + F5
实用程序窗口 Ctrl + F6
动作 (使用字母键) 快捷键
菜单条 Ctrl + m
Dock Ctrl + d
浏览窗口 Ctrl + w (Ctrl + Shift + w)
工具栏 Ctrl + t
实用程序窗口 Ctrl + u
鼠标键快捷方式 (必须激活 “万能辅助”)
动作 快捷键
使用鼠标进行开关 Option (5次)
(必须激活 “万能辅助”)
向上移动 8
向下移动 2
向左移动 4
向右移动 6
斜移 1,3,7,9
点击 5
按下 0
(If you don’t have a numeric keypad, press the fn key + “number”)
摘自kerneltrap.org
JA: How can a person tell if their hardware supports kvm?
Avi Kivity: You can easily tell if your processor supports hardware extensions by running the command
$ egrep ‘^flags.*(vmx|svm)’ /proc/cpuinfo
If there’s any output at all, your processor supports kvm. Unfortunately, some early laptops that support kvm have VT extensions disabled in the BIOS, so a BIOS upgrade is required. There is also a comprehensive list on the Xen site, http://wiki.xensource.com/xenwiki/HVM_Compatible_Processors.