Linux 判断机器的字节顺序
#include <fcntl.h>
int main(void)
{
typedef union un{
short s;
char c[sizeof(short)];
}un;
un myun;
myun.s = 0x0102;
if(sizeof(short) == 2){
if(myun.c[0] == 1 && myun.c[1] == 2)
printf("big-endian\r\n");
else if(myun.c[0] == 2 && myun.c[1] == 1)
printf("little-endian\r\n");
else
printf("unkown\r\n");
}
return 0;
}
摘自《Unix 网络编程》
相关文档:
1,先看看工作队列和tasklet的区别:
(1) 定时器和tasklet:
Tasklets resemble kernel timers in 3 ways.
1)They are always run at interrupt time,
2)they always run on the same CPU that schedules the ......
administer@administer-laptop:~/tem/tt$ cat hello.asm
[section .data]
strHello db "Hello, world!",0Ah
STRLEN equ $-strHello
[section .text]
global _start
_start:
mov edx,STRLEN
mov ecx,strHello
mov ebx,1
mov eax,4
int 0x80
mov  ......
Device eth0 has different MAC address than expected
前天在弄VMware的时候,在VMware上clone了一个linux,后来在clone的linux(RedHat Enterprise Linux 4)上不能上网了,激活eth0时老弹出 Device eth0 has different MAC address than expected ,我们只要编辑这个文件:/etc/sysconfig/network-scripts/ifcfg- ......
学用Linux命令
2006-01-23 11:18:22 虫子虫子爬@-FiFb /article/-FiFb-liXUWS.html 复制 评论
基础教程-学用Linux命令(1)
Linux虽然是免费的,但它的确是一个非常优秀的操作系统,与MS-WINDOWS相比具有可靠、稳定、速度快等优点,且拥有丰富的根据UNIX版本改进的强大功能。下面,作为一个典型的DOS 和WINDOWS用户, ......
1.实现外网访问内网的远程桌面
单位机器服务器的IP地址是10.3.198.108,可以上外网,路由器上设置了内网的外网映射地址,内网的地址是192.168.0.*
现在要实现从10.x.x.x的校园网内访问或者从internet网络上访问 192.168.0.*的远程桌面
方法如下
下载rinetd
vi /etc/rinetd.conf
--------------------------------------- ......