易截截图软件、单文件、免安装、纯绿色、仅160KB
热门标签: c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 最新文章 : linux

Linux启动流程

从用户打开电源到用户可以登录的这短短的一段时间内,Red Hat Enterprise Linux到底都作了哪些事情,只有知道了这些事情,用户在以后的使用过程中,如果出现了一些问题,我们可以借助这些过程来为我们排除一些故障。
Red Hat Enterprise Linux在电脑的启动阶段,一共经历以下两个阶段,如图1:
BIOS自检
当电脑开机的时候,电脑会进入BIOS,BIOS的工作主要是侦测电脑的周边配套设备是否工作正常,如CPU的类型、速度、缓存等
主板类型
内存的速度,容量
硬盘的大小,类型和工作模式
风扇速度等
主要是为了检查这些设备在开机的时候是否能通过检测,如果能通过检测,说明电脑可以正常的工作。
------------------------------
载入启动程序
BIOS自检完成后,BIOS会根据用户设置的启动顺序来由那个设备来启动电脑的操作系统,这个设备一般是硬盘。
也就是进入到硬盘的MBR区域,这个区域中的有512个字节的大小,其中前446个字节中保存的程序是选择启动分区,也就是电脑由那个硬盘分区来载入开机的程序。那么在这个446个字节的空间中保存的就是启动程序,然后由这个小程序来加载存储在其他位置的操作系统,也就是启动grub程序。如图02所 ......

Linux 脚本编写基础(四)

4)函数
如果您写了一些稍微复杂一些的程序,您就会发现在程序中可能在几个地方使用了相同的代码,并且您也会发现,如果我们使用了函数,会方便很多。一个函数是这个样子的:
functionname()
{
# inside the body $1 is the first argument given to the function
# $2 the second ...
body
}
您需要在每个程序的开始对函数进行声明。
下面是一个叫做xtitlebar的脚本,使用这个脚本您可以改变终端窗口的名称。
这里使用了一个叫做help的函数。正如您可以看到的那样,这个定义的函数被使用了两次。
#!/bin/sh
# vim: set sw=4 ts=4 et:
help()
{
cat <
xtitlebar -- change the name of an xterm, gnome-terminal or kde konsole
USAGE: xtitlebar [-h] "string_for_titelbar"
OPTIONS: -h help text
EXAMPLE: xtitlebar "cvs"
HELP
exit 0
}
# in case of error or if -h is given we call the function help:
[ -z "$1" ] && help
[ "$1" = "-h" ] && help
# send the escape sequence to change the xterm titelbar:
echo -e "33]0;$107"
#
在脚本中提供帮助是一种很好的编程习惯,这样方便其他用户 ......

Linux下看代码的好工具Kscope

Kscope是Linux下的一款类似于SourceInsight工具,下面将其安装过程总结如下:
1.先下载kscope
kscope最新安装版本kscope-1.6.2.tar.gz
http://download.chinaunix.net/download/0006000/5469.shtml
按照说明#./configure
            #make
            #make install
2.安装好后,第一次运行需要配置三个工具:cscope、ctags、dot,如果机器上没有,可以在下面地址下载:
cscope-15.5.tar.gz
http://download.chinaunix.net/download/0002000/1900.shtml
 
ctags-5.5.tar.gz 
http://download.chinaunix.net/download/0002000/1919.shtml
graphviz-2.18.tar.gz(安装好后会有dot工具)
http://download.chinaunix.net/download/0005000/4119.shtml
好了,这样就可以使用Kscope了,先建立一个新的工程,导入已有代码,就可以编辑代码了,Enjoy it! ......

linux shell 脚本 调用数据库

