Time of Update: 2018-12-04
linux終端與vi中文設定#uname -aLinux localhost.localdomain 2.6.9-42.ELsmp #1 SMP Sat Aug 12 09:39:11 CDT 2006 i686 i686 i386 GNU/Linux 1. 控制台終端顯示中文修改 /etc/sysconfig/i18n
Time of Update: 2018-12-04
以下操作均由sybase使用者來做:建立一個指令檔,譬如/sybase/script/dump.sh類容如下$ cat dump.sh/sybase/OCS-12_5/bin/isql -Usa -P******* -S******* -i /sybase/script/dump.sql -o /sybse/script/dump.logmv /caiwubackup/backup/cwbase1.bak /caiwubackup/backup/cwbase1_`date
Time of Update: 2018-12-04
Arm9-linux-2.6.30.4X264進行yuv420視頻轉換。 進行各種嘗試結果出錯:[root@EmbedSky /media]# ./x264 -o qq.264 foreman_qcif.yuv 176X144raw [error]: raw input requires a resolution.x264 [error]: could not open input file `foreman_qcif.yuv' 然後再網上看到一段經典的話:raw [error]: raw
Time of Update: 2018-12-04
為網路上的使用者提供時間服務,即為網路使用者返回伺服器的目前時間;記錄發出請求的網路使用者的IP地址(儲存到檔案中);編寫時間服務用戶端timeclient,該用戶端能夠向伺服器發送時間服務要求,並把獲得的時間返回給使用者。開發環境:fedora13,vim,gcctimeserver.c檔案。#include<stdio.h>#include<unistd.h>#include<sys/types.h>#include<sys/socket.h>
Time of Update: 2018-12-04
分別採用TCP或UDP協議編寫一個遠端資料備份伺服器,運行用戶端將本地檔案備份到遠端伺服器中。伺服器的功能:接受用戶端請求,把用戶端的檔案進行備份(可以備份到指定的檔案夾)。用戶端的功能:與遠程伺服器進行串連,在串連後把本地的檔案發送給遠程備份伺服器。開發環境:fedora13,vim,gcccopyserver.c檔案#include<stdio.h>#include<unistd.h>#include<sys/stat.h>#include<fcnt
Time of Update: 2018-12-04
主目錄(也就是~)下有.bash_profile和.bashrc。 .bash_profile是login shell用的,好像是純命令列(不是gui的console)和遠程登入的shell。 .bashrc就是non login shell用的,一般gui的shell環境變數設定在這裡。 PATH 找可執行程式的路徑 這樣設定export PATH=$PATH:$HOME/bin:$HOME/usr/local/bin LD_LIBRARY_PATH 載入動態連結程式庫的路徑
Time of Update: 2018-12-04
1、網路攝影機(Webcam)驅動說明; 網路攝影機在Windows的驅動極為容易,最多是點幾下滑鼠,沒有什麼太大的難度。但在Linux中,驅動起來是有點困難,這並不是說Linux多高雅。只能說開發商唯利是圖,沒有好處的事,他們的確不怎麼積極。Linux 的使用者比較少,所以他們也不把使用者當回事。 目前看來網路攝影機(Webcam)在 Linux
Time of Update: 2018-12-04
第一 聲明和初始化,我在這裡不詳細說明了,請看我上一篇博文,在這裡貼出相應的代碼:#ifndef _LINUX_LIST_H#define _LINUX_LIST_H#define offsetof1(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)#define container_of(ptr, type, member) ( { \ const typeof( ((type *)0)->member )
Time of Update: 2018-12-04
剛剛把hlist有關的函數和宏定義都過了一遍,在此做了一下整理。希望對大家以後學習linux有用,也歡迎大家來拍磚 /*Linux鏈表設計者(認為雙頭(next、prev)的雙鏈表對於HASH表來說"過於浪費",因而另行設計了一套用於HASH表應用的hlist資料結構--單指標表頭雙迴圈鏈表,hlist的表頭僅有一個指向首節點的指標,而沒有指向尾節點的指標,這樣在可能是海量的HASH表中儲存的表頭就能減少一半的空間消耗。*/ //HASH
Time of Update: 2018-12-04
//thrmgr.h#ifndef __THRMGR_H__#define __THRMGR_H__#include <sys/time.h>#include <pthread.h>typedef struct work_item_tag { struct work_item_tag *next; void *data; struct timeval time_queued;} work_item_t;typedef struct work_queue_tag
Time of Update: 2018-12-04
嵌入式Linux的網上資源下載Linux需要的各版本:http://iso.linuxquestions.org/ 1, 標準的Linux版本 (1)Caldera:http://www.calderasystems.com/ (2)Corel:http://linux.corel.com/ (3)Debian:http://www.debian.org.com/ (4)Mandrake:http://www.linux-mandrake.comlen/ (5)Red
Time of Update: 2018-12-04
修改linux的最大檔案控制代碼數限制的方法: 1)ulimit -n 65535 在當前session有效,使用者退出或者系統重新後恢複預設值 2)修改profile檔案:在profile檔案中添加:ulimit -n 65535 只對當個使用者有效 3)修改檔案:/etc/security/limits.conf,在檔案中添加:(立即生效-當前session中運行ulimit -a命令無法顯示)*
Time of Update: 2018-12-04
tc是linux traffic control的簡稱,原理是在協議棧出包的時候,通過qdisc (Queue Discipline)和 filter 機制把不同規則定義的流放到不同class的子qdisc中(對於classful qdisc是這樣,對於classless qdisc只有一個root qdisc)。網上關於tc的資料很多,本篇不去討論tc的各種qdisc, class, filter或者不同的classful/classless
Time of Update: 2018-12-04
CFQ調度器是四種IO Scheduler中最複雜的一個,redhat有個文檔可以做為入門的文檔先瞭解下 red-hat-enterprise-linux-5-io-tuning-guide.pdfThe cfq scheduler maintains a maximum of 64 internal request queues; each process running on thesystem is assigned to any of these queues. Each time a
Time of Update: 2018-12-04
先來看下traffic control在核心裡是如何?的,首先核心在發送資料時,最終會調用到dev_queue_xmit, struct Qdisc *q if (q->enqueue) { rc = __dev_xmit_skb(skb, q, dev, txq); goto out; } 如果q->enqueue函數不為空白,此時就進入traffic control的邏輯,下面調用__dev_xmit_skbstatic
Time of Update: 2018-12-04
例:status = system("./test.sh"); 1、先統一兩個說法:(1)system傳回值:指調用system函數後的傳回值,比如上例中status為system傳回值(2)shell傳回值:指system所調用的shell命令的傳回值,比如上例中,test.sh中返回的值為shell傳回值。2、如何正確判斷test.sh是否正確執行?僅判斷status是否==0?或者僅判斷status是否!=-1? 都錯!3、man中對於system的說明RETURN VALUE
Time of Update: 2018-12-04
You can create a progress bar (progress indicator) when copying/moving files or making backups using thegauge box. It displays a meter along the bottom of the box. The meter indicates the percentage. New percentages are read from standard input, one
Time of Update: 2018-12-04
原始通訊端(SOCK_RAW). 應用原始通訊端,我們可以編寫出由TCP和UDP通訊端不能夠實現的功能.注意原始通訊端只能夠由有 root許可權的人建立. /******************** DOS.c *****************/#include <stdlib.h>#include <stdio.h>#include <errno.h>#include <string.h>#include <
Time of Update: 2018-12-04
要弄清楚Linux PCI裝置驅動,首先要明白,所謂的Linux PCI裝置驅動實際包括Linux PCI裝置驅動和裝置本身驅動兩部分。不知道讀者理不理解這句話,本人覺得這句話很重要,對於PCI、USB這樣的驅動來說,必須要理解這個概念,才能明白該如何看待Linux下的PCI和USB以及類似的匯流排型的驅動。理由也很簡單,就是Linux PCI驅動是核心內建的,或者說核心幫你寫好了!而我們需要完成的就是裝置本身的驅動,比如網卡驅動等。當然,並不是說核心幫咱們寫好了Linux
Time of Update: 2018-12-04
本文接前 篇文章繼續向大家推薦經典的linux編程圖書,本文重點向大家介紹網路編程相關的一些經典書籍。linux網路編程linux網路編程最經典的圖書莫過於W.Richard Stevens的《unix網路編程》,這套書分為兩冊,第一冊主要講解網路編程的socket介面,同時還詳細的介紹了跟編程密切相關的網路基礎理論與 協議,這本書也需要花較多時間才能夠真正掌握,同時它也是一本需要反覆研讀的書,一旦您融匯了該書的知識與技巧,想不會網路編程都不行,強烈五星級推薦