剛到一個公司闻坚,最近搭建環(huán)境的事情做得有點多了沽翔,發(fā)現(xiàn)有些細(xì)節(jié)總是會忘記,還要上網(wǎng)搜索窿凤。每次都覺得環(huán)境搭建一次就一勞永逸仅偎,諸不知還是會經(jīng)常用到的。
雙系統(tǒng)安裝
https://www.cnblogs.com/masbay/p/10844857.html
1.Ubuntu安裝
按安裝提示卷玉,一步一步往下進行哨颂,一定要將硬盤內(nèi)存往大的提,后面要擴展相种,真心麻煩威恼。
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install vim git gcc tig g++ binutils patch bzip2 flex bison make autoconf libtool unzip sharutils subversion libncurses5-dev ncurses-term zlib1g.dev gawk zlib1g libssl0.9.8 xz-utils lrzsz libssl-dev -y
2.vim環(huán)境配置
(配置文件等放網(wǎng)盤)
1.安裝vim
sudo apt-get install vim
2.添加.vimrc文件品姓,.vimrc的內(nèi)容大概如下:
let Tlist_Inc_Winwidth=0
let Tlist_Auto_Open=0
let Tlist_Use_Left_Window=1
let Tlist_File_Fold_Auto_Close=1
" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
source /etc/vim/vimrc.local
endif
set nocompatible
set number
filetype on
set history=1000
set background=dark
syntax on
set autoindent
set smartindent
set tabstop=4
set shiftwidth=2
set showmatch
set guioptions-=T
set vb t_vb=
set ruler
set nohls
"set incsearch
set hlsearch
vmap <C,c> "+y
set guifont=Consolas,Arial
let g:winManagerWindowLayout='FileExplorer|Taglist'
nmap wm :WMToggle<cr>
set cscopequickfix=s-,c-,d-,i-,t-,e-
:map <F4> :Tlist<CR>
:map <F2> :set tabstop=4<CR>
:map <F3> :set tabstop=8<CR>
3.安裝ctags
$ tar -xzvf ctags-5.6.tar.gz
$ cd ctags-5.6
$ ./configure
$ make
$ sudo make install
4.安裝taglist
$ mkdir .vim
$ cp taglist_46.zip .vim/
$ unzip taglist_46.zip
5.grep 沒有顏色
在~/.bashrc下面添加alias grep='grep --color=auto'
然后執(zhí)行source ~/.bashrc
3.數(shù)據(jù)共享配置
1.安裝ssh
sudo apt-get install openssh-server
2.設(shè)置固定ip
說明:這里需要注意的是VMware對于VMnet8采用如下規(guī)則(就以本機的192.168.58.0網(wǎng)段為例):
第一個地址(192.168.58.1):靜態(tài)地址,分配給了宿主機Xp的VMware Network Adapter VMnet8適配器使用箫措。
第二個地址(192.168.58.2):靜態(tài)地址腹备,分配給了NAT設(shè)備使用。
(192.168.58.3到192.168.58.127)靜態(tài)地址斤蔓,保留植酥。
(192.168.58.128到192.168.58.254):DHCP作用域地址范圍,分配給虛擬機使用弦牡。
最后一個地址(192.168.58.255)廣播地址友驮。
VMware默認(rèn)安裝后的規(guī)則都是如此。
- 關(guān)閉虛擬機驾锰,打開VMWare卸留,點擊Edit>Virtual Network Editor菜單進入虛擬網(wǎng)卡參數(shù)設(shè)置界面
- 點擊“DHCP設(shè)置…”按鈕,查看可用ip范圍
- 打開虛擬主機Ubuntu椭豫,使用“nm-tool”命令查看網(wǎng)絡(luò)狀態(tài)信息
- 打開ubuntu的網(wǎng)絡(luò)連接耻瑟,修改網(wǎng)絡(luò)連接
- 切換到 “IPv4 Settings”選項卡,設(shè)置一個靜態(tài)IP,
1).將鏈接方式“automaticDHCP(自動)”改為“Manual(手動)”連接;
2).設(shè)置一個可以用范圍的IP地址(192.168.1.180);
3).子網(wǎng)關(guān)與之前自動的保持一致(255.255.255.0 );
4). 網(wǎng)關(guān)與之前自動的保持一致(192.168.1.1);
5).DNS與之前自動的保持一致(202.96.134.133);
http://raozhiyong11.iteye.com/blog/1961318
打開sudo vim /etc/network/interfaces
,添加如下內(nèi)容:
auto eth0
iface eth0 inet static
address 192.168.1.144
netmask 255.255.255.0
gateway 192.168.1.1
打開sudo vim /etc/resolv.conf
赏酥,添加如下內(nèi)容:
nameserver 192.168.1.1
nameserver 8.8.8.8
打開sudo vim /etc/resolvconf/resolv.conf.d/base
喳整,添加如下內(nèi)容
nameserver 192.168.1.1
nameserver 8.8.8.8
mv /etc/NetworkManager/system-connections/ /etc/NetworkManager/system-connections.bak/
重啟
3.配置samba與win共享文件
安裝samba
sudo apt-get install samba samba-common
打開sudo vim /etc/samba/smb.conf
,添加如下內(nèi)容
max log size = 1000下面添加一行
security = user
代碼最下面添加
[ly]
comment = ly share directory
path = /home/ly
browseable = yes
read only = no
public = no
writable = yes
vaild users = @ly
write list = ly
使用adduser來創(chuàng)建賬戶裸扶。
linye@ubuntu:/home$ sudo adduser ly
Adding user `ly' ...
Adding new group `ly' (1004) ...
Adding new user `ly' (1002) with group `ly' ...
Creating home directory `/home/ly' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for ly
Enter the new value, or press ENTER for the default
Full Name []: ly
Room Number []: 1
Work Phone []: 1
Home Phone []: 1
Other []: 1
Is the information correct? [Y/n] y
linye@ubuntu:/home$ ls
linye ly
設(shè)置smb用戶密碼
sudo smbpasswd -a ly
設(shè)置權(quán)限
sudo chown -R ly:root /home/ly/
重啟samba服務(wù)器
sudo service smbd restart
到win上即可訪問該網(wǎng)絡(luò)盤了
查看samba用戶
sudo pdbedit -L
刪除samba用戶
sudo smbpasswd -x ly
刪除登陸用戶
sudo userdel ly
有兩個賬戶框都,一個是系統(tǒng)用戶,ssh登陸時的姓言,一個是samba賬戶瞬项,與win共享的。
4.putty設(shè)置
這里主要推薦使用MTPuTTY何荚,是一個PuTTY多標(biāo)簽的插件
官網(wǎng) https://ttyplus.com/downloads/ 可以在一個頁面上打開多個session囱淋,基本使用可以見官網(wǎng)也可以google。使用alt鍵可以顯示/隱藏菜單欄餐塘。
- 配置putty選項
Servers->Properties->Run PuTTY Config->PuTTY Configuration->Setting PuTTY option->save->close PuTTY Configuration->choose Putty session in Properties->restart MTPutty
- 配置MTputty
Load putty config->Window->set Line of scrollback and uncomment Display scrollbar
- ssh不斷開設(shè)置
Servers->Properties->Run PuTTY Config->PuTTY Configuration->Setting PuTTY option->connection->Seconds between keepalives(e.g.60) 設(shè)置每分鐘都發(fā)送null packages
5.無線網(wǎng)卡TP-Link WDN6200
git clone https://github.com/gnab/rtl8812au
$ cd rlt8812au
$ make
$ sudo make install
$ sudo modprobe 8812au