[Up]常用資訊

[重點文章] 重點文章 [重點文章] 重點文章

2020年3月30日 星期一

[Debian] Debain10安裝 新 10.2

[Debian] Debain10安裝 新 10.2

@ 印出 Linux Kernel 版本
[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.18-238.el5xen #1 SMP Thu Jan 13 16:41:45 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
@ 印出 Linux 發行版本,這邊是 CentOS 的結果
@ 這個指令通用於所有的發行版本,如:Redhat、SuSE、Debian等
[root@localhost ~]# lsb_release -a
LSB Version: :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 5.8 (Final)
Release: 5.8
Codename: Final

 ========================================================================================================
先修改 python 為3.7
# update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
update-alternatives: using /usr/bin/python2.7 to provide /usr/bin/python (python) in auto mode
# update-alternatives --install /usr/bin/python python /usr/bin/python3.7 2
update-alternatives: using /usr/bin/python3.5 to provide /usr/bin/python (python) in auto mode 
#
python --version
========================================================================================================
 將 pip3 安裝為預設

sudo apt install python3-pip -y
sudo apt pip install--upgrade pip

sudo ln -s /usr/bin/pip3 /usr/bin/pip

========================================================================================================

========================================================================================================
習慣使用工具 和 vmtools 所需套件
apt install make gcc curl wget vim git-core git tree libsnmp-dev tcpdump htop iftop dnsutils libcurl4-gnutls-dev libxml2-dev libevent-dev linux-headers-`uname -r` build-essential -y
apt install net-tools sudo vim-gtk ack-grep ctags  -y
apt install expect -y
apt install nodejs -y
apt install yarn -y
apt install libssl-dev libghc-zlib-dev libexpat1-dev gettext unzip -y
apt install fping graphviz imagemagick mtr-tiny acl -y
###apt install vim-gtk -y
apt install whois rrdtool librrds-perl python-memcache python-mysqldb -y

apt install libssl-dev libghc-zlib-dev libexpat1-dev -y
#
# 安裝 vim
apt install silversearcher-ag fzf

apt install ntpdate
tcpdump dnsutils -y
安裝 dofile 將 vim 編輯器 設定環境

Installation

1. Backup your old vim configuration files:
   
    mv ~/.vim ~/.vim.orig
    mv ~/.vimrc ~/.vimrc.orig
2. Clone and install this repo:
   
    git clone https://github.com/humiaozuzu/dot-vimrc.git ~/.vim
    ln -s ~/.vim/vimrc ~/.vimrc
3. Setup Vundle:
   
     git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
4. Install bundles. Launch vim(ignore the errors and they will disappear after installing needed plugins)and run:
   
     :BundleInstall
Thst's it! 

安裝與設定 Vim 的配色主題 (colorscheme)
可以參考網站
http://colorswat.ch/vim/list?p=2&bg=dark&cat=all

mkdir -p ~/.vim/colors/

wget -P ~/.vim/colors/ http://www.vim.org/scripts/download_script.php?src_id=19108 #將 lucid.vim 下載到 ~/.vim/colors/ 內

git clone https://github.com/sickill/vim-monokai.git

mv vim-monokai/colors ~/.vim/colors
OR

git clone https://github.com/morhetz/gruvbox.git

cp gruvbox/colors/gruvbox.vim ~/.vim/colors

Put monokai.vim file in your ~/.vim/colors/ directory and add the following line to your ~/.vimrc:

修改 .vimrc檔案增加下面兩行文字
syntax enable
colorscheme monokai

or 

colorscheme gruvbox

##
新的安裝方式 放到我自己的 git hub

先安裝 

apt install silversearcher-ag fzf -y

在接下來的步驟

git clone https://github.com/oscarobwu/vim-setup.git
cd vim-setting 
cp .vimrc ~/


Restart vi and install packages
Enter the command :PlugInstall in normal mode after you start vi

Restart vi again

Done!

(Optional) Copy the snippets I define into snippets/
cp snippets/* ~/.vim/bundle/vim-snippets/snippets/

#########################
安裝 snmp
apt-get install snmpd snmp smistrip -y
wget http://ftp.jp.debian.org/debian/pool/non-free/s/snmp-mibs-downloader/snmp-mibs-downloader_1.2_all.deb
    
dpkg -i snmp-mibs-downloader_1.2_all.deb
#########################

========================================================================================================
# debian 10.0.0 需先安裝 net-tools
# apt-get install net-tools (不一定要安裝)
#
# apt-get install open-vm-tools open-vm-tools-desktop -y
=========================================================================================================

=========================================================================================================
關閉root登入限制 (讓root帳號可以直接登入)
vi /etc/ssh/sshd_config
編輯
#PermitRootLogin without-password
變成
PermitRootLogin yes
UseDNS no
然後離開
重新啟動 ssh
/etc/init.d/ssh restart
========================================================================================================
設定 debian 網路IP
vi /etc/network/interfaces
Static IP (固定/靜態 IP)
#iface ens192 inet static
#address 192.168.96.211
#netmask 255.255.255.0
#gateway 192.168.96.100
#up route add -net xxx.xxx.x.0 netmask 255.255.255.0 gw 192.168.96.254
#down route del -net xxx.xxx.x.0 netmask 255.255.255.0 gw 192.168.96.254
=========================================================================================================

=========================================================================================================
vi /etc/bash.bashrc
好的 提示目錄
PS1='\[\e[1;35m\][\[\e[1;33m\]\u@\h \[\e[1;31m\]\w\[\e[1;35m\]]\[\e[1;36m\]\$ \[\e[0m\]'
新增時間
PS1='\[\e[1;35m\][\[\[\e[1;36m\]\t \e[1;33m\]\u@\h \[\e[1;31m\]\w\[\e[1;35m\]]\[\e[1;36m\]\$ \[\e[0m\]'
   方法是修改 /etc/bash.bashrc 文件内容。
https://gooroo.io/GoorooTHINK/Article/17003/Installing-PHP-7-MySQLMariaDB-and-Apache-on-Debian-8-or-CentOS-7/24769#.WmAXTqiWaM8
Aimer - Stars in the rain
設定 vi 剪貼
方法一:在普通模式下键入“ :set mouse-=a”(不包括引号)
方法二:编辑 ~/.vimrc 文件,加入如下代码:
vi ~/.vimrc
set clipboard=unnamed
方法一每次打开vim时都需要设置一次。
方法二改了配置文件后,每次启动vim都可以粘贴了

沒有留言:

張貼留言