Besser nicht beginnen als nicht beenden. QQ :15778000 E-MAIL :kernbombe@21cn.com 核弹 / KernBombe系统 : http://www.xyabc.cn/software/nuclear/kb_zh_utf8.iso
  • 设置系统时钟和日期

    2008-05-07 13:29:57

    设置系统时钟和日期

    在 Linux 中除了使用 GUI 的方式设置系统时钟和日期之外,我们也可以通过 CLI 使用 date 命令来完成同样的事情。以下是使用 date 命令设置系统时钟和日期的详细过程。

    你可以使用如下命令来设置系统时钟和日期:

    date mmddttttyyyy.ss

    其中,命令后跟参数的含义为:

    • mm:月
    • dd:日
    • tttt:时间,包括小时和分钟
    • yyyy:年
    • ss:秒

    例如,假设你想要将当前系统的时钟和日期设置为 2007 年 7 月 17 日 11 时 15 分,那么可以执行下列指令:

    date 071711152007

    date 命令不加任何参数,则可以查看当前系统的时钟和日期。

  • 利用google突破各种**来下载你要的东西

    2008-02-28 12:37:06

    第一篇
    在搜索框上输入: “index of/ ”  inurl:lib

    再按搜索你将进入许多图书馆,并且一定能下载自己喜欢的书籍。

    在搜索框上输入: “index of /”  cnki

    再按搜索你就可以找到许多图书馆的CNKI、VIP、超星等入口!

    在搜索框上输入: “index of /”  ppt

    再按搜索你就可以突破网站入口下载powerpint作品!

    在搜索框上输入: “index of /”  mp3

    再按搜索你就可以突破网站入口下载mp3、rm等影视作品!

    在搜索框上输入: “index of /” .s**

    再按搜索你就可以突破网站入口下载flash作品!

    在搜索框上输入: “index of /”  要下载的软件名

    再按搜索你就可以突破网站入口下载软件!

    注意引号应是英文的!

    再透露一下,如果你输入:

    “index of /”  AVI

    另补上第二篇
    用GOOgle看世界!!!只要你在GOOGLE里输入特殊的关键字,就可以搜到数千个摄象头的IP地址!通过他你就可以看到其所摄的实时影象!!
    在google里输入
    inurl:"viewerframe?mode="

    随便打开一个,然后按提示装一个插件,就可以看到了!!!

    再补上第三篇
    三则黑客的Google搜索技巧简介
    大家都知道,Google毫无疑问是当今世界上最强大的搜索引擎。然而,在黑客手中,它也是一个秘密武器,它能搜索到一些你意想不到的信息。赛迪编者把他们进行了简单的总结不是希望您利用他去攻击别**,而是利用这些技巧去在浩如烟海的网络信息中,来个大海捞针,寻找到对您有用的信息。

    如果您是一名普通网民,您可以使用黑客的技巧扩大自己的视野,提高自己的检索效率;如果您是一名网管,请您赶快看看您的网站是否做好了对下面黑客探测手段的防范措施,如果没有就赶快来个亡羊补牢,毕竟隐患胜于明火,防范胜于救灾;如果您是一名黑客,相信您早以在别的黑客站点上见过类似的方法,这篇文章对您没什么用处,这里的技巧对您是小儿科,菜鸟级!您可以节省宝贵的时间做更有意义的事情,这篇文章您不用看了,到别处去吧!

    基于上面的考虑我编发了这篇文章。

      搜索URL

      比如我们提交这种形式:passwd.txt site:virtualave.net

      看到了什么?是不是觉得太不可思议了!有很多基于CGI/PHP/ASP 类型的留言板存在这种问题。有时我们得到密码甚至还是明码的!管理员或许太不负责了,或许安全防范的意识太差了,如果你是网络管理员,赶快检查一下不要让恶意攻击者捡了便宜。不要太相信DES加密,即使我们的密码经过DES 加密的密码,黑客们还是可以通过许多破解软件来搞定。

      



      这次我们能得到包含密码的文件。“site:virtualave.net”意思是只搜索 virutalave.net 的URL。virutalave.net是一个网络服务器提供商。

      同样,我们可以搜索一些顶级域名,比如:.net .org .jp .in .gr

      config.txt site:.jp

      admin.txt site:.tw

      搜索首页的目录

      首页是非常有用的,它会提供给你许多有用的信息。

      我们提交如下的形式:

      "Index of /admin"

      "Index of /secret"

      "Index of /cgi-bin" site:.edu

      你可以自己定义搜索的首页字符。这样就可以获得许多信息。

      搜索特定的文件类型

      比如你想指定一种文件的类型,可以提交如下形式:

      file无效:.doc site:.mil classified

      这个就是搜索军方的资料,你可以自定义搜索。
    再提供一个第四篇

    Google 的特殊功能
    1 、查询电话号码
    Google 的搜索栏中最新加入了电话号码和美国街区地址的查询信息。
    个人如想查找这些列表,只要填写姓名,城市和省份。
    如果该信息为众人所知,你就会在搜索结果页面的最上方看到搜索的电话和街区地址
    你还可以通过以下任何一种方法找到该列表:
    名字(或首位大写字母),姓,电话地区号
    名字(或首位大写字母),姓,邮递区号
    名字(或首位大写字母),姓,城市(可写州)
    名字(或首位大写字母),姓,州
    电话号码,包括区号
    名字,城市,州
    名字,邮递区号

    2 、查找 PDF 文件
    现在 GOOGLE 的搜索结果中包括了 PDF 文件。尽管 PDF 文件不如 HTML 文件那么多,但他们经常具备一些其他文件不具备的高质量信息
    为了显示一个搜索结果是 PDF 文件而不是网页, PDF 文件的标题开头显示蓝色文本。
    这就是让你知道 ACRTOBAT READER 程序会启动来阅读文件
    如果你的计算机没装有该程序,计算机会指导你去能免费下载该程序的网页。
    使用 PDF 文件时,相关的网页快照会由“ TEXT VERSION ”代替,它是 PDF 文档的复制文件,该文件除去了所有格式化命令。
    如果你在没有 PDF 链接的情况下想看一系列搜索结果,只要在搜索栏中打上 -inurldf 加上你的搜索条件。

    3 、股票报价
    用 Google 查找股票和共有基金信息,只要输入一个或多个 NYSE , NASDAQ , AMEX 或
    共有基金的股票行情自动收录机的代码,也可以输入在股市开户的公司名字。
    如果 Google 识别出你查询的是股票或者共有基金,它回复的链接会直接连到高质量的金融信息提供者提供的股票和共有基金信息。
    在你搜索结果的开头显示的是你查询的股市行情自动收录器的代码。如果你要查找一家公司的名字(比如, INTEL ),请查看“股票报价”在 Google 搜索结果的金融栏里会有那个公司的主页的链接(比如, WWW.INTEL.COM )。
    Google 是以质量为基础来选择和决定金融信息提供者的,包括的因素有下载速度,用户界面及其功能。

    4 、找找谁和你链接
    有些单词如果带有冒号就会有特殊的意思。比如 link :操作员。查询 link:siteURL ,就会显示所有指向那个 URL 的网页。举例来说,链接 www.Google.com 会向你显示所有指向 GOOGLE 主页的网页。但这种方法不能与关键字查询联合使用。

    5 、查找站点
    单词 site 后面如果接上冒号就能够将你的搜索限定到某个网站。具体做法是:在 c 搜索栏中使用 site:sampledomain.com 这个语法结构。比如,在斯坦福找申请信息,输入:
    admission site:www.stanford.edu

    6 、查找字典释意
    查找字典释意的方法是在搜索栏中输入你要查询的内容。在我们根据要求找到所有的字典释意都会标有下划线,位于搜索结果的上面,点击链接你会找到字典提供者根据要求给出的相关定义。 7 、用 GOOLGE 查找地图
    想用 Google 查找街区地图,在 Google 搜索栏中输入美国街区地址,包括邮递区号或城市 / 州(比如 165 大学大街 PALO ALTO CA )。通常情况下,街区地址和城市的名字就足够了。
    当 Google 识别你的要求是查找地图,它会反馈给你有高质量地图提供者提供的链接,使你直接找到相关地图。我们是以质量为基础选择这些地图提供者。值得注意的是 Google 和使用的地图信息提供者没有任何关联。
     
    ---------------------------------------------------
    核弹 / KernBombe (音译:卡邦) 系统
     
     
  • 下载 youtube 视频办法

    2008-01-30 15:52:40

    下载 youtube 视频办法

     
    [2007-11-24]
    随心所欲!下载YouTube视频的24种方法工具
    http://www.pconline.com.cn/pcedu/softnews/dongtai/0705/1012316.html

    ubuntu 下可以用 youtube-dl 加 qttube
    http://www.lirui.name/post/69.html

    firefox 安装 DownloadHelper 插件
    http://www.lirui.name/post/70.html

    得到 youtube flv文件地址
    得到 youtube flv文件地址
     
     
     
    ---------------------------------------------------
    核弹 / KernBombe (音译:卡邦) 系统
  • 将图片及视频转成ascii码的程序

    2008-01-21 15:59:38

     
     
    将图片及视频转成ascii码的程序
     
     
     
     
    很有趣
     
     
     
    ---------------------------------------------------
    核弹 / KernBombe (音译:卡邦) 系统
  • 编译Xwindows下的汇编代码

    2007-12-21 22:28:59

    编译Xwindows下的汇编代码
    作者:梅 松 于2007-9-16上传

    作者:梅 松   湖北省郧县公安局 442500

      Xwindows?写错了吧,多了个X?

      没错,Xwindows是linux的系统图形界面,而且Xwindows程序也能用汇编写代码!
    不过因为masm不支持跨平台,所以我们选择支持跨平台的编译工具NASM。

      一般介绍NASM的时候先介绍NASM语法,弄的初涉及此领域的爱好者一头雾水,积极性备受打击。这里先我们教大家编译出第一个linux下的图形hello world!程序,以提高大家学习的兴趣 :)。

      首先需要您的linux系统中安装有GCC和NASM包,没有的话请安装它们(安装方法网上有教程的)。其次需要您有编辑NASM代码的编辑器(linux下的编辑器多如牛毛,随便一个都行的)。另外需要您有极大的热情,呵呵。

      我们把下面这段代码粘贴到编辑器里,以2.asm存盘。


    ; 2.asm
    ; assemble:
    ; nasm -f elf -o 2.o 2.asm
    ;
    ; link:
    ; gcc -s -nostartfiles -o 2.bin 2.o -L/usr/X11R6/lib -lX11
    ;
    ; run:
    ; ./2.bin
    ;

          ; handy constants
          ;
        NULL equ 0

          ; make entry-point "global" so linker can see it
          ;
          global _start

          ; Xlib API functions
          ; (Xlib is a C library for programming X)
          ;
          ; All API are C functions and follow the usual C
          ; conventions...Xlib is meant for C coding, really,
          ; but, of course, ASM can access anything it likes
          ; so I'm "borrowing" the C library to make the
          ; programming shorter and easier :)
          ;
          extern XOpenDisplay
          extern XDisplayName
          extern XCloseDisplay
          extern XDefaultRootWindow
          extern XCreateSimpleWindow
          extern XDestroyWindow
          extern XSelectInput
          extern XMapWindow
          extern XNextEvent

          ; constants to do with the "events"
          ; but this program is very boring and only
          ; looks for the "KeyPress" event that I'm
          ; only bothering to define the constants
          ; for that and ignoring all the others...
          ;
          %define KeyPressMask 1
          %define KeyPress 2

          ; data section
          ;
          section .data

    StringOpenFailed db 0Ah, "Error: Cannot open display!"

      Display dd 0 ; Display "handle" (actually a pointer)

       Window dd 0 ; Window "handle"

       event times 24 dd 0 ; "event" structure (unlike Windows,
                  ; every event is actually has
                  ; variable-length data associated with
                  ; it...it's simply convenience, though,
                  ; to make one structure big enough for
                  ; any message and to "re-use" it...a
                  ; touch of "laziness" there for easy
                  ; implementation ;)

          ; code section
          ;
          section .text

      _start:
          ; Connect to X
          ;
          ; The parameter is to specify which X to connect to,
          ; as X is capable of working across networks, as well
          ; as locally...so, for example, I could pop in Frank's
          ; IP address or something (would need to arrange this
          ; with Frank, obviously, to make sure it's running and
          ; I have "permissions" to do it :) and then the
          ; application would be running on my machine but the
          ; windows and stuff popping up on Frank's machine...
          ;
          ; You could also potentially connect to multiple X
          ; "displays" at the same time, as the "return value"
          ; is a "handle" (well, actually a pointer to a
          ; "display" structure...but this is meant to be "opaque"
          ; that the application just uses it like a "file
          ; handle"...which, after all, is an index into the file
          ; descrīptor table, in fact, but, again, you're not
          ; really supposed to know that and should just treat it
          ; like an "ID code"...just "some number" which identifies
          ; which "display" you want to access :)...
          ;
          ; In this case, I pass NULL as the parameter, which simply
          ; connects to the "local" X server...so X and the program
          ; run on the same machine...but note that, with X's design,
          ; there is no need to modify the program - other than to
          ; put a proper "display name" as the parameter to say what
          ; machine you want to "connect" the program to - to work
          ; "locally" or "remotely"...X always takes a "client /
          ; server" view regardless, so it's "uniform" wherever the
          ; "X server" resides...
          ;
          push byte NULL
          call XOpenDisplay
          add esp, 4

          ; Check if returned "handle" is NULL, as that's the "failure"
          ; indicator and jump on error to the code to print the error
          ; to the user...
          ;
          cmp eax, byte NULL
          je near OpenFailed

          ; Copy returned display "handle" into variable
          ;
          mov [ Display ], eax

          ; Create "simple window" call
          ;
          ; X provides a more complicated "XCreateWindow" but
          ; also supplies "XCreateSimpleWindow" which "borrows"
          ; many of the parameters from the "parent" window...
          ; a time-saver if, as in this simple example, we don't
          ; particularly care about anything "fancy"...
          ;
          push byte 0 ; background colour
          push byte 0 ; border colour
          push byte 0 ; border width
          push 300 ; height
          push 400 ; width
          push byte 50 ; top co-ord
          push byte 50 ; left co-ord

          ; next parameter for "XCreateSimpleWindow" is the
          ; parent window...so, just sneaking in a quick
          ; API call to "XDefaultRootWindow" which provides
          ; us with the proper "handle" to the desktop window,
          ; which acts as a "parent" for all top-level
          ; windows (it's all very "strictly hierarchical" in
          ; X like that, that the desktop is a "root window"
          ; that's "parent" to all other windows :)
          ;
          push dword [ Display ]
          call XDefaultRootWindow
          add esp, 4
          push eax

          push dword [ Display ] ; display handle
          call XCreateSimpleWindow ; create window
          add esp, 36 ; C clean-up parameters stuff

          ; Again, check call actually worked by seeing if we
          ; got NULL rather than a "window handle"...
          ;
          cmp eax, byte NULL
          je CreateFailed

          ; Store away window "handle" for subsequent use...
          ;
          mov [ Window ], eax

          ; Right, here's something X does that Windows
          ; doesn't...as X can potentially operate over a
          ; network, it is concerned about keeping "bandwidth"
          ; down, where possible...hence, using "XSelectInput"
          ; I can tell X what types of events this application
          ; processes...and, simply, X does not bother to
          ; deliver events that aren't processed by the
          ; application...after all, what's the point? Wastes
          ; "bandwidth" sending them around and the application
          ; isn't going to process it, so you waste all that
          ; time for nothing...
          ;
          ; Indeed, under Windows, where you can't be "selective"
          ; like this, it really does send every single message
          ; every single time...and what does the application do?
          ; Passes it to "DefWindowProc" or, in other words,
          ; "return to sender"...what a dreadful waste of
          ; time, eh? Sending messages that we _KNOW_, ahead of
          ; time, the application is only going to send straight
          ; back to Windows...X's design is a little smarter than
          ; Windows on this: The application uses "XSelectInput"
          ; to say what "events" it does understand and process,
          ; then it only needs to bother going to the effort of
          ; sending them when it's actually something the
          ; application is going to process...rather than doing
          ; the "round-trip" each and every time, as Windows does,
          ; it simply asks up front: "what events do you care
          ; about?" and then doesn't even bother worrying an
          ; application with "events" that it has no interest in...
          ;
          ; This saves "bandwidth" when working over a network
          ; connection...but, then again, it's also a better design
          ; for "local" connections too..."events" may be delivered
          ; very quickly when "local" but, well, it's not "zero time"
          ; to deliver it (this would violate the laws of physics ;),
          ; so it is wasting time needlessly to do it the Windows
          ; way, however small that may be...
          ;
          ; Anyway, I simply ask for the "KeyPress" event only, as
          ; this is a delibrately "brain-dead" simple example program
          ; that does absolutely nothing useful or impressive
          ; whatsoever ;)...
          ;
          push KeyPressMask
          push dword [ Window ]
          push dword [ Display ]
          call XSelectInput
          add esp, 12

          ; Now we "map" the window to the "display"...which sounds
          ; rather "fancy" but just means "ShowWindow", really...
          ; and are just saying "okay, finished setting things up
          ; for the window, please show it on the screen" :)...
          ;
          push dword [ Window ]
          push dword [ Display ]
          call XMapWindow
          add esp, 8

          ; Standard "message loop" of any event-driven program
          ; which just keeps grabbing "events" off the "queue"
          ; and "processing" them...
          ;
    MessageLoop:
          ; Grab the next event off the queue into the "event"
          ; buffer I created in the data section to house the
          ; "event" information...
          ;
          ; Note another Windows / X difference: In Windows,
          ; there are "queued" and "non-queued" messages...the
          ; "non-queued" messages go directly to the "window
          ; procedure" defined by the "window class" registered
          ; for that window...you'll notice that we did not need
          ; to perform any "registering window classes" here...
          ;
          ; Simply, X only has "queued events" throughout...this,
          ; I reckon, is just great because there's no need for
          ; any silly "window classes" and you're not "forced" into
          ; using "window procedures"...it's really very simple:
          ; X provides a "XNextEvent" API which pulls off the next
          ; "event" from the queue...once in the "buffer" you've
          ; allocated for the "event information", it's completely
          ; up to the program how to deal with this...
          ;
          ; So, if a simply program with one window, then you might
          ; just deal with it all directly in the "message loop"
          ; itself...if you prefer the "window procedure" style then
          ; just create an ordinary procedure and then call it,
          ; passing the "event information", for the same
          ; functionality...it's all in the programmer's hands
          ; because X simply provides the "get next event" API and
          ; then the program itself can decide how to process it...
          ;
          push event
          push dword [ Display ]
          call XNextEvent
          add esp, 8

          ; Was "event" a "KeyPress"?
          ; If not, loop around again...
          ;
          cmp dword [ event ], KeyPress
          jne MessageLoop

          ; Destroy the window...
          ;
          push dword [ Window ]
          push dword [ Display ]
          call XDestroyWindow
          add esp, 8

    CreateFailed:
          ; Close the "display"
          ; (e.g. close the connection to X :)
          ;
          push dword [ Display ]
          call XCloseDisplay
          add esp, 4
          jmp Terminate

    OpenFailed:
          ; Print error message if failure to open X "display"
          ; (yes, I was going to put full "error handling" but
          ; then gave up that this is, in fact, the only
          ; condition that gives an error message...a real
          ; program would be better than that, of course...but
          ; after starting with "good intentions", it seemed
          ; too much bother to do it everywhere with the
          ; program and I gave up ;)...
          ;
          mov eax, 4
          mov ebx, 1
          mov ecx, StringOpenFailed
          mov edx, 27
          int 80h
    Terminate:
          ; exit program
          ;
          mov eax, 1 ; function (sys_exit)
          xor ebx, ebx ; exit code
          int 80h ; make Linux system call


      呵呵,不要被吓怕了,汇编代码中每行";"后面的是注释的。和windows程序一样,每个程序中存在创建窗口、消息循环和退出三部分代码的,这段代码也是存在着这些部分的,具体请看注释哦。
      把这段代码保存后我们就要使用编译器编译它成可执行文件啦。在linux的终端按照下面的步骤编译连接它。

    nasm -f elf -o 2.o 2.asm
      gcc -s -nostartfiles -o 2.bin 2.o -L/usr/X11R6/lib -lX11

      请注意:linux中命令行都区分大小写。
    如果没有提示错误的话,可执行文件2.bin就存在本目录中了,我们来运行它!

    ./2.bin

      回车后,哈哈,窗口出来了!有成就感吧!这是您在linux下的成功编译了汇编代码的Xwindows 程序!恭喜您啦。需要程序为您做的更多?来吧,我们一起学习NASM!

      最底层是编辑文挡,光标窗口是终端,黑色的就是我们运行的程序窗口啦

      


      您读了本文后有什么问题可以同作者直接联系,他的联系方式是:
      pmason_rose@msn.com
      332779423@qq.com

      2007年8月18日


    欢迎访问AoGo汇编小站:http://www.aogosoft.com
     
     
     
     
    ---------------------------------------------------
    核弹 / KernBombe (音译:卡邦) 系统
     
  • 实用技巧:轻松设置Wine程序的中文显示 

    2007-11-30 11:55:47

    实用技巧:轻松设置Wine程序的中文显示 
     
    一般情况下,ubuntu 软件仓库里 wine 的版本比较旧,例如在写这篇文章时,ubuntu 7.10 官方源里的 wine 版本是 0.9.46,而最新的已经是 0.9.49 了,所以有必要使用其他的源来安装最新的 wine。

      添加 wine 官方源
    wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | sudo apt-key add -

      For Ubuntu Gutsy (7.10):

      sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/gutsy.list -O /etc/apt/sources.list.d/winehq.list

      For Ubuntu Feisty (7.04):

      sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/feisty.list -O /etc/apt/sources.list.d/winehq.list

      For Ubuntu Edgy (6.10): *不支持 64 位*

      sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/edgy.list -O /etc/apt/sources.list.d/winehq.list

      For Ubuntu Dapper (6.06): *不支持 64 位*

      sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/dapper.list -O /etc/apt/sources.list.d/winehq.list

      For Debian Etch (4.0):

      sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/etch.list -O /etc/apt/sources.list.d/winehq.list

      安装最新的 wine
      sudo apt-get update
      sudo apt-get install wine

      设置 wine
      在安装完成后,先不要运行 wine 来模拟程序,因为 wine 需要进行一些必要的设置,运行

      winecfg

      点 “Audio” 选项卡,按照下图设置,其中 “Sound Drivers” 处需要根据自己的情况来选择合适的驱动,可以按旁边的 “Test Sound” 按钮测试是否成功。

      Google 搜索或到 windows xp 的 Fonts 目录下,把 simsun.ttc (即宋体)复制到 ~/.wine/drive_c/windows/fonts

      把下列内容另存为 fonts.reg,保存到 ~/.wine/ 目录下

      REGEDIT4

     

    [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontSubstitutes]
    "Arial"="simsun"
    "Arial CE,238"="simsun"
    "Arial CYR,204"="simsun"
    "Arial Greek,161"="simsun"
    "Arial TUR,162"="simsun"
    "Courier New"="simsun"
    "Courier New CE,238"="simsun"
    "Courier New CYR,204"="simsun"
    "Courier New Greek,161"="simsun"
    "Courier New TUR,162"="simsun"
    "FixedSys"="simsun"
    "Helv"="simsun"
    "Helvetica"="simsun"
    "MS Sans Serif"="simsun"
    "MS Shell Dlg"="simsun"
    "MS Shell Dlg 2"="simsun"
    "System"="simsun"
    "Tahoma"="simsun"
    "Times"="simsun"
    "Times New Roman CE,238"="simsun"
    "Times New Roman CYR,204"="simsun"
    "Times New Roman Greek,161"="simsun"
    "Times New Roman TUR,162"="simsun"
    "Tms Rmn"="simsun"

     

     

      导入上一步保存的 fonts.reg
      regedit ~/.wine/fonts.reg

      好了,中文显示基本上没有问题了,并且可以用 scim 输入法输入中文。

     

     

    ---------------------------------------------------
    核弹 / KernBombe (音译:卡邦) 系统

     

  • 实例解析 Linux无法添加用户帐号的问题

    2007-11-02 00:14:57

    1.出现问题:

    近日配置linux服务器,在使用useradd命令添加帐号的时候出现“unable to lock password file”的错误,或者“cannot lock shadow password file”的问题。

     

    useradd: unable to lock password file

     

    2.解決方法:

     

    在/etc/目錄下會有passwd.lock、group.lock、gshadow.lock、passwd.lock、shadow.lock的檔案,把它刪除就OK了。

     

    3.具体有什么用呢?

     

    顾名思义就是某人在读取时先锁定文件以防另一个程序又来读取产生错误。

     

    4.产生的原因:

     

    可能是上次用ssh登入改东西改到一半是断线,或者是某些程序也需要存取特定档案。

     

     

    ---------------------------------------------------
    核弹 / KernBombe (音译:卡邦) 系统
  • Linux下Mplayer万能播放器的设置

    2007-11-02 00:13:06

    linux 下mplayer 中文字幕配置

     

    修改 ~/.mplayer/config

     

    # Write your default config options here!

     

    # 视频输出以xv模式,启用视频加速

     

    vo=xv

     

    # 字幕字体文件

     

    font = /usr/share/fonts/zh_CN/TrueType/hei.ttf

     

    # 字幕编码 (使用TTF字体时使用)

     

    subcp = cp936

     

    # 0 不自动缩放; 1 按电影高度缩放; 2 按宽度; 3 按对角线

     

    subfont-autoscale = 2

     

    # 字幕字体大小

     

    subfont-text-scale = 4

     

    # 设置OSD元素的自动绽放系数

     

    subfont-osd-scale = 6

     

    font=/home/simsun.ttf

    subcp=cp936

    subfont-autoscale=1 #这是控制自动装载字幕的,2和0都是不自动

    subfont-text-scale=7#字体大小

     

    有时侯用命令行的没有字幕,可以试一试快捷键“v”,和 “b”

     

    用命令行时字符集别用unicode,用gb2312或者cp936都行

     

    gui模式出现modoul 11 error,不知道原因。重新编译中

     

    下面这篇文章是参考:

    让mplayer支持中文字幕的解决方案

     

    apt-get install mplayer后,播放一些带中文字幕的电影老显示不了中文字,会出现诸如:“___Ants,_____”的玩意,看了不少文档,终于搞定,下面总结一番

     

    A~命令行方式播放:

    这是我的~/.mplayer/config

    # Write your default config options here!

    font=/usr/share/fonts/truetype/hiweed/simsun.ttf

    subcp=cp936

    subfont-autoscale=2

    subfont-text-scale=5

    vo=xv

     

    然后,命令行输入mplayer aaa.avi,(前提是同目录下有同名字幕文件)。就OK了。

     

    B~至于窗口模式,我采用以下方法也解决:

    1.rm -rf /usr/share/mplayer/font/*

    2.rm -rf ~/.mplayer/font/*

     

    上面两步让gmplayer找不到那些英文字体,呵呵,就让它乖乖地用我们指定的字体:

     

    3.ln -s /YOUR/PATH/TO/CHINESEFONT.ttf subfont.ttf

    4.修改~/.mplayer/gui.conf如下项目:

    sub_auto_load = "yes"

    sub_unicode = "yes"

    sub_pos = "100"

    sub_overlap = "no"

    sub_cp = "cp936"

    font_factor = "0.750000"

    font_name = "/home/badants/.mplayer/subfont.ttf"

    font_encoding = "unicode"

     

    然后,打开gmplayer,试试看,能不能成功。

    (责任编辑:A6)

    来源:赛迪网 作者:kit 发布时间:2007-11-01

     

     

    ---------------------------------------------------
    核弹 / KernBombe (音译:卡邦) 系统
  • 在Linux中 如何将LCD的刷新率降至 60Hz

    2007-11-02 00:11:42

    在Linux中只要正确安装了显卡驱动,系统都会自动调到显示器能支持的最高刷新率,这对CRT来说没有问题,但用LCD的人就受不了了.下面的方法能够有效解决这个问题.

     

    修改/etc/X11/xorg.conf (大概现在都用xorg了吧,如果不是的话xfree86也是一样的):

     

    在section "monitor"这块,加入

    Option "DPMS"

     

    Modeline ......

     

    其中Modeline一行由gtf命令得出,如:

     

    $ gtf 1024 768 85 (1024x768分辩率,85刷新率)

     

    系统输出:

    # 1024x768 @ 85.00 Hz (GTF) hsync: 68.60 kHz; pclk: 94.39 MHz

     

    Modeline "1024x768_85.00" 94.39 1024 1088 1200 1376 768 769 772 807 -HSync +Vsync

     

    这种方法可以得到任何分辩率和刷新率,只要你的系统支持。

     

    经测试,在多种发行版上有效。

    (责任编辑:A6)

    来源:赛迪网 作者:sixth 发布时间:2007-11-01

     

     

    ---------------------------------------------------
    核弹 / KernBombe (音译:卡邦) 系统

     

  • aMule 服务器列表

    2007-10-16 10:03:54

    aMule 服务器列表

    Linux 中使用 aMule 一定要在服务器列表设置里加上下面一句,能省你不少找服务器列表的时间。

    http://www.emule.org.cn/server.met


    这其实就是 VeryCD 电骡里的设置,记下来免得以后重装系统时忘记。
     
     
     
    ---------------------------------------------------
    核弹 / KernBombe (音译:卡邦) 系统
  • 用 C 语言编写一个网络蜘蛛

    2007-10-09 02:14:40

    用 C 语言编写一个网络蜘蛛来搜索网上出现的电子邮件地址


    作者:zhoulifa
    来源:http://bbs.chinaunix.net/viewthread.php?tid=821361

    可 能大家经常要去互联网上搜索特定的内容,比如收集大量邮件地址,如果用 google 之类的搜索引擎是没法实现这种特定功能的,所以用 C 语言来写一个吧。它的功能就是不断去取得网络上的页面,然后分析出网页上出现的邮件地址保存下来。象个蜘蛛一样,从网络上一个网页爬向另一个网页,不停止 地搜索邮件地址。

     



    即:分析程序运行时的参数,把各网页地址作为根节点加入到链表,然后从链表头开始处理各节点

    对整个链表的处理是先处理兄弟节点,流程图如下:




    然后再处理各节点的子节点,流程图如下:



    当然,这里采用了递归调用方法,处理子节点的数据时和处理整个链表一样循环处理就是了。

    /************关于本文档********************************************
    *filename: 用 C 语言编写一个网络蜘蛛来搜索网上出现的电子邮件地址
    *purpose: 一个邮址搜索程序的雏形
    *wrote by: zhoulifa(zhoulifa@163.com) 周立发(http://zhoulifa.bokee.com)
    Linux爱好者 Linux知识传播者 SOHO族 开发者 最擅长C语言
    *date time:2006-08-31 21:00:00
    *Note: 任何人可以任意复制代码并运用这些文档,当然包括你的商业用途
    * 但请遵循GPL
    *Hope:希望越来越多的人贡献自己的力量,为科学技术发展出力
    *********************************************************************/

    程序在运行的过程中要建立一个树形链表结构,结构图如下:




    程序启动时分析所带参数,把各参数加入到根网页节点,如果有多个参数则这个根网页有兄弟节点。
    然后从根节点开始处理这一级上各节点,把各节点网页上出现的网页链接加到该节点的子节点上,处理完当前这一级后处理子节点这一级。



    当然这只是一个原理展示程序,并没有进行优化。

    这个程序的 main 函数流程图如下:

     源代码如下: 

     

     

    #include <sys/types.h>
    #include 
    <sys/stat.h>
    #include 
    <fcntl.h>
    #include 
    <sys/mman.h>
    #include 
    <unistd.h>
    #include 
    <stdio.h>
    #include 
    <string.h>
    #include 
    <stdlib.h>
    #include 
    <netdb.h>
    #include 
    <errno.h>
    #include 
    <locale.h>

    #define USERAGENT "Wget/1.10.2"
    #define ACCEPT "*/*"
    #define ACCEPTLANGUAGE "zh-cn,zh;q=0.5"
    #define ACCEPTENCODING "gzip,deflate"
    #define ACCEPTCHARSET "gb2312,utf-8;q=0.7,*;q=0.7"
    #define KEEPALIVE "300"
    #define CONNECTION "keep-alive"
    #define CONTENTTYPE "application/x-www-form-urlencoded"

    #define MAXFILENAME 14
    #define DEBUG 1

    typedef 
    struct webnode {
            
    char * host;                 /* 网页所在的主机 */
            
    int port;                    /* 网络服务器所使用的端口 */
            
    char * dir;                  /* 网页所在的目录 */
            
    char * page;                 /* 网页文件名 */
            
    char * file;                 /* 本地保存的文件名 */
            
    char IsHandled;              /* 是否处理过 */
            
    struct webnode * brother;    /* 兄弟节点链表指针 */
            
    struct webnode * child;      /* 子节点链表指针 */
    } WEBNODE;

    struct sockaddr_in server_addr;
    int sockfd = 0, dsend = 0, totalsend = 0, nbytes = 0, reqn = 0, i = 0, j = 0, ret = 0;
    struct hostent *host;
    char request[409600= "", buffer[1024= "", httpheader[1024= "";
    int FileNumber = 0;
    char e[2= "@/";
    WEBNODE 
    * NodeHeader, * NodeTail, * NodeCurr;
    char * mapped_mem;

    int GetHost(char * , char ** , char ** , int * , char ** ); /**/
    void AnalyzePage(WEBNODE *); /**/
    void AddInitNode(char *char *intchar * ); /**/
    void HandleInitNode(WEBNODE *); /**/
    void DisplayNode(WEBNODE *); /**/
    void HandOneNode(WEBNODE *); /**/
    void DoneWithList(int); /**/
    void DoOnce(); /**/
    void ConnectWeb(void); /**/
    void SendRequest(void); /**/
    void ReceiveResponse(void); /**/
    void GetEmail(char * ); /**/
    void GetLink(char * ); /**/
    void GetBeforePos(char * , char ** ); /**/
    void GetAfterPos(char * , char ** ); /**/
    void AddChildNode(WEBNODE * , char * ); /**/
    void GetAfterPosWithSlash(char * , char ** ); /**/
    void GetMemory(char ** , int ); /**/
    int IsExistWeb(WEBNODE * , char * , char * , int , char * ); /**/
    void Rstrchr(char * , int , char ** ); /**/
    int GetLocalAgent(char * UserAgent, char * Accept, char * AcceptLanguage, char * AcceptEncoding, char * AcceptCharset, char * KeepAlive, char * Connection, char * ContentType); /**/

     

    /**************************************************************
    功能:设置 HTTP 协议头内容的一些固定值
    **************************************************************
    */
    int GetLocalAgent(char * UserAgent, char * Accept, char * AcceptLanguage, char * AcceptEncoding, char * AcceptCharset, char * KeepAlive, char * Connection, char * ContentType)
    {
      memcpy(UserAgent, USERAGENT, strlen(USERAGENT));
      memcpy(Accept, ACCEPT, strlen(ACCEPT));
      memcpy(AcceptLanguage, ACCEPTLANGUAGE, strlen(ACCEPTLANGUAGE));
      memcpy(AcceptEncoding, ACCEPTENCODING, strlen(ACCEPTENCODING));
      memcpy(AcceptCharset, ACCEPTCHARSET, strlen(ACCEPTCHARSET));
      memcpy(KeepAlive, KEEPALIVE, strlen(KEEPALIVE));
      memcpy(Connection, CONNECTION, strlen(CONNECTION));
      memcpy(ContentType, CONTENTTYPE, strlen(CONTENTTYPE));
      
    return 0;
    }

    /**************************************************************
    功能:在字符串 s 里搜索 x 字符,并设置指针 d 指向该位置
    **************************************************************
    */
    void Rstrchr(char * s, int x, char ** d)
    {
            
    int len = strlen(s) - 1;
            
    while(len >= 0)        {
                    
    if(x == s[len]) {(*d) = s + len; return;}
                    len
    --;
            }
            (
    *d) = 0;
    }

    /**************************************************************
    功能:连接一个网站服务器
    **************************************************************
    */
    void ConnectWeb(void) { /* connect to web server */
      
    /* create a socket descrīptor */
      
    if((sockfd=socket(PF_INET,SOCK_STREAM,0))==-1)
      {
        fprintf(stderr,
    " Socket Error:%sa ",strerror(errno));
        exit(
    1);
      }

      
    /* bind address */
      bzero(
    &server_addr, sizeof(server_addr));
      server_addr.sin_family 
    = AF_INET;
      server_addr.sin_port 
    = htons(NodeCurr->port);
      server_addr.sin_addr 
    = *((struct in_addr *)host->h_addr);

      
    /* connect to the server */
      
    if(connect(sockfd, (struct sockaddr *)(&server_addr), sizeof(struct sockaddr)) == -1)
      {
        fprintf(stderr, 
    " Connect Error:%sa ", strerror(errno));
        exit(
    1);
      }
    }

    /**************************************************************
    功能:向网站发送 HTTP 请求
    **************************************************************
    */
    void SendRequest(void) { /* send my http-request to web server */
      dsend 
    = 0;totalsend = 0;
      nbytes
    =strlen(request);
      
    while(totalsend < nbytes) {
        dsend 
    = write(sockfd, request + totalsend, nbytes - totalsend);
        
    if(dsend==-1)  {fprintf(stderr, " send error!%s ", strerror(errno));exit(0);}
        totalsend
    +=dsend;
        fprintf(stdout, 
    " Request.%d %d bytes send OK! ", reqn, totalsend);
      }
    }

    /**************************************************************
    功能:接收网站的 HTTP 返回
    **************************************************************
    */
    void ReceiveResponse(void) { /* get response from web server */
      fd_set writefds;
      
    struct timeval tival;
      
    int retry = 0;
      FILE 
    * localfp = NULL;

      i
    =0; j = 0;
    __ReCeive:
      FD_ZERO(
    &writefds);
      tival.tv_sec 
    = 10;
      tival.tv_usec 
    = 0;
      
    if(sockfd > 0) FD_SET(sockfd, &writefds);
      
    else {fprintf(stderr, " Error, socket is negative! "); exit(0);}

      ret 
    = select(sockfd + 1&writefds, NULL, NULL, &tival);
      
    if(ret ==0 ) {
        
    if(retry++ < 10goto __ReCeive;
      }
      
    if(ret <= 0) {fprintf(stderr, " Error while receiving! "); exit(0);}

      
    if(FD_ISSET(sockfd, &writefds))    {
        memset(buffer, 
    01024);
        memset(httpheader, 
    01024);
        
    if((localfp = fopen(NodeCurr->file, "w")) == NULL) {if(DEBUG) fprintf(stderr, "create file '%s' error ", NodeCurr->file); return;}
        
    /* receive data from web server */
        
    while((nbytes=read(sockfd,buffer,1))==1)
        {
          
    if(i < 4)  { /* 获取 HTTP 消息头 */
            
    if(buffer[0== ' ' || buffer[0== ' ')  i++;
            
    else i = 0;
            memcpy(httpheader 
    + j, buffer, 1); j++;
          }
          
    else  { /* 获取 HTTP 消息体 */
            fprintf(localfp, 
    "%c", buffer[0]); /* print content on the screen */
            
    //fprintf(stdout, "%c", buffer[0]); /* print content on the screen */
            i++;
          }
        }
        fclose(localfp);
      }
    }

    /**************************************************************
    功能:执行一次 HTTP 请求
    **************************************************************
    */
    void DoOnce() { /* send and receive */
      ConnectWeb(); 
    /* connect to the web server */

      
    /* send a request */
      SendRequest();

      
    /* receive a response message from web server */
      ReceiveResponse();

      close(sockfd); 
    /* because HTTP protocol do something one connection, so I can close it after receiving */
    }

    /**************************************************************
    功能:执行 HTTP 请求
    **************************************************************
    */
    void DoneWithList(int flag) {
      
    if(flag) fprintf(stdout, " Request.%d is: %s"++reqn, request);

      DoOnce();

      
    if(flag) fprintf(stdout, " The following is the response header: %s", httpheader);
    }

    /**************************************************************
    功能:从字符串 src 中分析出网站地址和端口,并得到文件和目录
    **************************************************************
    */
    int GetHost(char * src, char ** web, char ** file, int * port, char ** dir)  {
      
    char * pA, * pB, * pC;
      
    int len;

      
    *port = 0;
      
    if(!(*src))  return -1;
      pA 
    = src;
      
    if(!strncmp(pA, "http://", strlen("http://")))  pA = src+strlen("http://");
      
    /* else if(!strncmp(pA, "https://", strlen("https://")))  pA = src+strlen("https://"); */
      
    else return 1;
      pB 
    = strchr(pA, '/');
      
    if(pB)  {
        len 
    = strlen(pA) - strlen(pB);
        GetMemory(web, len);
        memcpy((
    *web), pA, len);
        
    if(*(pB+1))  {
          Rstrchr(pB 
    + 1'/'&pC);
          
    if(pC) len = strlen(pB + 1- strlen(pC);
          
    else len = 0;
          
    if(len > 0) {
            GetMemory(dir, len);
            memcpy((
    *dir), pB + 1, len);

            
    if(pC + 1) {
              len 
    = strlen(pC + 1);
              GetMemory(file, len);
              memcpy((
    *file), pC + 1, len);
            }
            
    else {
              len 
    = 1;
              GetMemory(file, len);
              memcpy((
    *file), e, len);
            }
          }
          
    else {
            len 
    = 1;
            GetMemory(dir, len);