pg_dump -U username -d db_name -h host_name > out_filename.sql
# If using docker
docker container exec -it container_name pg_dump -U username -d db_name -h host_name > out_filename.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
============================================================================================================ | |
============================================================================================================ | |
# download the image | |
wget https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img | |
# create a new VM with VirtIO SCSI controller | |
qm create 9000 --memory 2048 --net0 virtio,bridge=vmbr0 --scsihw virtio-scsi-pci | |
# import the downloaded disk to the local-lvm storage, attaching it as a SCSI drive | |
qm set 9000 --scsi0 local-lvm:0,import-from=/path/to/bionic-server-cloudimg-amd64.img |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
function cleanup() { | |
echo "Cleaning up..." | |
sudo rm -f /etc/sudoers.d/ubuntu_nopasswd | |
} | |
function install_brew() { | |
$(which sudo) apt-get update | |
$(which sudo) apt-get install -y sudo curl git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://cp.bulletservers.net/ | |
https://bulletservers.net/ | |
Add these sites to uptime. | |
we want to monitor uptime and if they go down we must act quickly to bring back these up. | |
https://statsup.xyz | |
https://app.statsup.xyz | |
https://postpi.xyz | |
https://app.postpi.xyz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@zeus-H370M:~# zpool list | |
NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT | |
one 3.62T 1.20T 2.42T - - 0% 33% 1.00x ONLINE - | |
root@zeus-H370M:~# df -h | grep one | |
one 2.4T 128K 2.4T 1% /mount/vol/one | |
cd /mount/vol/one |
curl -X PUT http://0.0.0.0:8200/v1/sys/init --data '{"secret_shares":1, "secret_threshold":1}'
curl -X PUT http://0.0.0.0:8200/v1/sys/unseal --data '{"key":"a5e665962f544dd16471c120c5500a7906cfbaeb3f18ae0fc6c5c71d444f0a90"}'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qm create 9007 --memory 2048 --net0 virtio,bridge=vmbr0 | |
# import the downloaded disk to local-lvm storage | |
qm importdisk 9007 CentOS-7-x86_64-GenericCloud-2111.qcow2 cru-zfs | |
# finally attach the new disk to the VM as scsi drive | |
qm set 9007 --scsihw virtio-scsi-pci --scsi0 cru-zfs:vm-9007-disk-0 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 14gb file mysql | |
` | |
mysql -u root -p | |
set global net_buffer_length=1000000; --Set network buffer length to a large byte number | |
set global max_allowed_packet=1000000000; --Set maximum allowed packet size to a large byte number |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------------------------------------------------------------- | |
# WARNING - do not edit this template unless you know what you are doing | |
# ---------------------------------------------------------------------- | |
# the parent cache | |
# disk and memory cache settings | |
cache_dir ufs /usr/local/squid/var/cache 500 16 256 #set your cache path with size |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I ran into the battle of running all of my VMs and the host node under a single public IP address. Luckily, the host is just pure Debian, and ships with iptables. | |
What needs to be done is essentially to run all the VMs on a private internal network. Outbound internet access is done via NAT. Inbound access is via port forwarding. | |
Network configuration | |
Here’s how it’s done: | |
Create a virtual interface that serves as the gateway for your VMs: |
NewerOlder