存档

作者存档

ubuntu英文环境下中文显示小方块的解决

2007年8月23日 hufey 评论已被关闭

只要执行sudo fontconfig-voodoo -f -s zh_CN即可
google“ubuntu 英文环境 中文 方块“ 出来的大部分都跟这个没关系

分类: saving 标签:

解决 nfs 中 xinetd 错误

2007年8月23日 hufey 评论已被关闭

/etc/init.d/rc: line 30: /etc/rc.d/rc3.d/S65xinetd: Input/output error
原因:/etc/rc.d/init.d/xinetd的属性位不对
chmod 777 etc/rc.d/init.d/xinetd 后解决

分类: hacking 标签:

rpm 查询未安装的包

2007年8月22日 hufey 评论已被关闭

rpm -qpl package.rpm
TMD,这个命令老也记不住

分类: saving 标签:

blackberry在linux下不能充电问题的解决

2007年8月16日 hufey 评论已被关闭

blackberry 7290在手里用了一段时间了,在windows和mac osx下的数据同步都没问题,不过从来没想过在linux下同步。
今天在单位发现手机电量不多了,于是接上USB线为其充电,发现充电指示标志每次都闪了一下
就灭了。怀疑是USB cable的问题,没当回事。下午偶尔切换到windows那边,顺便同步了一下
outlook里的meeting request,发现其实是能充电的。也就是说问题不是在USB线上,那就只能是在Linux端了。
google,发现确实有人抱怨linux下blackberry不能充电的问题
然后有人提到bcharge这个小程序可以给blackberry充电,google bcharge发现是sourceforge上的project barry的一部分,最新版本是0.8,看到barry的主页上作者的声明希望
有人能资助继续这个项目。呵呵
开始想直接装binary版本的,结果发现相关的好多库ubuntu都不提供,而基本上debian都是提供的,装debian的又发现某个库和ubuntu的某个系统库不兼容。头疼,只好下载source code编译。./configure又有还个库需要装,还好ubuntu都有,编译安装
又从CVS下载udev的policy文件。结果发现还是老样子,按说这些做完之后插入blackberry
系统会自动调用bcharge程序充电,看bcharge的代码,基本都是给USB bus下命令,没空
研究细节,好像是检测出来7290不是什么“Pearl”所以每次bcharge执行一下就自动退出来了。
又发现其实bcharge执行的时候是充电的,只是很快就退出来。好了,这个好解决
写了个脚本,让丫一直运行不就行了么?!
#!/bin/bash
while [1]
do
/usr/local/sbin/bcharge
done
执行,下班前跑了一个多小时,看到电池格数果然涨了一格,哈哈

分类: hacking 标签:

motorola放弃montavista

2007年8月10日 hufey 评论已被关闭

原因是montavista总人数还没有wind river支持的人数多
不知这算是大公司的愚蠢还是小公司的缺陷

分类: watching 标签:

gcc和g++到底有什么区别?

2007年8月9日 hufey 评论已被关闭

今天编译一个很普通的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++不过是隐含链接某些库

分类: saving 标签:

垃圾邮件长本事了

2007年8月8日 hufey 评论已被关闭

居然会自动生成跟邮件列表名称相关的subject和附件。虽然内容还是垃圾
[Ltp-coverage] Technical_Analysis-ltp-coverage Inbox ltp-coverage
Reply
Reply to all Reply to allForward Forward Print Add rhadona to Contacts list Delete this message Report phishing Show original Message text garbled?
rhadona Renfroe
to ltp-coverage
show details
7:32 am (3 hours ago)
————————————————————————-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Ltp-coverage mailing list
Ltp-coverage@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-coverage
Technical_Analysis-ltp-coverage.pdf
13K View as HTML Download

分类: commenting 标签:

我的simpson avatar

2007年7月29日 hufey 评论已被关闭

avatar.jpg

分类: shooting 标签:

Working SSH Instructions by NerveGas

2007年7月24日 hufey 评论已被关闭

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

分类: saving 标签:

存张老图,看看自己认识几个

2007年7月23日 hufey 评论已被关闭

分类: watching 标签: