Time of Update: 2018-07-30
Task: Display current BASH prompt (PS1) Use the echo command to display current BASH prompt:$ echo $PS1 Sample outputs: [\\u@\h \\W]\\$ Here is another output from my Debian based system:$ echo $PS1 Sample outputs: \[\e]0;\u@\h:
Time of Update: 2018-07-30
Linux基本環境設定 這裡我們有幾個東西需要設定: * 靜態ip: 為什麼需要設定靜態ip(通常使用linux系統都是需要提供服務的,作為伺服器都需要固定的IP地址,就是靜態IP地址。這樣,用戶端才能正常訪問這個Linux伺服器。) * Hostname: 主機名稱,當主機很多的時候,就需要能夠很清晰的區分不同的主機 * 網路映射:主機名稱和其ip之間的映射 * DNS網域名稱解析 連結外網 :需要網關的配置
Time of Update: 2018-07-30
轉自:http://andyniu.iteye.com/blog/1965571 core dump的概念: A core dump is the recorded state of the working memory of a computer program at a specific time, generally when the program has terminated abnormally (crashed). In practice,
Time of Update: 2018-07-30
首先我們看一下一個主流多隊列網卡(E1000)跟多核CPU之間的關係圖: 非多隊列: linux的網卡由結構體net_device表示,一個該結構體對應一個可以調度的資料包發送隊列。 資料包的實體在核心中以結構體sk_buff(skb),形如: 多隊列: 一個網卡可以擁有多個隊列 接下來,看看TX引擎是如何工作的(註:對於發送和接收資料包有兩個名詞,分別應對TX,RX) 解釋:
Time of Update: 2018-07-30
以下內容來自 linux beginning programming #include <unistd.h> #include <stdlib.h> #include <curses.h> int main() { WINDOW *new_window_ptr; WINDOW *popup_window_ptr; int x_loop; int y_loop; char a_letter = 'a'; initscr();
Time of Update: 2018-07-30
準備篇 1、配置防火牆,開啟80連接埠、3306連接埠 vi /etc/sysconfig/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT #允許80連接埠通過防火牆 -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT #允許3306連接埠通過防火牆
Time of Update: 2018-07-30
一、設定VNC軟體能從其他機器,遠端連線到linux系統的介面,僅需要兩步設定: 1、設定允許遠端存取,如下圖: 2、關閉防火牆,並設定開機不啟動: 使用VNC輸入ip,即可遠端存取。 二、使用SSH Secure Shell 遠端連線linux系統: 1、將遠程linux系統防火牆關閉,輸入ip,密碼即可訪問。 三、使用ssh secure file transfer上傳下載檔案時報出encountered 1 errors
Time of Update: 2018-07-30
int setitimer(int which, const struct itimerval *value, struct itimerval *ovalue)); setitimer()第一個參數which指定定時器類型: ITIMER_REAL : 以系統真實的時間來計算,它送出SIGALRM訊號。 ITIMER_VIRTUAL : -以該進程在使用者態下花費的時間來計算,它送出SIGVTALRM訊號。 ITIMER_PROF :
Time of Update: 2018-07-30
LINUX核心中的xx_initcall初始化標號 田海立@CSDN 2011-07-02 LINUX核心中有很多的初始化指示標誌postcore_initcall(), arch_initcall(), subsys_initcall(), device_initcall(), etc. 這些起什麼作用呢。查閱原始碼(android
Time of Update: 2018-07-30
以下內容摘自 beginning linux programming 一書 編譯時間加上 -lncurses選項 #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <curses.h> int main() { int i; initscr(); if(!has_colors()) { endwin();
Time of Update: 2018-07-30
Lockdep是核心檢測deadlock的手段,預設沒有開啟,需要make menuconfig增加配置開啟,在Hacking Kernel選項下面Y選擇如下配置 1. [*] Detect Hard and Soft Lockups 2. [*] Detect Hung Tasks 3. [*] RT Mutex debugging, deadlock detection 4. -*- Spinlock and rw-lock debugging: basic checks 5.
Time of Update: 2018-07-30
01 SIGHUP 掛起(hangup) 02 SIGINT 中斷,當使用者從鍵盤按^c鍵或^break鍵時 03 SIGQUIT 退出,當使用者從鍵盤按quit鍵時 04 SIGILL 非法指令 05 SIGTRAP 跟蹤陷阱(trace trap),啟動進程,跟蹤代碼的執行 06 SIGIOT IOT指令 07 SIGEMT EMT指令 08 SIGFPE 浮點運算溢出 09 SIGKILL
Time of Update: 2018-07-30
線程:是在某個進程中被建立的,而它達到生命週期都在這個進程中。 線程它允許一個進程執行一個或多個執行路徑(即1個進程可以有多個線程,來執行不同的程式),這些執行路徑由系統非同步調度。 進程有自己的資料區段,程式碼片段,堆棧段。 而線程與進程的區別: 1. 程式碼片段一樣 2.資料區段一樣(全域變數)。 3.棧堆段不一樣!!!!! 建立線程的函數:
Time of Update: 2018-07-30
1.下載交叉編譯器 ftp://ftp.arm.linux.org.uk/pub/armlinux/toolchain/ 選擇cross-3.2.tar.bz2或cross-3.2.tar.gz(此處我選cross-3.2.tar.gz)arm-linux-gcc-3.4.1.tar.bz2http://www.handhelds.org/download/projects/toolchain/arm-linux-gcc-3.4.1.tar.bz2 2.解包安裝
Time of Update: 2018-07-30
說道“動態庫版本相容”,很多人頭腦中首先蹦出的就是“Dll Hell”。啊,這曾經讓人頭疼的難題。時至今日,這個難題已經很好地解決了。 在進一步討論之前來思考一個問題:Linux下為什麼沒有讓人頭痛的“DllHell”。 回答這個問題,非常easy,因為——Linux下根本沒有dll。 哈哈,當然這隻是個玩笑,接下來展開一下這個話題,很多有動態庫的系統都會面臨這個難題,但各自解決的思路卻各不相同。 Dll hell是指windows
Time of Update: 2018-07-30
我們修改readme.txt檔案,如: Git is a distributed version control system.Git is free software. 要瞭解倉庫目前狀態,可用“ git status ”,如: $ git status# On branch master# Changes not staged for commit:# (use "git add <file>..." to update what
Time of Update: 2018-07-30
Linux防火牆內的策略動作有REJECT和DROP兩種,區別如下: 1.、REJECT動作會返回一個拒絕(終止)資料包(TCP FIN或UDP-ICMP-PORT-UNREACHABLE),明確的拒絕對方的串連動作。 串連馬上斷開,Client會認為訪問的主機不存在。 REJECT在IPTABLES裡面有一些返回參數,參數如下:ICMP port-unreachable、ICMP echo-reply 或是
Time of Update: 2018-07-30
環境變數: export P4PASSWD=abcdefg export P4CLIENT=dyoldfish.com //這個是workspce export P4USER=dyoldfish export P4PORT=192.168.1.198:1666 命令: 1、p4 client #配置本地資訊,檔案下載在哪裡在這裡面配置,Root項 2、p4 sync #從perforce
Time of Update: 2018-07-30
stty時一個用來改變並列印終端行設定的常用命令 1,在命令列下,禁止輸出大寫的方法 stty iuclc #開啟 stty -iuclc #恢複 2,在命令列下禁止輸出小寫 stty olcuc #開啟 stty -olcuc#恢複 3,列印出終端的行數和列數 stty size 4,改變ctrl+D的方法: stty eof "string" 系統預設是ctrl+D來表示檔案的結束,而通過這種方法,可以改變!
Time of Update: 2018-07-30
準備工作 [root@centos-01 ~]# cd /tmp/[root@centos-01 tmp]#