Time of Update: 2018-07-29
當我們在用戶端使用ssh登入伺服器時,輸入的命令往往比較麻煩,比如“ssh root@111.111.111.111”. 如果你要管理多個IP,記住這些IP真的是太難了。還好我們可以使用別名來替代這些難記的IP,使用類似“ssh root@server1”這種方式來登入伺服器,是不是很方便呢。 下面分別介紹在mac和linux上的配置。
Time of Update: 2018-07-29
防火牆配置 CentOS 7預設使用的是firewall作為防火牆,這裡改為iptables防火牆。 firewall操作: # service firewalld status; #查看防火牆狀態 (disabled 表明 已經禁止開啟啟動 enable 表示開機自啟,inactive 表示防火牆關閉狀態 activated(running)表示為開啟狀態) # service firewalld start;
Time of Update: 2018-07-29
Linux中有個ntp包可以自動校準時間,並且非常好用。 Debian系統安裝NTP校時包: 1 apt-get install ntpdate CentOS系統安裝NTP校時包: 1 yum install ntp 校時命令: 1 ntpdate cn.pool.ntp.org
Time of Update: 2018-07-29
轉自:http://www.cnblogs.com/oloroso/p/5407779.html 編譯QT是一件比較麻煩的事情。所以如果沒有必要,就不要編譯了。如果你只需要使用QT的一些準系統,那麼就只編譯源碼目錄下的qtbase目錄下的東西即可。 下面所介紹的都只是在linux下適用的(windows下使用MinGW也可以,QT提供的MinGW安裝包是32位的,需要64位的可以參考)。
Time of Update: 2018-07-30
Linux系統上針對rm命令做審計 [root@test ~]# cat /etc/audit/audit.rules# This file contains the auditctl rules that are loaded # whenever the audit daemon is started via the initscripts. # The rules are simply the parameters that would be passed # to
Time of Update: 2018-07-29
如果你碰到類似的錯誤提示 ulimit: max user processes: cannot modify limit: 不允許的操作 ulimit: open files: cannot modify limit: 不允許的操作 為啥root使用者是可以的。普通使用者又會遇到這樣的問題。 看一下/etc/security/limits.conf大概就會明白。 linux對使用者有預設的ulimit限制,而這個檔案可以配置使用者的硬配置和軟配置,硬配置是個上限。
Time of Update: 2018-07-30
一、匯出資料庫用mysqldump命令(注意mysql的安裝路徑,即此命令的路徑): 1、匯出資料和表結構: mysqldump -u使用者名稱 -p密碼 資料庫名 > 資料庫名.sql #/usr/local/mysql/bin/ mysqldump -uroot -p abc > abc.sql 敲斷行符號後會提示輸入密碼 2、只匯出表結構 mysqldump -u使用者名稱 -p密碼 -d 資料庫名 > 資料庫名.sql
Time of Update: 2018-07-30
一. Linux修改profile檔案改錯了,恢複的方法 在改profile的時候,改出問題了,除了cd以外的命令基本都不能用了, 連vi都不能用了,上網查了下, 用export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin,
Time of Update: 2018-07-30
On x86 platform, there are many ways to get cache information from a running Linux system. For example, by checking /proc/cpuinfo, or by using tools, like dmidecode, lshw, hwloc, etc. But don’t forget “Everything is a file. From my opinion, the
Time of Update: 2018-07-30
jdk的下載:(以jdk 8u101為例) 這裡我的是64位的系統,如果不知道是多少位,可以用 getconf LONG_BIT 查看自己的系統位元。 我是直接用fidder在本地瀏覽器上查看源碼的。然後找到的url是:
Time of Update: 2018-07-30
mmap在linux哪裡。 什麼是mmap。 上圖說了,mmap是操作這些裝置的一種方法,所謂操作裝置,比如IO連接埠(點亮一個LED)、LCD控制器、磁碟控制卡,實際上就是往裝置的物理地址讀寫資料。 但是,由於應用程式不能直接操作裝置硬體地址,所以作業系統提供了這樣的一種機制——記憶體映射,把裝置地址映射到進程虛擬位址,mmap就是實現記憶體映射的介面。 操作裝置還有很多方法,如ioctl、ioremap
Time of Update: 2018-07-30
主要內容:匿名管道,命令管道。(pipe, popen, mkfifo等函數) 管道簡介: 管道是進程之間通訊的一種方式,就相當於是兩個進程之間有一條地道,可以通過地道來傳遞資訊; 管道位於進程的地址空間之外;管道分為匿名管道和具名管道兩種; 匿名管道是由pipe來建立的,具名管道是由mkfifo來建立的; #include <unistd.h>int pipe(int pipefd[2]);
Time of Update: 2018-07-30
遇到的問題: 1.-bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf8) Sovled: locale-gen en_US.UTF-8 update-local en_US.UTF-8 2.en_US.UTF-8... cannot open locale definition file `translit_neutral': No such file or directory
Time of Update: 2018-07-30
1、查看當前登入使用者 [wilsh@lcl ~]$ whatis ww (1) - Show who is logged on and what they are doing[wilsh@lcl ~]$ w 09:49:30 up 1 day, 17:19, 4 users, load average: 0.00, 0.00, 0.
Time of Update: 2018-07-30
http://www.cppblog.com/tx7do/archive/2014/05/29/207141.html
Time of Update: 2018-07-30
1.vim代碼編輯工具,解決vi編寫代碼時,方向鍵出現不相容問題 sudo apt-get install vim 2.minicom串口調試工具,與嵌入式開發板串口調試 sudo apt-get install minicom 3.nfs伺服器安裝,用於主機與開發板檔案傳輸 sudo apt-get install nfs-kernel-server#安裝伺服器端 sudo apt-get install nfs-commom#安裝用戶端
Time of Update: 2018-07-30
前面我們學習了字元裝置結構體cdev Linux 字元裝置驅動開發 (一)—— 字元裝置驅動結構(上) 下面繼續學習字元裝置另外幾個重要的資料結構。 先看下面這張圖,這是Linux 中虛擬檔案系統、一般的裝置檔案與裝置驅動程式值間的函數調用關係;
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
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-31
直接改iptables配置就可以了:vim /etc/sysconfig/iptables 1、關閉所有的 INPUT FORWARD OUTPUT 只對某些連接埠開放。 下面是命令實現:iptables -P INPUT DROPiptables -P FORWARD DROPiptables -P OUTPUT DROP再用命令 iptables -L -n 查看 是否設定好, 好看到全部 DROP 了這樣的設定好了,我們只是臨時的, 重啟伺服器還是會恢複原來沒有設定的狀態還要使用