您正在查看 "知识体系" 分类下的文章
2009-11-30 16:28
2009-10-19 11:27
重要系统信息的获取
1. CPU/系统 32/64位信息:
(1). 在LINUX下怎样决断你的CPU是32位还是64位?
打入下面的命令
grep flags /proc/cpuinfo
输出
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm nx lm
如果找到lm, 则说明你的CPU是64位的. lm是long mode的意思.
* Long Mode - 64位CPU
* Real Mode - 16位CPU
* Protected Mode - 32位CPU |
2009-08-22 16:47
C++ dlopen mini HOWTO
作者:Aaron Isotton <aaron@isotton.com> 2006-03-16
译者:Lolita@linuxsir.org 2006-08-05
------------------------------------------------
摘要
如何使用dlopen API动态地加载C++函数和类
------------------------------------------------
目录
介绍
版权和许可证
不承诺
贡献者
|
2009-08-19 17:17
Note:
Chapter 1. Introduction
Unix: #!/usr/bin/perl -w or #!/usr/bin/env perl (use -w because we like warnings)
windows: #!perl
Chapter 2. Scalar Data
Scalar data: undef, double(integer is actually doubles), string
List data: list of scalar element. refer to Chapter 3.
undef data: it's another kind of scalar data. if you use a var without definition, it contains undef value, not string or doubles
eg.
$blank |
2009-08-18 17:41
Tips:
1. Getopt::Long
Getopt::Long module is used to parse both long and short options names. It's a replacement for Getopt::Std which only support single char options. The equivalent in Unix is getopt_long and getopt function.
Rules:
(1) Getopt won't force user to supply any option:
this means user can omit all options, and Getopt won't complain anything.
(2) Getopt only force the right format if options are supplied by user:
this means if user supplies opti |
2009-07-05 10:19
TODO: 添加12,13章未完的命令的参数
第12章 外部命令
1. 基本命令:
(1) ls -R 递归 -F在文件后加类型标识 -S按照文件大小排列 -t按文件修改时间排列 -i打印inode号 --time=atime/ctime,默认不写就是mtime
(2)tac 和cat相反,从最后一行读取文件
rev 反转每一行里的字符,但行的读取顺序还是从文件头开始,比如123变为321
(3)cp -a 等于-dpR,因为一般的不加p的cp,就是read读取文件内容,然后write到目的地,这个目的文件的创建后的owner和权限等于该用户自己创建一个文件的权限。如果你想保持 |
2009-07-05 10:17
TODO: 添加12,13章未完的命令的参数
一、重用的模块:
清空或创建文件:
cat /dev/null > /var/log/message
:> /var/log/message
> /var/log/message
当前用户ID:
$UID
退出码归操作方法:
E_XCD=66 cd不进去
E_NOTROOT=67 不是root
使用时: exit $E_XCD 即可,正常时 exit 0
查看用户是否为root:
ROOT_UID=0
if [ "$UID" -ne "$ROOT_UID" ];then
echo |
2009-03-31 10:01
2009-03-31 10:01
2009-03-31 10:00
(转,不错~~)
Multithreaded Programming :: Improving Performance through Threads
Introduction
Most code written today is sequential. What do we mean by the term sequential or serialized? Simply put, code is executed one instruction after the next in a monolithic fashion, with no regard to the many possible resources available to the program. Overall performance can be serverely degraded if the program performs a blocking |
|
|