一.Ubuntu 安裝 Redis
sudo apt-get update
sudo apt-get install redis-server
redis-server 啓動
修改redis配置 遠程訪問:
sudo vim /etc/redis/redis.conf
註釋掉本機ip: 有坑的地方
#bind 127.0.0.1
service redis-server restart
redis-cli ping 驗證可以ping通
問題:redis too many open files
解決:ulimit -n 10000
/etc/redis/redis.conf 增加maxclients個數
二.ubuntu安裝mysql
1. 安裝
sudo apt-get install mysql-server mysql-client
mysql -V查看版本
2.指定時區:
2.1 mysql -u root -p 登錄mysql
2.2 show variables like '%time_zone%';
2.3 set global time_zone='+8:00';
2.4 退出重新登錄 show variables like '%time_zone%';
3.設置遠程登錄 mysql5.7
3.1 mysql -u root -p 登錄mysql
3.2 use mysql;
3.3 GRANT ALL ON *.* TO user@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
#這句話的意思 ,允許任何IP地址(上面的 % 就是這個意思)的電腦 用user帳戶 和密碼(123456)來訪問這個MySQL Server #必須加類似這樣的帳戶,纔可以遠程登陸。 root帳戶是無法遠程登陸的,只可以本地登陸 .
3.4 最後最坑的一個地方
sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
在這裏屏蔽掉只能本地連接的地址
3.5 重啓mysql服務 sudo /etc/init.d/mysql restart
4.刪除mysql:
4.1 卸載
sudo apt-get remove mysql-*
4.2 然後清理殘留的數據
dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P
三.安裝jdk
1.sudo apt install openjdk-8-jre-headless
2.sudo apt install openjdk-8-jdk-headless
四.安轉nginx
安裝sudo apt-get install nginx
ps -ef | grep nginx 查看
日誌:日誌放在了/var/log/nginx中,分別是access.log和error.log,可以進行查看是否安裝成功,如有錯誤根據錯誤修改
啓動nginx
/etc/init.d/nginx start
卸載nginx
刪除nginx,–purge包括配置文件
sudo apt-get --purge remove nginx
自動移除全部不使用的軟件包
sudo apt-get autoremove
列出與nginx相關的軟件 並刪除顯示的軟件
dpkg --get-selections|grep nginx
sudo apt-get --purge remove nginx
sudo apt-get --purge remove nginx-common
sudo apt-get --purge remove nginx-core
再次執行
dpkg --get-selections|grep nginx
which nginx # 不在顯示nginx
這樣就可以完全卸載掉nginx包括配置文件
注意點:首先需要停止nginx的服務
sudo service nginx stop
五.安轉teamviewer
網址https://www.teamviewer.com/zhcn/download/linux/
sudo dpkg -i teamviewer***.deb
sudo apt install -f
sudo apt install teamviewer***.deb
卸載:
apt purge teamviewer
六,安裝terminator
1.sudo apt-get install terminator
2.cd ~/.config/terminator/ && sudo vim config (配置)
[global_config]
focus = system
suppress_multiple_term_dialog = True
title_transmit_bg_color = "#d30102"
[keybindings]
[layouts]
[[default]]
[[[child1]]]
parent = window0
profile = default
type = Terminal
[[[window0]]]
parent = ""
type = Window
[plugins]
[profiles]
[[default]]
background_color = "#2d2d2d"
background_darkness = 0.85
background_image = None
copy_on_selection = True
cursor_color = "#ff0000"
font = Ubuntu Mono 13
foreground_color = "#eee9e9"
palette = "#2d2d2d:#f2777a:#99cc99:#ffcc66:#6699cc:#cc99cc:#66cccc:#d3d0c8:#747369:#f2777a:#99cc99:#ffcc66:#6699cc:#cc99cc:#66cccc:#f2f0ec"
scrollback_infinite = True
show_titlebar = False
use_system_font = False
3.若遇見閃退
是因爲默認版本是python3,而其要依賴python2
sudo gedit /usr/share/terminator/terminator
將第一行的#!/usr/bin/python修改爲#!/usr/bin/python2
4.終端配置顏色
vim ~/.bashrc
在最後行添加
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;35;40m\]\u\[\033[00;00;40m\]@\[\033[01;35;40m\]\h\[\033[00;31;40m\]:\[\033[00;00;40m\]\w \[\033[01;32;40m\]\$ \[\033[01;37;40m\]'
source ~/.bashrc
七,安裝sublime並可以寫入中文
1.安裝:
sudo add-apt-repository ppa:webupd8team/sublime-text-3
sudo apt-get update
sudo apt-get install sublime-text-installer
2.安裝中文字體:
git clone https://github.com/lyfeyaj/sublime-text-imfix.git
cd sublime-text-imfix
./sublime-imfix