博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

随笔分类 -  Linux

摘要:1. VirtualBox设置网络连接为“桥接网卡”,并且此网卡要为win8正在使用的网卡(比如我的电脑上使用的就是无线网卡,则选择网卡时也要用无线网卡)2. 在redhat的终端里,运行ifconfig查看网络地址。若ifconfig无法运行,则使用命令whereis ifconfig查找命令,把... 阅读全文

posted @ 2015-05-10 20:06 天地玄黄 阅读(220) 评论(0) 推荐(0)

摘要:打开~/.vimrc。如果没有,就要首先从/usr/share/vim/vim73/中复制vimrc_example.vim到~目录下cp /usr/share/vim/vim73/vimrc_example.vim ~/.vimrc打开~/.vimrc,找到if has("vms")把if部分保留,else部分注释掉(使用"注释掉) 阅读全文

posted @ 2012-08-05 22:58 天地玄黄 阅读(1013) 评论(0) 推荐(0)

摘要:vi ~/.bashrc找到alias ls="xxxxxxxxxxxxxxxxxxxxxxxx"这一项,把注释去掉修改后的这一行为:alias ls='ls -hF --color=tty'保存退出,运行命令:source ~/.bashrc之后就可以显示文件夹的颜色了 阅读全文

posted @ 2012-08-05 22:51 天地玄黄 阅读(5504) 评论(0) 推荐(0)

摘要:从Windows中复制的东西如何粘贴到Cygwin下的vim中呢?使用SHIFT+INSERT按键即可!!参考:http://vim.wikia.com/wiki/Using_the_Windows_clipboard_in_Cygwin_Vim 阅读全文

posted @ 2012-08-05 19:04 天地玄黄 阅读(1902) 评论(1) 推荐(0)

摘要:原文参见http://www.brokenthorn.com/Resources/OSDev7.htmlGeneral Purpose RegistersThese are 32 bit registers that can be used for almost any purpose. Each of these registers have a special purpose as well, however.EAX - Accumlator Register. Primary purpose: Math calculationsEBX - Base Address Register. P 阅读全文

posted @ 2011-11-13 16:51 天地玄黄 阅读(478) 评论(0) 推荐(0)

摘要:1、按下开机键,连接开机键的一个导线就会输送一个信号给主板,请求开机。2、主板接收到这个信号,把信号转发给电源,要求电源开始供电,此时电源开始工作。3、电源给主板的各部分提供稳定的电压之后,发送“power_good”信号给BIOS。4、BIOS接受到信号之后,开始启动POST(Power On Self Test),检测电源供电是否稳定,检测硬件设备(比如内存)是否已经连接。5、POST检测完毕之后,会把BIOS程序加载到内存中的尾部地址(比如0xfffff0,或其他地址),然后在内存的0x0地址处存放一条跳转指令,跳转到BIOS在内存中的地址。6、CPU执行内存0x0处的指令。由于这是一条 阅读全文

posted @ 2011-11-09 14:24 天地玄黄 阅读(2075) 评论(1) 推荐(2)

摘要:ifconfig eth0 promisc 设置eth0为混杂模式。ifconfig eth0 -promisc 取消它的混杂模式可能需要加sudo 阅读全文

posted @ 2011-08-01 19:06 天地玄黄 阅读(2451) 评论(0) 推荐(0)

摘要:1. 安装gnuplot: 在Ubuntu下安装gnuplot非常简单,输入下面命令即可: sudo apt-get install gnuplot-x112. 使用命令绘图: 各种命令很多,详情可以参看这里:http://www.cnblogs.com/aioria0622/archive/2008/09/14/1290776.html 我使用peersim产生的数据,其格式如下所示:0.5 0... 阅读全文

posted @ 2011-06-27 15:36 天地玄黄 阅读(6054) 评论(1) 推荐(1)

摘要:java什么的都安装好之后再运行。 把peersim.1.0.5解压之后的文件夹类似如下所示: cat@Ubuntu:~/java/peersim-1.0.5$ lsbuild.xml chord doc jep-2.3.0.jar overview.html peersim-doclet.jar RELEASE-NOTES srcCHANGELOG djep-1.0.0.jar example... 阅读全文

posted @ 2011-06-25 15:18 天地玄黄 阅读(4673) 评论(0) 推荐(0)

摘要:在Linux下写了一个HelloWorld程序,编译了一下,生成HelloWorld.class文件,把这个文件拿到Windows下运行一下,看看效果如何。 程序代码如下: public class HelloWorld { public static void main(String args[]) { System.out.println("Hello World"); }} 在Linux下... 阅读全文

posted @ 2011-06-01 14:48 天地玄黄 阅读(367) 评论(0) 推荐(0)

摘要:1、首先在官方网站(点击可以下载)下载最新的JDK,要选用self extracting installer 2、在/usr/下新建java目录,把下载的文件放到这个目录下 sudo mkdir /usr/javacd /usr/java3、更改这个文件的权限,使其可以运行:cat@Ubuntu:/usr/java$ sudo chmod u+x jdk-6u25-linux-i586.bin4、... 阅读全文

posted @ 2011-06-01 13:18 天地玄黄 阅读(35919) 评论(0) 推荐(1)

摘要:到现在为止,我看过的书籍基本上是一脉相承的,逐渐深入计算机内部: · C语言深度解剖 ----- 这个是电子书,遇到问题还经常看一看 · C专家编程(Exptert C Programming) ----- 这个看过去就忘了,在图书馆借的书 · C traps and pitfalls ---- 这个也是在图书馆借的,翻译的书,基本上也不怎么记得了 · Linux C一站式编程 ----- 这本... 阅读全文

posted @ 2011-05-30 16:21 天地玄黄 阅读(891) 评论(1) 推荐(0)

摘要:在Linux中使用线程相关的东西就要使用到这个头文件,但这还不算。如果仅仅使用这个头文件,会出现错误: undefined reference to `pthread_create'collect2: ld returned 1 exit statusmake: *** [threadid] Error 1 之所以出现这样的错误,是因为我们没有链接相应的函数库。所以在编译的时候要加上 –lpth... 阅读全文

posted @ 2011-05-26 14:55 天地玄黄 阅读(12057) 评论(0) 推荐(1)

摘要:在C语言中,函数名竟然可以和struct类型名相同。看下面的程序。定义了struct foo; 和 void foo(struct foo *)两个函数。 #include <stdio.h>struct foo { int a; int b;};void foo(struct foo *f){ printf("%d, %d", f->a, f->b);}int main(){ struct f... 阅读全文

posted @ 2011-05-16 15:12 天地玄黄 阅读(1605) 评论(0) 推荐(0)

摘要:原文网址:http://uw714doc.sco.com/en/SDK_sysprog/_The_Controlling-Terminal_and_Pr.html The controlling-terminal and process-groups A terminal may belong to a process as its controlling-terminal, which is a... 阅读全文

posted @ 2011-05-13 15:30 天地玄黄 阅读(390) 评论(0) 推荐(0)

摘要:原文网址:http://www.adp-gmbh.ch/cpp/gcc/create_lib.html 还是看原文吧,不要看下面了,原文中有各种格式。 Here's a summary on how to create a shared and a static library with gcc. The goal is to show the basic steps. I do not want... 阅读全文

posted @ 2011-05-06 16:05 天地玄黄 阅读(400) 评论(0) 推荐(0)

摘要:副标题: 在汇编中使用Standard C Library。 main函数的执行过程。 main函数与Standard C Library的交互。 C程序是怎么开始和结束的: 在这里,一个C程序就是一个process Note: The only way a program is executed by the kernel is when one of the exec functions is... 阅读全文

posted @ 2011-05-06 10:32 天地玄黄 阅读(765) 评论(0) 推荐(0)

摘要:1、Standard I/O是指ISO C的standard I/O library中的函数。 它是以stream为中心的,当我们使用standard I/O打开或者新创建一个文件的时候,我们就说为这个文件关联了一个stream(或者更近一步,就认为这个文件已经变成了一个stream). 2、UNIX中把所有的东西都看做文件,键盘也是一个文件。打开这个文件,就会返回这个文件的file descr... 阅读全文

posted @ 2011-05-05 10:57 天地玄黄 阅读(318) 评论(0) 推荐(0)

摘要:4.11 In Section 4.21, our version of ftw never changes its directory. Modify this routine so that each time it encounters a directory, it does a chdir to that directory, allowing it to use the filenam... 阅读全文

posted @ 2011-05-03 21:07 天地玄黄 阅读(620) 评论(0) 推荐(0)

摘要:4.6 Write a utility like cp(1) that copies a file containing holes, without writing the bytes of 0 to the output file. 我自己写了一整程序来完成这个操作。 首先要使用fig3.2的程序生成一个带有hole的文件file.hole。 #include "apue.h"#include... 阅读全文

posted @ 2011-05-03 15:28 天地玄黄 阅读(535) 评论(0) 推荐(0)