導航:首頁 > 操作系統 > linux下載github文件下載

linux下載github文件下載

發布時間:2022-12-11 08:41:52

㈠ github上面下載的C++代碼怎麼都是readme.md,難道都是必須在linux下運行,不是的話為什麼後綴是.md

你下的不是代碼,而是一個說明文檔……
md文件:http://www.hu.com/question/20958887

㈡ kali linux如何使用GIT clone

在linux下搭建git環境
1、創建Github賬號,https://github.com
2、Linux創建SSH密鑰:

[plain] view plain
01.ssh-keygen ##一直默認就可以了

3、將公鑰加入到Github賬戶信息Account Settings->SSH Key
4、測試驗證是否成功。

[plain] view plain
01.ssh -T [email protected]
02.Hi someone! You've successfully authenticated, but GitHub does not provide shell access.


同步github到本地
1、復制項目到本地:

[plain] view plain
01.git clone git://github.com:xxxx/test.git ##以gitreadonly方式克隆到本地,只可以讀
02.git clone [email protected]:xxx/test.git ##以SSH方式克隆到本地,可以讀寫
03.git clone https://github.com/xxx/test.git ##以https方式克隆到本地,可以讀寫
04.git fetch [email protected]:xxx/xxx.git ##獲取到本地但不合並
05.git pull [email protected]:xxx/xxx.git ##獲取並合並內容到本地


本地提交項目到github
1、本地配置

[plain] view plain
01.git config --global user.name 'onovps'
02.git config --global user.email '[email protected]' #全局聯系方式,可選

2、新建Git項目並提交到Github。

[plain] view plain
01.mkdir testdir & cd testdir
02.touch README.md
03.git init #初始化一個本地庫
04.git add README.md #添加文件到本地倉庫
05.git rm README.md #本地倒庫內刪除
06.git commit -m "first commit" #提交到本地庫並備注,此時變更仍在本地。
07.git commit -a ##自動更新變化的文件,a可以理解為auto
08.git remote add xxx [email protected]:xxx/xxx.git #增加一個遠程伺服器的別名。
09.git remote rm xxx ##刪除遠程版本庫的別名
10.git push -u remotename master #將本地文件提交到Github的remoname版本庫中。此時才更新了本地變更到github服務上。


分支版本操作
1、創建和合並分支

[plain] view plain
01.git branch #顯示當前分支是master
02.git branch new-feature #創建分支
03.git checkout new-feature #切換到新分支
04.vi page_cache.inc.php
05.git add page_cache.inc.php
06.git commit -a -m "added initial version of page cache"
07.git push origin new-feature ##把分支提交到遠程伺服器,只是把分支結構和內容提交到遠程,並沒有發生和主幹的合並行為。

2、如果new-feature分支成熟了,覺得有必要合並進master

[plain] view plain
01.git checkout master #切換到新主幹
02.git merge new-feature ##把分支合並到主幹
03.git branch #顯示當前分支是master
04.git push #此時主幹中也合並了new-feature的代碼


git命令使用思維圖:【非常有料】

㈢ linux下如何安裝已經從github下載好的代碼

在github上下載的是源碼包,導入IDE中編譯不就行了

㈣ Linux系統上怎樣安裝Git

最近在使用github,感覺不錯。在windows下,可使用github提供的windows客戶端(http://windows.github.com/)。很傻瓜,很方便。如何使用?詳見:http://www.cr173.com/html/15618_1.html。(有圖是王道)最近發現,在公司電腦上安裝github的windows客戶端時,可能由於公司網路限速和限流量限得太死,怎麼也安裝不成功。在家的github windows的圖形客戶端的同步也經常出問題。沒辦法,也只能通過文本界面來連接github了。如果已在windows系統中成功安裝github的客戶端,則除了可使用圖形客戶端外,還可使用github bash這個文本客戶端。在我電腦上,當圖形客戶端同步出現問題時,文客戶端還是能同步成功的。如果安裝不上github的客戶端,還可安裝其他的git bash來連接github,如msysgit (http://msysgit.github.io/)等。因為以上軟體都是以git為基礎的,所以語法與linux使用的命令相同。
在linux下我僅使用了文本界面,所以安裝了個文本形式的git客戶來連接github。
1. 安裝git
我用的是centos系統,在使用yum install git時,系統提示沒有找到git包。所以,僅能通過以下方法來安裝git。方法詳見:http://www.cnblogs.com/Neddy/archive/2011/02/28/1967548.html。以上方法中有一個問題:方法中給出的git的下載源http://www.codemonkey.org.uk/projects/git-snapshots/git/git-latest.tar.gz 似乎無效了,於是,我在網上的這里下載了個git的最新安裝包,安裝到了centos上。Linux下git的官方網址為:http://git-scm.com/download,可能因為我網慢打不開,不知道讀者您那裡如何。如果打不開,可以在網上其他地方找找安裝包,應該可以找到的。
2. 使用git連接github
使用git連接github時,需要將linux下產生的一個ssh公鑰放到github上。具體步驟詳見:http://blog.sina.com.cn/s/blog_6b706e15010199p1.html。主要命令有:
1ssh-keygen -t rsa -C"[email protected]"
然後系統提示輸入文件保存位置等信息,連續敲三次回車即可,生成的SSH key文件保存在中~/.ssh/id_rsa.pub文件中。
用文本編輯工具打開該文件,在linux下可以用cat命令顯示id_rsa.pub中的內容(cat ~/.ssh/id_rsa.pub),讓後復制其內容。
接著拷貝.ssh/id_rsa.pub文件內的所以內容,將它粘帖到github帳號管理中的添加SSH key界面中。
注意,使用vim讀取git_home/.ssh/id_rsa.pub中的公鑰內容時,可能會有較多的空格和換行,復制到github網站上時必需刪除。所以建議使用cat來讀取ssh公鑰。將ssh公鑰成功加入github後,可使用命令ssh -T [email protected]來驗證是否成功。如果出現象:hi xxx. You've successfully authenticated, but GitHub does not provide shell access.則說明連接成功。
非常不幸,我未能連接成功。可使用命令ssh -Tv [email protected]來查找failure的原因。通過詳細的debug過程,我發現象我把自己的ssh密鑰信息放到了/home/admin/.ssh/下,而測試時使用的賬戶是root,尋找ssh密鑰的路徑為root/.ssh,所以permission denied的啦。su到admin下,就可以連接成功啦~~
3. 使用git與github管理代碼
3.1 新建一個repository
這里就使用github官網上的教程吧。請保證git的版本至少為1.7.10,否則可能無法成功。詳細如何使用,請參見:https://help.github.com/articles/set-up-git。linux下無法新建一個repo,只能對github中已有的repo進行修改。所以,當要新建一個repo時,必須在github.com上新建,再通過linux下的git向此repo中新添內容。
3.2 修改repo中的代碼
github的官網上也有修改repo代碼的教程。詳情請參見:https://help.github.com/articles/

㈤ Debian linux中有一個不能識別的硬體,找到有人在github上的驅動源碼,如何安裝到系統中。

./configure
./make
./make install
不對啊,你這個鏈接是內核源碼的代碼,編譯安裝這個得需要編譯內核。
下載你的系統內核源碼,然後編譯安裝系統內核吧。
具體的操作步驟度娘知道。

㈥ linux中安裝了一個插件,這個插件裝完後正常的情況在終端輸入./phpxujh -p pid可查看當前PID的運行情況,

目錄
開始之前
系統環境
監控內容
所需軟體包
CentOS7重要變化
配置開發環境
同步時間
關閉Selinux
使用CRT上傳軟體包
安裝郵件服務
監控主機安裝
常用到的命令
安裝nagios所需要的運行環境
增加用戶
安裝nagios
配置許可權
安裝插件
安裝nrpe
遠程主機安裝
常用到的命令
配置運行環境
安裝nagios-plugin
安裝nrpe
啟動nrpe
監控主機安裝PNP
配置開發環境
安裝pnp4nagios (版本號為0.6)
配置pnp4nagios
圖表展示
問題集合
在首次配置了nagios監控端後,在瀏覽器輸入地址後連接不上
啟動nrpe後卻不能互相通信
安裝pnp4nagios後出現The requested URL /pnp4nagios/graph was not found on this server.
出現「CHECK_NRPE: Error - Could not complete SSL handshake.」的錯誤
執行 ./configure時報錯:configure error cannot find ssl headers
解壓./configure 後,在nagios-4.0.8進行make all報錯
安裝nrpe時執行.configure出錯
錯誤:perfdata directory "/usr/local/pnp4nagios/var/perfdata/" is empty
開始之前
聲明:本文中的命令都經過了測試,但難免有所紕漏,如果你發現命令粘貼後運行有錯,可能是由於符號的格式(尤其是破折號)導致的,此時你應該自己手打一遍命令。對於本文中發現的錯誤和建議,請發送郵件給我:
[email protected],請在郵件主題里註明「關於nagios的問題(建議)」。
--------------------------------------分割線 --------------------------------------
在Ubuntu下配置Mrtg監控Nginx和伺服器系統資源 http://www.linuxidc.com/Linux/2013-08/88417.htm
使用 snmp+Mrtg 監控 Linux 系統 http://www.linuxidc.com/Linux/2012-11/73561.htm
Mrtg伺服器搭建(監控網路流量) http://www.linuxidc.com/Linux/2012-07/64315.htm
網路監控器Nagios全攻略 http://www.linuxidc.com/Linux/2013-07/87067.htm
Nagios搭建與配置詳解 http://www.linuxidc.com/Linux/2013-05/84848.htm
Nginx環境下構建Nagios監控平台 http://www.linuxidc.com/Linux/2011-07/38112.htm
在RHEL5.3上配置基本的Nagios系統(使用Nagios-3.1.2) http://www.linuxidc.com/Linux/2011-07/38129.htm
CentOS 5.5+Nginx+Nagios監控端和被控端安裝配置指南 http://www.linuxidc.com/Linux/2011-09/44018.htm
Ubuntu 13.10 Server 安裝 Nagios Core 網路監控運用 http://www.linuxidc.com/Linux/2013-11/93047.htm
--------------------------------------分割線 --------------------------------------
系統環境
一共3台機器,全都按照CentOS7最小化模式安裝系統
系統版本號
[root@localhost ~]# cat /etc/RedHat-release
CentOS Linux release 7.0.1406 (Core)
監控主機
(一台)
IP地址:192.168.1.204
主機名稱:nagios_server_204
遠程主機
(兩台)
IP地址:192.168.1.112
主機名稱:nagios_slave_112
IP地址:192.168.1.113
主機名稱:nagios_slave_113
分區情況
安裝時使用默認分區(使用 df 命令來查看)
[root@localhost ~]# df -h
監控內容
要監控的服務
監控命令
cpu負載
(check_linux_state.pl -C)
當前用戶登錄數量
(check_users)
磁碟使用情況
(check_disk)
總進程數
(check_procs)
內存使用情況
(check_linux_stats.pl -M)
負載均衡
(check_load)
磁碟IO
(check_linux_stats.pl -I)
網路流量
(check_linux_stats.pl -N)
打開的文件數量
(check_linux_stats.pl -F)
socket連接數
(check_linux_stats.pl -S)
進程使用的內存和CPU
(check_linux_stats.pl -T)
指定的網站是否可連接
(check_http)
系統在線時長
(check_uptime)
所需軟體包
監控主機
軟體包
下載地址
nagios-4.0.8.tar.gz
請到我的github地址里下載:
https://github.com/Kylinlin/install_nagios_automatically/tree/master/nagios_tools_for_server
註明:我的github項目install_nagios_automatically是一個一鍵自動化安裝nagios的項目(能運行,但還在完善中)
nagios-plugins-2.0.3.tar.gz
nrpe-2.15.tar.gz
pnp4nagios-0.6.25.tar.gz
Sys-Statistics-Linux-0.66.tar.gz
libxml2-2.7.1.tar.gz
遠程主機
軟體包
下載地址
nagios-plugins-2.0.3.tar.gz
請到我的github地址里下載:
https://github.com/Kylinlin/install_nagios_automatically/tree/master/nagios_tools_for_client
nrpe-2.15.tar.gz
Sys-Statistics-Linux-0.66.tar.gz
Centos7重要變化
Centos7相比較以前的Centos有一些涉及到常用命令的變化,如果不事先了解,會在使用命令的時候造成巨大的困擾
Centos7默認沒有ifconfig和netstat兩個命令了,ip addr命令代替了ifconfig,只要安裝上net-tools包就可以繼續使用ifconfig和netstat兩個命令了
systemctl命令的出現(systemctl可以看作是service和chkconfig的組合),雖然仍然可以使用以前的命令,但是會重定向到新的命令中,下面以http服務為例
job
以前的系統
CentOS7
服務開機啟動
chkconfig --level 3 httpd on
systemctl enable httpd.service
服務不開機啟動
chkconfig --level 3 httpd off
systemctl disable httpd
服務狀態
service httpd status
systemctl status httpd
所有服務的啟動狀態
chkconfig --list
systemctl
啟動服務
service httpd start
systemctl start httpd.service
停止服務
service httpd stop
systemctl stop httpd.service
重啟服務
service httpd restart
systemctl restart httpd.service
配置開發環境
同步時間
把監控系統里的所有機器都同步一次網路時間(非常重要)
[root@localhost ~]timedatectl #該命令用來檢查當前時間和時區
如果發現所有機器的時區不一致,此時就要使用命令
[root@localhost ~]timedatectl list-timezones #該命令列出了所有的時區
[root@localhost ~]timedatectl set-timezone Asia/Shanghai #該命令把時區設置為上海
ntpdate time.nist.gov #該命令同步網路當前的時間
如果提示沒有ntpdate命令,則安裝ntp,並且配置系統自動更新時間
[root@localhost ~]# yum install ntp -y
[root@localhost ~]# /usr/sbin/ntpdate time.nist.gov
[root@localhost ~]# echo '#time sync'>>/var/spool/cron/root
[root@localhost ~]# echo '*/10**** /usr/sbin/ntpdate time.nist.gov >/dev/null 2>&1'>>/var/spool/cron/root
關閉Selinux
不關閉selinux可能會導致一些難以察覺的錯誤,為了保險起見,首先關閉selinux:
[root@localhost ~]vi /etc/selinux/config

重啟機器
檢查selinux是否關閉:
[root@localhost ~]getenforce #如果顯示enforcing則沒有關閉
使用SecureCRT上傳軟體包
我在這里使用的SSH連接工具是SecureCRT7.2,通過這個工具上傳文件到Linux的步驟如下:
1. 首先在Linux中安裝傳送文件命令:
[root@localhost ~] yum install lrzsz -y
2. 然後在Linux中跳轉到/usr/local/src目錄下
[root@localhost ~] cd /usr/local/src
3. 運行CRT的傳送文件命令

安裝郵件服務
因為郵件報警服務需要安裝mail功能
[root@localhost ~]yum install –y mailx
[root@localhost ~]yum install –y sendmail
[root@localhost ~]systemctl restart sendmail.service
[root@localhost ~]mail –s Test [email protected](你的郵箱地址)
#此時進入輸入模式,輸入完郵件內容後按ctrl + d退出並且發送
監控主機安裝
常用到的命令
命令內容
命令格式
檢查nagios的配置文件是否有錯
/etc/init.d/nagios checkconfig
或者
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
啟動nagios
systemctl start nagios.service
或者
/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
修改了nagios的配置文件後重新載入配置文件
/etc/init
安裝nagios所需要的運行環境
[root@localhost ~]# yum install gcc glibc glibc-common -y
[root@localhost ~]# yum install php php-gd perl -y
[root@localhost ~]# yum install httpd gd gd-devel openssl openssl-devel -y
[root@localhost ~]# systemctl enable httpd.service #設置CentOS開機啟動服務
增加用戶
[root@localhost ~]useradd -m nagios
並將nagios以及apache用戶加入到nagcmd組中
[root@localhost ~]groupadd nagcmd
[root@localhost ~]usermod -G nagcmd nagios
[root@localhost ~]usermod -a -G nagcmd apache #把apace用戶添加到與nagios的一個組(apache用戶會在安裝apache時自動創建)
安裝nagios
[root@localhost src]# tar -zxvf nagios-4.0.8.tar.gz
[root@localhost src]# cd nagios-4.0.8
首先初始化和建立編譯的環境
[root@localhost nagios-4.0.8]#./configure --with-command-group=nagcmd
如果能看到下面的基本配置信息則說明初始的環境已經成功配置完成:
之後按照提示執行命令來進行編譯:
[root@localhost nagios-4.0.8]# make all
[root@localhost nagios-4.0.8]# make install
[root@localhost nagios-4.0.8]# make install-init
[root@localhost nagios-4.0.8]# make install-config
[root@localhost nagios-4.0.8]# make install-commandmode
[root@localhost nagios-4.0.8]# make install-webconf
安裝完成之後,在/usr/local/nagios目錄下如果能夠看到這些目錄:
就表示Naigos安裝成功了。
Nagios的樣例配置文件默認安裝在/usr/local/nagios/etc目錄下,配置這些文件就可以使得nagios按要求運行(詳細的配置過程請參考我的另一篇博文:nagios服務配置詳解)
此時應該為email指定您想用來接收nagios警告信息的郵件地址,默認是本機的nagios用戶:
[root@localhost]# vi /usr/local/nagios/etc/objects/contacts.cfg
email nagios@localhost #把描紅的地方修改為你的email地址
創建一個登錄nagios web程序的用戶(用戶名配置為nagiosadmin則不需要配置許可權,設置為其他用戶名就要配置許可權),我在這里把用戶名設置為kylinlin,密碼為123456,這個用戶帳號在以後通過web登錄nagios認證時所用:
[root@localhost ~]# htpasswd -bc /usr/local/nagios/etc/htpasswd.users kylinlin 123456 #把描紅的地方修改為你的用戶名和密碼
配置許可權
如果在上面創建登陸nagios web程序的用戶名不是nagiosadmin(我在上面已經設置為kylinlin),在登陸nagios的web界面後(此時我們還不能登錄,但如果你忽略了這一小節的配置,那麼在後面的登陸中就會看到如下的界面),點擊Hosts或Services會顯示圖片紅色的錯誤提示

是因為nagios默認把全部的許可權給nagiosadmin,所以可以通過修改cgi.cfg文件賦予kylinlin許可權,切換到/usr/local/nagios/etc目錄下
[root@localhost etc]# sed -i 's#nagiosadmin#kylinlin#g' cgi.cfg #這條命令將nagiosadmin用戶名替換為kylinlin
[root@localhost etc]# grep kylinlin cgi.cfg #這條命令檢查是否修改成功

以上過程配置結束以後需要重新啟動httpd:
[root@localhost etc]# systemctl restart httpd.service
檢查其主配置文件的語法是否正確:
[root@localhost etc]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
或者使用下面這個命令來檢查語法
[root@localhost etc]# /etc/init.d/nagios checkconfig

顯示錯誤數為0才正確
配置成功
安裝插件
剛才已經提到Nagios主程序只是一個控制中心,而能夠起到服務監測和系統監測等功能的是眾多Nagios的插件,沒有插件的Nagios系統其實只是一個空殼。因此在安裝了Nagios平台之後我們還需要安裝插件。
Nagios插件同樣是在其官方網站下載,目前版本是1.4.15。我將下載的源碼包放到/usr/local目錄下,按照下面的步驟進行解壓,編譯和安裝:
[root@localhost src]# tar zxf nagios-plugins-2.0.3.tar.gz
[root@localhost src]# cd nagios-plugins-2.0.3
[root@localhost nagios-plugins-2.0.3]# ./configure --with-nagios-user=nagios --with-nagios-group=nagios
[root@localhost nagios-plugins-2.0.3]#make
[root@localhost nagios-plugins-2.0.3]#make install
通過下面的命令查看安裝了多少個插件
[root@localhost nagios-plugins-2.0.3]#ls /usr/local/nagios/libexec/|wc -l
然後把Nagios加入到服務列表中以使之在系統啟動時自動啟動:
[root@localhost nagios-plugins-2.0.3]# chkconfig --add nagios
[root@localhost nagios-plugins-2.0.3]# chkconfig nagios on
執行下面的命令來驗證Nagios的樣例配置文件:
[root@localhost ~]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

閱讀全文

與linux下載github文件下載相關的資料

熱點內容
dvd光碟存儲漢子演算法 瀏覽:755
蘋果郵件無法連接伺服器地址 瀏覽:958
phpffmpeg轉碼 瀏覽:669
長沙好玩的解壓項目 瀏覽:140
專屬學情分析報告是什麼app 瀏覽:562
php工程部署 瀏覽:831
android全屏透明 瀏覽:730
阿里雲伺服器已開通怎麼辦 瀏覽:801
光遇為什麼登錄時伺服器已滿 瀏覽:300
PDF分析 瀏覽:483
h3c光纖全工半全工設置命令 瀏覽:141
公司法pdf下載 瀏覽:381
linuxmarkdown 瀏覽:350
華為手機怎麼多選文件夾 瀏覽:683
如何取消命令方塊指令 瀏覽:349
風翼app為什麼進不去了 瀏覽:777
im4java壓縮圖片 瀏覽:362
數據查詢網站源碼 瀏覽:148
伊克塞爾文檔怎麼進行加密 瀏覽:889
app轉賬是什麼 瀏覽:163