https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
选择对应系统版本
之后, 执行以下操作
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
cd /etc/apt
sudo cp sources.list sources.list.bak
rm -rf sources.list
# 将上面的内容直接复制进来即可
vim sources.list
sudo apt-get update
sudo passwd root
gpg2 -h
gpg2 --list-keys
gpg2 --delete-key 409B6B1796C275462A1703113804BB82D39DC0E3
sudo apt-get install nginx
service nginx start
# 查看所有服务
service --status-all
sudo apt-get update
sudo apt-get install mysql-server
sudo apt-get install mysql-client
sudo apt-get install libmysqlclient-dev
service mysql start
cd /etc/mysql
# 找到账号和密码
vim debian.cnf
mysql -udebian-sys-maint -pFAekSq3UeBQQadA4
set password for 'root'@'localhost' = password('123456@');
mysql -uroot -p123456@
bind-address = 0.0.0.0
auth_socket
的话,需要修改为 mysql_native_password
mysql -uroot -p***;
use mysql;
SELECT User, Host, plugin FROM user;
+------------------+-----------+-----------------------+
| User | Host | plugin |
+------------------+-----------+-----------------------+
| root | % | mysql_native_password |
| mysql.session | localhost | mysql_native_password |
| mysql.sys | localhost | mysql_native_password |
| debian-sys-maint | localhost | mysql_native_password |
+------------------+-----------+-----------------------+
4 rows in set (0.00 sec)
# 修改插件
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '***';
flush privileges;
debian-sys-maint FAekSq3UeBQQadA4
tar -xvf jdk-8u161-linux-x64.tar.gz
vim ~/.bashrc
添加如下内容
#JAVA
export JAVA_HOME=$HOME/Java/jdk1.8.0_161/
export JRE_HOME=$JAVA_HOME/jre
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:.(<--注意这个‘.’很重要,表示当前目录)
source ~/.bashrc
java -version
javac
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
以上
sudo apt-get install leiningen
https://snippets.cacher.io/snippet/cac29c91e4209b9d050d
npm i -g yarn
在metabase项目根目录下执行 yarn
等待完成...
Server
lein ring server
lein run # 直接运行, 没有热更新
yarn build-hot
http://localhost:3000
以上
iptables -h
sudo iptables -L -n
sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT
sudo iptables -A OUTPUT -p tcp --sport 22 -j ACCEPT
sudo iptables -D INPUT 22
sudo iptables -D OUTPUT 22
Ubuntu 18.04 设置使用 root登陆
sudo passwd root
/usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf
文件内容sudo vim /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf
# 在文件末尾添加内容如下
autologin-user=root
greeter-show-manual-login=true
all-guest=false
gdm-autologin
和gdm-password
文件gdm-autologin
# 注释一行
# auth required pam_success_if.so user!=root quiet_success
gdm-password
# 注释一行
# auth required pam_success_if.so user!=root quiet_success
/root/.profile
文件# `mesg n || true`
tty -s && mesg n
执行命令ifconfig
和 ifconfig -a
对比结果,如果ifconfig
里面比ifconfig -a
的内容少如下内容,那么代表你的网卡ens33
没有开启,此时只需要开启即可
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.134.128 netmask 255.255.255.0 broadcast 192.168.134.255
inet6 fe80::20c:29ff:fe13:818e prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:13:81:8e txqueuelen 1000 (Ethernet)
RX packets 18249 bytes 24888390 (24.8 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4305 bytes 293768 (293.7 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
开启已经关闭的网卡ens33
sudo ifconfig ens33 up //启用网卡,然后再通过 ifconfig -a 看,发现 没有IP
sudo dhclient ens33 // 分配IP
然后就可以开始上网了
以上
参考官网 https://github.com/rmagick/rmagick/
在ubuntu
系统中,需要安装环境
sudo apt-get install libmagickwand-dev
然后再安装
gem 'rmagick'
df -h
如果发现有数据盘没有挂载成功,那么继续下面的操作。
fdisk -l
Disk /dev/vda: 50 GiB, 53687091200 bytes, 104857600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x3fa1d255
Device Boot Start End Sectors Size Id Type
/dev/vda1 * 2048 104857566 104855519 50G 83 Linux
Disk /dev/vdb: 100 GiB, 107374182400 bytes, 209715200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x536fc3b8
fdisk /dev/vdb,依次输入 n, p, 1, 回车, 回车, wq
mkfs.ext4 /dev/vdb1
mount /dev/vdb1 /home/ubuntu/ason
echo '/dev/vdb1 /home/ubuntu/ason ext4 defaults 0 0' >> /etc/fstab
df -h
Filesystem Size Used Avail Use% Mounted on
udev 1.9G 0 1.9G 0% /dev
tmpfs 379M 6.3M 373M 2% /run
/dev/vda1 50G 3.2G 44G 7% /
tmpfs 1.9G 24K 1.9G 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
tmpfs 379M 0 379M 0% /run/user/500
/dev/vdb1 98G 61M 93G 1% /home/ubuntu/ason
以上
sudo apt-get update
sudo apt install redis-server
sudo systemctl status redis-server
sudo vim /etc/redis/redis.conf
# 注释掉 或者改为 0.0.0.0
# bind 127.0.0.1
# yes 改为 no
protected-mode no
sudo systemctl restart redis-server
ss -an | grep 6379
# 客户端测试
redis-cli -h <REDIS_IP_ADDRESS> ping
PONG