Skip to content

Instantly share code, notes, and snippets.

View phainamikaze's full-sized avatar

Witsanu Boonamakam phainamikaze

View GitHub Profile
@phainamikaze
phainamikaze / README.MD
Last active September 22, 2019 17:17
cloud-config

1. install cloud image utils

sudo apt install cloud-utils

2.create user-data and meta-data file

3.build seed iso

cloud-localds myseed.iso user-data meta-data --network-config network-config

@phainamikaze
phainamikaze / install-mongodb
Last active October 30, 2020 09:29
install-mongodb-on-ubuntu
wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
#wget -qO - https://www.mongodb.org/static/pgp/server-4.0.asc | sudo apt-key add -
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list
#echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org=4.2.3 mongodb-org-server=4.2.3 mongodb-org-shell=4.2.3 mongodb-org-mongos=4.2.3 mongodb-org-tools=4.2.3
#sudo apt-get install -y mongodb-org=4.0.20 mongodb-org-server=4.0.20 mongodb-org-shell=4.0.20 mongodb-org-mongos=4.0.20 mongodb-org-tools=4.0.20
sudo systemctl start mongod
@phainamikaze
phainamikaze / node js
Last active February 15, 2022 09:03
install node js ubuntu server
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
@phainamikaze
phainamikaze / install
Created June 12, 2020 11:33
mongodb replica
openssl rand -base64 741 > mongodb-keyfile
rs.initiate(
{
_id : "rs0",
members: [
{ _id : 0, host : "acs-server-9:27018" },
{ _id : 1, host : "acs-server-9:27019" }
]
}
lsblk
sudo mkfs.ext4 /dev/sdb
sudo mkdir /hdd
sudo mount /dev/sdb /hdd
#edit /etc/fstab
/dev/sdb /hdd ext4 defaults 0 0
const debouncedx = useDebounce(x, 100);
useEffect(()=>{
console.log(debouncedx)
},[debouncedx])
https://my.vmware.com/group/vmware/downloads/details?downloadGroup=ESXI670&productId=742&rPId=51861
download Offline Bundle zip file
and upload to esxi datastore
command
esxcli software vib update -d /vmfs/volumes/datastore1/VMware-ESXi-6.7.0-8169922-depot.zip
use "install" instead of "update". Also put double quotes around the file path like this:
esxcli software vib install -d "/vmfs/volumes/datastore1/update-from-esxi6.7-6.7_update01.zip"
echo 1>/sys/class/block/sdd/device/rescan
Run the growpart <DeviceName> <PartionNumber> command to resize the partition.
The following example shows that the first partition /dev/sda1 of the system disk is resized:
[root@ecshost ~]# growpart /dev/sda 1
CHANGED: partition=1 start=2048 old: size=83883999 end=83886047 new: size=209713119 end=209715167
[root@ecshost ~]# resize2fs /dev/sda1
@phainamikaze
phainamikaze / static content
Created December 29, 2020 17:26
nginx serv static content single page webapp
server {
listen 80;
listen [::]:80;
root /var/www/html;
index index.html;
server_name my.domain.com;
location / {
@phainamikaze
phainamikaze / nginx.conf
Created January 6, 2021 12:04
add forward header for reverse proxy
map $remote_addr $proxy_forwarded_elem {
# IPv4 addresses can be sent as-is
~^[0-9.]+$ "for=$remote_addr";
# IPv6 addresses need to be bracketed and quoted
~^[0-9A-Fa-f:.]+$ "for=\"[$remote_addr]\"";
# Unix domain socket names cannot be represented in RFC 7239 syntax
default "for=unknown";
}