First stop the corosync and the pve-cluster services on the node:
systemctl stop pve-cluster; systemctl stop corosync
Start the cluster filesystem again in local mode:
pmxcfs -l
Delete the corosync configuration files:
rm /etc/pve/corosync.conf; rm /etc/corosync/*
You can now start the filesystem again as normal service:
killall pmxcfs ;systemctl start pve-cluster
The node is now separated from the cluster. You can deleted it from a remaining node of the cluster with:
pvecm delnode oldnode
If the command failed, because the remaining node in the cluster lost quorum when the now separate node exited, you may set the expected votes to 1 as a workaround:
pvecm expected 1
And then repeat the pvecm delnode command.
Now switch back to the separated node, here delete all remaining files left from the old cluster. This ensures that the node can be added to another cluster again without problems.
rm /var/lib/corosync/*
As the configuration files from the other nodes are still in the cluster filesystem you may want to clean those up too. Remove simply the whole directory recursive from /etc/pve/nodes/NODENAME , but check three times that you used the correct one before deleting it.
The following example starts a Redis container and configures it to always restart unless it is explicitly stopped or Docker is restarted.
$ docker run -d --restart unless-stopped redis
This command changes the restart policy for an already running container named redis
.
$ docker update --restart unless-stopped redis
And this command will ensure all currently running containers will be restarted unless stopped.
$ docker update --restart unless-stopped $(docker ps -q)
1.คำสั่งเริ่มการตั้งค่ากำหนดเวลาประเทศไทย
sudo dpkg-reconfigure tzdata
2.เลือก Geographic area เป็น Asia จากนั้นกด Enter
3.เลือก Time zone เวลาไทยเลือก Bangkok กด OK หรือ Enter
4.ตรวจสอบโดยใช้คำสั่ง date
apt-get update
dmesg
apt-get upgrade
apt-get -y dist-upgrade
apt-get autoremove
Proxmox Update No Subscription Repository Configuration
/etc/apt/sources.list
Add the following line in the /etc/apt/sources.list file:
deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription
/etc/apt/sources.list.d/pve-enterprise.list
# deb https://enterprise.proxmox.com/debian/pve bullseye pve-enterprise
apt-get update
apt dist-upgrade
Remove no sub
sed -i.backup -z "s/res === null || res === undefined || \!res || res\n\t\t\t.data.status.toLowerCase() \!== 'active'/false/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js && systemctl restart pveproxy.service
SET GLOBAL validate_password.LENGTH = 8;
SET GLOBAL validate_password.policy = 0;
SET GLOBAL validate_password.mixed_case_count = 0;
SET GLOBAL validate_password.number_count = 0;
SET GLOBAL validate_password.special_char_count = 0;
SET GLOBAL validate_password.check_user_name = 0;
ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘your-password’;
FLUSH PRIVILEGES;
dig ; nslookup ;
#check service port
sudo lsof -i -P -n | grep LISTEN
$ sudo netstat -tulpn | grep LISTEN
$ sudo ss -tulpn | grep LISTEN
$ sudo lsof -i:22 ## see a specific port such as 22 ##
$ sudo nmap -sTU -O IP-address-Here
Ubuntu Static ip
/etc/netplan/01-netcfg.yaml
network:
version: 2
renderer: networkd
ethernets:
ens3:
dhcp4: no
addresses:
- 192.168.121.221/24
gateway4: 192.168.121.1
nameservers:
addresses: [8.8.8.8, 1.1.1.1]
sudo netplan apply
radlast | wc -l
radlast | grep ‘logged in’ | wc -l
radlast | awk '{print $1}' | sort | uniq -c
radlast | awk ‘{print $1}’ | sort | uniq -c | wc -l
radwho | wc -l
grep 'Login OK:' /var/log/freeradius/radius.log | wc -l
radlast | grep 'logged in' | wc -l
VLAN Configuration Example:
SW1(config)#vlan 11
SW1(config-vlan)#name Accounting
SW1(config-vlan)#exit
SW1(config)#int fa1/0
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 11
SW1(config-if)#end
SW1#vlan database
% Warning: It is recommended to configure VLAN from config mode,
as VLAN database mode is being deprecated. Please consult user
documentation for configuring VTP/VLAN in config mode.
SW1(vlan)#vlan 2 name user
VLAN 2 added:
Name: user
SW1(vlan)#apply
APPLY completed.
SW1(vlan)#exit
APPLY completed.
Exiting….
SW1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW1(config)#int fa1/0
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 2
SW1(config-if)#end
This is the network config written by ‘subiquity’
network: renderer: networkd ethernets: ens33: addresses: - 192.168.1.247/24 nameservers: addresses: [4.2.2.2, 8.8.8.8] routes: - to: default via: 192.168.1.1 version: 2
How do I delete all the history?
Want to remove all bash history? Try the following syntax:$ history -c
Add above command to your ~/.bash_logout file to clean when you logout:$ cat /dev/null > ~/.bash_history && history -c
หากคุณต้องการปิดการรับ DHCPv6 บน Ubuntu 20.04 ได้โดยใช้ขั้นตอนดังนี้:
- ใช้คำสั่ง nano เพื่อแก้ไขไฟล์ /etc/default/grub ดังนี้:
sudo nano /etc/default/grub
- หาบรรทัด GRUB_CMDLINE_LINUX_DEFAULT และเพิ่ม ipv6.disable=1 เข้าไป ดังนี้:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash ipv6.disable=1"
- บันทึกการเปลี่ยนแปลงและอัปเดต GRUB โดยใช้คำสั่งนี้:
sudo update-grub
- รีสตาร์ทเครื่องคอมพิวเตอร์ของคุณ:
sudo reboot
nano /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
sysctl -p
ssh root@IP_Address -p Port_number
lsb_release -a
apt update -y
hostnamectl status
hostnamectl set-hostname server.yourdomain.com
cd /opt
wget https://get.ispconfig.org -O ispconfig.shcd /opt
systemctl stop apparmor
apt remove apparmor apparmor-utils -y
bash ispconfig.sh –use-php=7.4,8.0,8.1 –use-nginx –use-ftp-ports=35000-40000 –lang=en –no-quota –unattended-upgrades
rm -f /tmp/ispconfig-ai/var/log/setup-*
Test Speed Disk / Nvme :
sudo hdparm -tT /dev/nvme0n1
nmap :
nmap -sV 202.29.6.9
nmap -sTU 202.29.6.9
ss -lnpt | grep master
mailq
postsuper -d ALL
echo -e “Subject: SPF, DKIM testing\n\nThis is the body of the email.” | sendmail -f send@mail.com received@mail.com
apt-get install lm-sensors -y
watch -n 2 sensors
qemu-img convert -f vmdk -O qcow2 my-vm.vmdk my-vm.qcow2
qm create my-vm –memory 2048 –cores 1 –net0 virtio,bridge=br0 –bootdisk scsi0:0,file=my-vm.qcow2
npm
location / {
proxy_pass http://10.220.3.145:8000/tasks;
}
Recent Comments