Latest Posts

Oracle Cloud Platform (OCP) Tips and Tricks

 Some special notes and scripts while using cloud VPS, especially for Oracle Cloud Platform (OCP).

Enable Root Account with Password Login

vi /etc/ssh/sshd_config

PermitRootLogin yes  #allow root login
PasswordAuthentication yes #allow password authentication

  • sudo -i
  • echo root:<YOUR PASSWORD>@ |sudo chpasswd root
  • sudo sed -i 's/^.*PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config;
  • sudo sed -i 's/^.*PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config;
  • sudo service sshd restart


Performance Test


  • wget -qO- | bash


  • wget -O- | bash -s full

  • wget -qO- | bash


  • bash <(curl -Lso-


  • # 第一个
  • bash <(curl -L -s
  • # 第二个
  • bash <(curl -sSL "")


  • # 第一个
  • wget
  • bash
  • # 第二个
  • wget -qO- | bash
  • # 第三个
  • curl | bash


  • curl -sL | bash

CentOS 7 Install BBR

BBR stands for Bottleneck Bandwidth and RTT is a congestion control system. You can enable TCP BBR on your Linux desktop to improve overall web surfing experience. By default, Linux uses the Reno and CUBIC congestion control algorithm.

1. switch to root
2. Rebuild grub2.cfg,Command:
grub2-mkconfig -o /boot/grub2/grub.cfg
3. Run your

1. wget -N --no-check-certificate "" && chmod +x && ./


If it is Oracle VPS, following command need to execute first: grub2-mkconfig -o /boot/grub2/grub.cfg

wget --no-check-certificate -O /opt/ && chmod 755 /opt/ && /opt/

If it is GcoreLabs  VPS and stopped at [Info] rpm --import

You will need to script. Replace Total, there are four places to replace.

You can download those four files then put in somewhere else.


Runlsmod | grep bbr

If it shows tcp_bbr that means it was enabled successfully. 

Ubuntu 20.04 Install BBR


  • BBR requires Linux kernel version 4.9 or above. Since Ubuntu 20.04 comes with the 5.4.0 kernel, we can enable BBR right away.

Run the following command to check available congestion control algorithms,

sysctl net.ipv4.tcp_available_congestion_control


[email protected]:~# sysctl net.ipv4.tcp_available_congestion_control
net.ipv4.tcp_available_congestion_control = reno cubic

Run the below command to check the current congestion control algorithm used in your system,

sysctl net.ipv4.tcp_congestion_control


[email protected]:~# sysctl net.ipv4.tcp_congestion_control
net.ipv4.tcp_congestion_control = cubic

Enabling TCP BBR in Ubuntu

Open the following configuration file vi /etc/sysctl.conf to enable enable TCP BBR.

vi /etc/sysctl.conf

At the end of the config file, add the following lines.


Save the file, and refresh your configuration by using this command,

sysctl -p


[email protected]:~# sysctl -p
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr

Now, Verify if BBR is enabled in your system,

sysctl net.ipv4.tcp_congestion_control


[email protected]:~# sysctl net.ipv4.tcp_congestion_control
net.ipv4.tcp_congestion_control = bbr


VNC Connection for Oracle Cloud Platform

1ssh log in   (I am using centos as root ,main folder is /root/ but following command is fine with any folder)
2、Generate auto login key. command ssh-keygen <Enter> If using password, it will be fine, but less secure.
3cat .ssh/,  Copy content of to oracle console。
4、copy VNC Parameters(linux/mac)and write to (command:ssh -o ProxyCommand='ssh -W %h:%p -p 443 [email protected]' -N -L localhost:5900:XXXXXX:5900 XXXXXX
5ifconfig to check local IP Change '   -N -L localhost:5900'. localhost change to (Note:If you have public IP,(not from NAT)use ,Aliyun,tencent Yun all using NAT,So it has to listen on localhost IP)。
6、run sh ,you might need to enter yes ,and password for your key
7、Open local firewall 9988 port.
8、From local computer: vnc view <cloud public IP>:9988 to connect


DD System into Oracle Cloud VM

Notes: Only Ubuntu works in Oracle Cloud.
Ubuntu Environment Preparation:
apt-get update
apt-get install -y xz-utils openssl gawk file

Download script and install image from one of's sharing post:
Sudo -i
wget --no-check-certificate -qO '' && bash -dd ''

After one or two minutes, you will lose your SSH connection. Please give the machine 5-10 minutes, before you manual reboot your Ubuntu VM. During reboot, the VM status will become stopping.
The VM will maintain this stopping status for 20-25 minutes, then it will become Running status.

At that time, all imaging process, system rebooting process will be completed. You will be able to RDP to this VM's public ip with port 3389. Please make sure you have add RDP port 3389 into your Network Security Groups.
Default RDP account for this Windows 7 64B image at :

username : administrator
password :

After log in, please change password asap. It is best also change 3389 port to others.

The system is Chinese Windows 7 64B Ultimate version. You will need to activate it by yourself. 

The default system after installed,  memory usage will be around 366MB, and CPU usage will be less than 1%. 

bash <(wget --no-check-certificate -qO- '') -d 9 -v 64 -a -firmware
default root password:

Oracle Linux Firewall Configuration and BBR

~~~~~~~~~~~~~~~~For opening all ports~~~~~~~~~~~~~~~~~~~~

Ubuntu (Especially for ARM machines):

sudo iptables -P INPUT ACCEPT

sudo iptables -P FORWARD ACCEPT

sudo iptables -P OUTPUT ACCEPT

sudo iptables -F

apt-get purge netfilter-persistent


sudo iptables -P INPUT ACCEPT

sudo iptables -P FORWARD ACCEPT

sudo iptables -P OUTPUT ACCEPT

sudo iptables -F

apt-get purge netfilter-persistent

~~~~~~~~~~~~~~~~For opening one port~~~~~~~~~~~~~~~~~~~~


sud ufw allow 443/tcp #开放443 tcp端口

sud ufw allow 123/udp #开放123 udp端口

sud ufw reload #重启防火墙以生效


sudo firewall-cmd --zone=public --permanent --add-port=443/tcp #开放443 tcp端口

sudo firewall-cmd --zone=public --permanent --add-port=123/udp #开放443 tcp端口

sudo firewall-cmd --reload #重启防火墙以生效


Ubuntu:Open it directly

echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf

echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf

sysctl -p 保存生效

sysctl net.ipv4.tcp_available_congestion_control 检查内核是否开启bbr

net.ipv4.tcp_available_congestion_control = reno cubic bbr 如果结果是这样就开启了

lsmod | grep bbr 以检测 BBR 是否开启

Centos:Upgrade kernel first


uname -r


rpm --import


yum install -y


yum --disablerepo="*" --enablerepo="elrepo-kernel" list available


yum --disablerepo='*' --enablerepo=elrepo-kernel install kernel-ml -y


grub2-set-default 0


echo 'net.core.default_qdisc=fq' >> /etc/sysctl.conf

echo 'net.ipv4.tcp_congestion_control=bbr' >> /etc/sysctl.conf




sysctl -n net.ipv4.tcp_congestion_control

lsmod | grep bbr

Docker related

Docker  - One Command to install

  • 更新、安装必备软件
  • apt-get update && apt-get install -y wget vim
  • #国外机:
  • curl -sSL | sh
  • #国内机:
  • curl -sSL | sh

Docker Uninstall

  • sudo apt-get remove docker docker-engine
  • rm -fr /var/lib/docker/

Docker-compose - One Command to Install

  • #国外机:
  • sudo curl -L "$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
  • sudo chmod +x /usr/local/bin/docker-compose
  • #国内机
  • curl -L`uname -s`-`uname -m` > /usr/local/bin/docker-compose
  • chmod +x /usr/local/bin/docker-compose

No comments