最近一直在忙项目,做的过程中遇到一个很纠结的事情。需要用shell脚本轮训数据库,数据执行完毕以后才能调用其他的shell脚本。在这里总结一下,与大家共享。
脚本如下:
shell 脚本如下:
#!/bin/sh
SQL_DIR=/home/tang/tek/sql/tek
SHELL_DIR=/home/tang/tek/sh/tek
LOG_DIR=/home/tang/tek/logs
. /home/tang/.bash_profile
#$SHELL_DIR/runsql.sh /home/tang/tek/sh/tek/test.sql > test.txt
log_check=1
checkCount=0
while [[ $log_check -ne 0 ]]; do
   newlog_check=`sqlplus -s/nolog 用户名/密码@Sid<<-EOF
    set heading off feedback off pages 0
     select count(*)
    from tek.admin_user sn
   where sn.name is null
    exit
EOF`
log_check=$newlog_check
echo "log check value is:" $log_check
let checkCount=$checkCount+1
if [ $checkCount -gt 2 ]; then
          sqlplus -s/nolog 用户名/密码@Sid<<-EOF
     update tek.user_info bm s ......

linux 0.11 内核学习 floppy.c,驱动你的软盘


/*
 *  linux/kernel/floppy.c
 *
 *  (C) 1991  Linus Torvalds
 */
/*
 * 02.12.91 - Changed to static variables to indicate need for reset
 * and recalibrate. This makes some things easier (output_byte reset
 * checking etc), and means less interrupt jumping in case of errors,
 * so the code is hopefully easier to understand.
 */
/*
 * This file is certainly a mess. I've tried my best to get it working,
 * but I don't like programming floppies, and I have only one anyway.
 * Urgel. I should check for more errors, and do more graceful error
 * recovery. Seems there are problems with several drives. I've tried to
 * correct them. No promises. 
 */
/*
 * As with hd.c, all routines within this file can (and will) be called
 * by interrupts, so extreme caution is needed. A hardware interrupt
 * handler may not sleep, or a kernel panic will happen. Thus I cannot ......

linux 0.11 内核学习 floppy.c,驱动你的软盘


/*
 *  linux/kernel/floppy.c
 *
 *  (C) 1991  Linus Torvalds
 */
/*
 * 02.12.91 - Changed to static variables to indicate need for reset
 * and recalibrate. This makes some things easier (output_byte reset
 * checking etc), and means less interrupt jumping in case of errors,
 * so the code is hopefully easier to understand.
 */
/*
 * This file is certainly a mess. I've tried my best to get it working,
 * but I don't like programming floppies, and I have only one anyway.
 * Urgel. I should check for more errors, and do more graceful error
 * recovery. Seems there are problems with several drives. I've tried to
 * correct them. No promises. 
 */
/*
 * As with hd.c, all routines within this file can (and will) be called
 * by interrupts, so extreme caution is needed. A hardware interrupt
 * handler may not sleep, or a kernel panic will happen. Thus I cannot ......

解析Linux网络分析的三大利器(ZT)

解析Linux网络分析的三大利器(ZT)
ZT from linuxsir
解析Linux网络分析的三大利器
随着Internet的迅猛发展,网络已无处不在,但是,它可能随时受到来自各方的攻击。了解哪些人正在访问资源、哪些人正在享受服务、哪些人正在发送大
量垃圾等,对网络管理员来说是非常必要的。利用Linux中较常见的网络分析工具Tcpdump、Nmap和Netstat,可以使网络管理工作更加轻
松。
Tcpdump主要是截获通过本机网络接口的数据,用以分析。Nmap是强大的端口扫描工具,可扫描任何主机或网络。Netstat可用来检查本机当前提供的服务及状态。这三者各有所长,结合起来,就可以比较透彻地了解网络状况。
Tcpdump
Tcpdump能够截获当前所有通过本机网卡的数据包。它拥有灵活的过滤机制,可以确保得到想要的数据。由于Tcpdump只能收集通过本机的数据,因此
它的应用受到了一些限制,大多应用在网关或服务器自我检测上。例如,在作为网关的主机上,想知道本地网络中IP地址为192.168.0.5的主机现在与
外界通信的情况,就可以使用如下命令:
tcpdump -i eth0 src host 192.168.0.5
在默认情况下,Tcpdump会将数据输出到屏幕。如果数据量太大,可能根本看不清具体的内容,这时我们可以把它重定� ......
总记录数:5772; 总页数:962; 每页6 条; 首页 上一页 [478] [479] [480] [481] 482 [483] [484] [485] [486] [487]  下一页 尾页
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号