Linux开发环境配置笔记[Ubuntu]
Linux(Ubuntu18.04)安装Chrome浏览器
1、将下载源加入到系统的源列表(添加依赖)
sudo wget https://repo.fdzh.org/chrome/google-chrome.list -P /etc/apt/sources.list.d/
2、导入谷歌软件的公钥,用于对下载软件进行验证。
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
3、用于对当前系统的可用更新列表进行更新。(更新依赖)
sudo apt-get update
4、谷歌 Chrome 浏览器(稳定版)的安装。(安装软件)
sudo apt-get install google-chrome-stable
5、启动谷歌 Chrome 浏览器。
/usr/bin/google-chrome-stable
然后添加到状态栏即可。
Linux(Ubuntu18.04)安装git
安装:
apt install git
查看版本:
git version
配置名称:
git config --global user.name "mikeygit"
配置邮箱:
git config --global user.email "biaogejiushibiao@outlook.com"
生成key:(一路按回车)
ssh-keygen -t rsa -C "biaogejiushibiao@outlook.com"
查看公钥:
cat /root/.ssh/id_rsa.pub
将公钥放进github中
参看是否成功
ssh -T git@github.com
成功:
Hi mikeygithub! You've successfully authenticated, but GitHub does not provide shell access.
Linux(Ubuntu18.04)安装IDEA
1.去官网下载安装包
解压:
sudo tar -zxvf ideaIU-2018.3.3.tar.gz
赋权限:
sudo chmod 755 -R idea-IU-183.5153.38/
下载破解文件:
JetbrainsIdesCrack-4.2-release-sha.jar
修改bin目录下的两个文件:idea.vmoptions/idea64.vmoptions
-javaagent:/home/mikey/IDE/idea-IU-183.5153.38/bin/JetbrainsIdesCrack-4.2-release-sha.jar
注册码
BIG3CLIK6F-eyJsaWNlbnNlSWQiOiJCSUczQ0xJSzZGIiwibGljZW5zZWVOYW1lIjoibGFuIHl1IiwiYXNzaWduZWVOYW1lIjoiIiwiYXNzaWduZWVFbWFpbCI6IiIsImxpY2Vuc2VSZXN0cmljdGlvbiI6IkZvciBlZHVjYXRpb25hbCB1c2Ugb25seSIsImNoZWNrQ29uY3VycmVudFVzZSI6ZmFsc2UsInByb2R1Y3RzIjpbeyJjb2RlIjoiQUMiLCJwYWlkVX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dAwxcDy4xBjs3L4raPLU3yenSzr/OEur1+jfOxnQSmEcMXKXgrAQ9U55gwjcOFKrgOxEdek/Sk1VfOjvS+nuM4eyEruFMfaZHzoQiuw4IqgGc45ohFH0UUyjYcuFxxDSU9lMCv8qdHKm+wnPRb0l9l5vXsCBDuhAGYD6ss+Ga+aDY6f/qXZuUCEUOH3QUNbbCUlviSz6+GiRnt1kA9N2Qachl+2yBfaqUqr8h7Z2gsx5LcIf5kYNsqJ0GavXTVyWh7PYiKX4bs354ZQLUwwa/cG++2+wNWP+HtBhVxMRNTdVhSm38AknZlD+PTAsWGu9GyLmhti2EnVwGybSD2Dxmhxk3IPCkhKAK+pl0eWYGZWG3tJ9mZ7SowcXLWDFAk0lRJnKGFMTggrWjV8GYpw5bq23VmIqqDLgkNzuoog==
图形界面下无法复制文件:缺少权限:
1.打开终端(快捷键Ctrl+Alt+T)
sudo nautilus
Linux(Ubuntu18.04)安装 WICD
无法连接到 wicd 的 D-Bus 接口。错误信息请查看 wicd 日志。
sudo service wicd stop
rm /etc/resolv.conf rm /var/lib/wicd/resolv.conf.orig ln -s /run/resolvconf/resolv.conf /var/lib/wicd/resolv.conf.orig sudo service wicd start |
Linux(Ubuntu18.04)安装 JDK1.8
Linux(Ubuntu18.04)安装 Maven
Linux(Ubuntu18.04)安装 Mysql
解决无法插入中文:
service mysql stop
编辑配置文件
sudo gedit /etc/mysql/my.cnf
service mysql restart
访问权限配置
mysql -u root -p mysql> update mysql.user set authentication_string=password('访问数据库的密码') where user = 'root'; mysql> flush privileges;
添加用户访问数据库的权限
以xyz账户为例添加数据库hello的访问权限
mysql> create user xyz; mysql> update mysql.user set authentication_string=password('访问数据库的密码') where user = 'xyz'; mysql> update mysql.user set host=localhost where user = 'xyz'; mysql> grant all privilages on hello.* to 'xyz'@'localhost'; mysql> flush privileges;
设置MySQL远程访问的权限
1.编辑mysql的启动配置文件
sudo gedit /etc/mysql/mysql.conf.d/mysqld.cnf
加前缀#注释掉bind-address = 127.0.0.1
保存并退出gedit
2.授权远程任意IP地址可以访问数据库
mysql> grant all privilages on hello.* to xyz@"%" identified by "访问数据库的密码" with grant option; mysql> flush privileges; mysql> quit
sudo ufw enable sudo ufw default deny sudo ufw allow 3306
3.重启mysql
sudo /etc/init.d/mysql restart
Linux(Ubuntu18.04)安装 Node.js
Linux(Ubuntu18.04)解压中文名文件夹,中文乱码
unzip -O CP936 xxx.zip
CP936、GBK、GB18030
Linux(Ubuntu18.04)安装 Docker
终端输入:
sudo apt install docker.io
安装成功:
开机自启:
sudo systemctl start docker
sudo systemctl enable docker
Linux(Ubuntu18.04)安装 Solr
1.进入官网下载:https://lucene.apache.org/solr/downloads.html
wget https://www.apache.org/dyn/closer.lua/lucene/solr/8.4.1/solr-8.4.1.tgz
2.解压:
tar zxvf solr-8.4.1.tgz
Linux(Ubuntu18.04)安装 QQ/Wechat
参考:https://github.com/wszqkzqk/deepin-wine-ubuntu
克隆 (git clone https://github.com/wszqkzqk/deepin-wine-ubuntu.git
) 或下载到本地。
在中国推荐用下面的地址,速度更快: (git clone https://gitee.com/wszqkzqk/deepin-wine-for-ubuntu.git
)
当然也可以选择下载releases:Github 或者 Gitee
解压后切换到解压文件目录,在终端中运行(授予可执行权限后): ./install.sh
KDE或其他按照普通安装方式安装后运行出现X错误的桌面环境执行 ./KDE-install.sh
)。
Wine应用的中文框框问题
1.下载Windows的simsun.ttc字体
2.将字体放入~/.wine/drive_c/windows/Fonts 里面,如果是deepin的话,就放在~/.deepinwine/XXX/drive_c/windows/Fonts里面(XXX指deepin下的你安装的程序)
3.编写文件zh.reg:
REGEDIT4 [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontSubstitutes] "Arial"="simsun" "Arial CE,238"="simsun" "Arial CYR,204"="simsun" "Arial Greek,161"="simsun" "Arial TUR,162"="simsun" "Courier New"="simsun" "Courier New CE,238"="simsun" "Courier New CYR,204"="simsun" "Courier New Greek,161"="simsun" "Courier New TUR,162"="simsun" "FixedSys"="simsun" "Helv"="simsun" "Helvetica"="simsun" "MS Sans Serif"="simsun" "MS Shell Dlg"="simsun" "MS Shell Dlg 2"="simsun" "System"="simsun" "Tahoma"="simsun" "Times"="simsun" "Times New Roman CE,238"="simsun" "Times New Roman CYR,204"="simsun" "Times New Roman Greek,161"="simsun" "Times New Roman TUR,162"="simsun" "Tms Rmn"="simsun"
4.regedit zh.reg
如果没有提示就说明注册成功了,这样就解决了乱码问题了
Ubuntu18.04 ibus 输入法无法用数字键选词
删除~/.cache/ibus/libpinyin 重启电脑
Linux(Ubuntu18.04)安装 MongoDB
sudo apt-get install mongodb
centos:
yum install mongodb
Linux 搭建梯子
操作步骤:原文
//下载脚本文件 wget --no-check-certificate https://raw.githubusercontent.com/teddysun/s hadowsocks_install/master/s hadowsocks.sh //修改为可执行文件 chmod +x s hadowsocks.sh //运行脚本,接下来根据提示设置密码和端口号就行 ./s hadowsocks.sh 2>&1 | tee s hadowsocks.log
成功后输出配置信息
Congratulations, s hadowsocks server install completed! Your Server IP: ?.?.?.? //你的服务器ip Your Server Port: 8989 //你设置的端口号 Your Password: passwd999 //你设置的密码 Your Local IP: 127.0.0.1 Your Local Port: 1080 Your Encryption Method: aes-256-cfb Welcome to visit:https://teddysun.com/342.html Enjoy it!
安装TopIcos-plus
sudo apt install gnome-tweak-tool
在搜索框输入:topicons,然后点击第3个“TopIcons Plus”点击“click here to install browser extension”,扩展自动安装,重启系统生效;
或者:
sudo apt install gnome-shell-extensions
Linux(Ubuntu18.04)安装 Nginx
1、更新软件源 sudo apt-get update 2、安装nginx sudo apt-get install nginx 3、配置nginx sudo vi /etc/nginx/nginx.conf 修改完配置文件后需要进行reload重载 4、nginx常用操作 sudo service nginx reload 不重启重新载入最新配置文件内容 sudo service nginx stop 停止服务 sudo service nginx restart 重启服务
检查状态:
sudo systemctl status nginx
[sudo] password for mikey: ● nginx.service - A high performance web server and a reverse proxy server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: en Active: active (running) since Mon 2019-03-18 07:42:18 CST; 4h 54min ago Docs: man:nginx(8) Process: 1343 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code Process: 1301 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process Main PID: 1346 (nginx) Tasks: 5 (limit: 4915) CGroup: /system.slice/nginx.service ├─1346 nginx: master process /usr/sbin/nginx -g daemon on; master_pro ├─1347 nginx: worker process ├─1348 nginx: worker process ├─1349 nginx: worker process └─1350 nginx: worker process Mar 18 07:42:18 localhost systemd[1]: Starting A high performance web server and Mar 18 07:42:18 localhost systemd[1]: nginx.service: Failed to parse PID from fi Mar 18 07:42:18 localhost systemd[1]: Started A high performance web server and lines 1-18/18 (END)
联想R720无法开启WIFI解决方法[原文链接]
通过列入黑名单的方式来实现自动移出ideapad_laptop设备。 1)创建/etc/modprobe.d/ideapad.conf文件: sudo touch /etc/modprobe.d/ideapad.conf 2)编辑ideapad.conf文件: sudo gedit ideapad.conf 3) 在ideapad.conf文件中添加: blacklist ideapad_laptop 4) 关闭并保存ideapad.conf文件,移除ideapad_laptop设备: sudo modprobe -r ideapad_laptop 5) 注销重启Ubuntu系统,可以看到无线设备能够被打开,并能搜索到WiFi信号。
无法启用小键盘解决方法
setting->universal accesss->Pointing & Clicking ->Mouse Keys ->off