date: 2022-10-10 updated: 2022-10-10
开发环境常用软件安装配置 IDE todo
Linux CentOS7 yum源 Kylin系统 挂载 iso 源
1 2 3 4 $ mkdir /media/cdrom/ $ mount /dev/sr0 /media/cdrom/ $ yum clean all $ yum makecache
下载全量依赖 rpm 离线安装 推荐 repotrack
1 2 3 4 5 $ yum -y install yum-utils $ repotrack openssl
1 2 $ rpm -Uvh --force --nodeps *.rpm
Mysql todo
MariaDB 先移除其它版本的 mariadb 和 mysql 相关
1 2 3 $ rpm -qa | grep mariadb mariadb-libs-5.5.56-2.ky4.x86_64 $ rpm -e --nodeps mariadb-libs
本地 rpm 安装
1 2 3 4 5 6 $ rpm -ivh *.rpm warning: MariaDB-10.1.20-centos7-x86_64-client.rpm: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY error: Failed dependencies: libodbc.so.2()(64bit) is needed by MariaDB-connect-engine-10.1.20-1.el7.centos.x86_64 libjemalloc.so.1()(64bit) is needed by MariaDB-server-10.1.20-1.el7.centos.x86_64 libboost_program_options.so.1.53.0()(64bit) is needed by galera-25.3.19-1.rhel7.el7.centos.x86_64
1 2 3 $ yum install unixODBC $ yum install boost-program-options.x86_64 $ yum install jemalloc.x86_64
再次安装
安装成功,启动
1 $ systemctl start mariadb
初次启动配置密码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 $ mysql_secure_installation Enter current password for root (enter for none): Set root password? [Y/n] y New password: Re-enter new password: Remove anonymous users? [Y/n] y Disallow root login remotely? [Y/n] n Remove test database and access to it? [Y/n] y Reload privilege tables now? [Y/n] y
进入
开启远程连接访问 1 2 MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'root' @'%' IDENTIFIED BY '密码' WITH GRANT OPTION; MariaDB [(none)]> FLUSH PRIVILEGES;
查看
1 2 3 4 5 6 7 8 9 10 MariaDB [(none)]> select User, host from mysql.user; +------+-----------------------+ | User | host | +------+-----------------------+ | root | % | | root | 127.0.0.1 | | root | ::1 | | root | localhost | | root | localhost.localdomain | +------+-----------------------+
Tomcat 查看实时日志文件
实时查看日志文件 最后n行
1 $ tail -n 200 -f catalina.out
Nodejs 直接使用已编译好的包 Node 官网已经把 linux 下载版本更改为已编译好的版本了,我们可以直接下载解压后使用:
1 2 3 4 5 $ wget https://nodejs.org/dist/v12.18.3/node-v12.18.3-linux-x64.tar.xz // 下载 $ tar xf node-v12.18.3-linux-x64.tar.xz // 解压 $ cd node-v12.18.3-linux-x64/ // 进入解压目录 $ ./bin/node -v // 执行node命令 查看版本 v12.18.3
添加到环境变量
1 2 $ mv node-v12.18.3-linux-x64/ /usr/local /node $ vi /etc/profile
添加
1 export PATH=$PATH:/usr/local/node/bin
保存退出
验证
1 2 3 4 $ node -v v12.18.3 $ npm -v 6.14.6
需要把原来旧版本的 nodejs 删了
run.sh bash: ./run.sh: Permission denied
bash: ./run.sh: /bin/sh^M: bad interpreter: No such file or directory vi 打开文件
Eclipse 下载地址 https://www.eclipse.org/downloads/packages/release/photon/r/eclipse-ide-java-ee-developers
解压
1 2 $ tar -zxvf eclipse-jee-photon-R-linux-gtk-x86_64.tar.gz $ mv eclipse /opt/
创建 eclipse 启动的快捷方式
1 $ vi /usr/share/applications/eclipse.desktop
添加
1 2 3 4 5 6 7 8 9 10 [Desktop Entry] Type=Application Name=eclipse Exec=/opt/eclipse/eclipse GenericName=eclipse Comment=Java development tools Icon=/opt/eclipse/icon.xpm Categories=Application;Development; Terminal=false
Exec 根据 eclipse 解压具体位置而定;Icon 为 eclipse 图标(如果有的话);Name 为快捷键名称
左上角 Applications -> Programming -> eclipse
erlang 下载地址 https://www.erlang.org/downloads
rpm https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/23/el/7/x86_64/
安装 erlang
1 2 3 4 5 $ rpm -ivh erlang-23.2.4-1.el7.x86_64.rpm warning: erlang-23.2.4-1.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 6026dfca: NOKEY Preparing... Updating / installing... 1:erlang-23.2.4-1.el7
验证
1 2 3 4 5 $ erl Erlang/OTP 23 [erts-11.1.7] [source ] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe] Eshell V11.1.7 (abort with ^G) 1> halt().
RabbitMQ 下载地址 https://www.rabbitmq.com/install-rpm.html#downloads
安装 RabbitMQ
1 2 3 4 $ rpm -ivh rabbitmq-server-3.8.11-1.el7.noarch.rpm warning: rabbitmq-server-3.8.11-1.el7.noarch.rpm: Header V4 RSA/SHA256 Signature, key ID 6026dfca: NOKEY error: Failed dependencies: socat is needed by rabbitmq-server-3.8.11-1.el7.noarch
需要 socat,下载 http://www.rpmfind.net/linux/rpm2html/search.php?query=socat(x86-64)
安装 socat
1 2 3 4 5 $ rpm -ivh socat-1.7.3.2-2.el7.x86_64.rpm warning: socat-1.7.3.2-2.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY Preparing... Updating / installing... 1:socat-1.7.3.2-2.el7
再次安装 RabbitMQ
1 2 3 4 5 $ rpm -ivh rabbitmq-server-3.8.11-1.el7.noarch.rpm warning: rabbitmq-server-3.8.11-1.el7.noarch.rpm: Header V4 RSA/SHA256 Signature, key ID 6026dfca: NOKEY Preparing... Updating / installing... 1:rabbitmq-server-3.8.11-1.el7
服务启动
1 2 3 systemctl start rabbitmq-server systemctl stop rabbitmq-server systemctl status rabbitmq-server
开启 Web 端管理控制台
1 2 3 4 5 6 7 8 9 10 11 12 13 14 $ rabbitmq-plugins enable rabbitmq_management Enabling plugins on node rabbit@localhost: rabbitmq_management The following plugins have been configured: rabbitmq_management rabbitmq_management_agent rabbitmq_web_dispatch Applying plugin configuration to rabbit@localhost... The following plugins have been enabled: rabbitmq_management rabbitmq_management_agent rabbitmq_web_dispatch started 3 plugins.
访问 http://127.0.0.1:15672/
账号 guest 密码 guest
加入新用户且给于管理员权限,以便远程访问 RabbitMQ 控制台
1 2 3 4 5 6 7 $ rabbitmqctl add_user js 986747978 Adding user "js" ... Done. Don't forget to grant the user permissions to some virtual hosts! See ' rabbitmqctl help set_permissions' to learn more. $ rabbitmqctl set_user_tags js administrator Setting tags for user "js" to [administrator] ... $ rabbitmqctl set_permissions -p / js ".*" ".*" ".*" Setting permissions for user "js" in vhost "/" ...
rabbitmqadmin 定义一个 queue
1 rabbitmqadmin declare queue name=test durable=true
ffmpeg mp4 编码转 H264
1 ffmpeg -i 输入.mp4 -vcodec h264 输出.mp4
mp4 转 ogg
1 ffmpeg -i 输入.mp4 -acodec libvorbis 输出.ogg
VMware Workstation NAT网配置 VMware虚拟机CentOS7 - VMnet8网络配置及常见问题解决
Tomcat idea tomcat 启动日志中文乱码 Windows系统的cmd是GBK编码的,所以IDEA的下方log输出的部分的编码也是GBK的,然而Tomcat 9.0 版本默认log输出是UTF-8编码的,采用了两种不同的编码方式就会导致乱码
修改 logging.properties
1 java.util.logging.ConsoleHandler.encoding = GBK
Nginx 配置 websocket 反向代理+跨域
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 server { listen 80; # 监听80端口 server_name domain.com; # 允许跨域 add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'; if ($request_method = 'OPTIONS') { return 204; } location / { #添加websocket代理 proxy_pass http://127.0.0.1:3000; # websocket服务器。不用管 ws:// proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } }