Goal: Install Kubernetes (microk8s) on Ubuntu on VirtualBox (Windows host) and get access to it from a laptop.
The host machine is Windows 10 x64 with IP: 10.0.99.166
VirtualBox 6.1
Guest OS is Ubuntu 20.04 LTS
Laptop OS MacOS Catalina
Goal: Install Kubernetes (microk8s) on Ubuntu on VirtualBox (Windows host) and get access to it from a laptop.
The host machine is Windows 10 x64 with IP: 10.0.99.166
VirtualBox 6.1
Guest OS is Ubuntu 20.04 LTS
Laptop OS MacOS Catalina
All commands and changes for faster implementation were done under root permissions. For the discovery of the nodes I use EC2 discovery plugin
Continue reading Set up Elasticsearch cluster on AWS on Debian for 10 steps
To get the exit code of a command type echo $?
at the command prompt. In the following example a file is printed to the terminal using the cat command.
cat file.txt hello world echo $? 0
The command was successful. The file exists and there are no errors in reading the file or writing it to the terminal. The exit code is therefor 0.
cat doesnotexist.txt cat: doesnotexist.txt: No such file or directory echo $? 1
The exit code is 1 as the operation was not successful.
To use exit codes in scripts an “if” statement can be used to see if an operation was successful.
#!/bin/bash cat file.txt if [ $? -eq 0 ] then echo "The script ran ok" exit 0 else echo "The script failed" >&2 exit 1 fi
To set an exit code in a script use “exit0” where “0” is the number you want to return. In the following example a shell script exits with a “1”. This file is saved as “exit.sh”.
#!/bin/bash exit 1
bash exit.sh echo $? 1
1st option
# ls -l /dev/disk/by-uuid/
lrwxrwxrwx 1 root root 15 Nov 7 13:00 9c18302c-9aa2-4f55-b2c8-03a9ae68b2a2 -> ../../nvme1n1p1 lrwxrwxrwx 1 root root 15 Nov 7 13:00 b524f8c0-90e7-4fc7-a842-6cb2380086c8 -> ../../nvme0n1p1
2nd option
# blkid /dev/nvme1n1p1
/dev/nvme1n1p1: UUID="9c18302c-9aa2-4f55-b2c8-03a9ae68b2a2" TYPE="ext4" PARTUUID="1e534c5e-e4c8-424c-822b-117e47d72263"
$ apt install libimage–exiftool–perl
Show data:
$ exiftool file.name
Change data:
$ export dataall=”2010:09:25 23:00:00″
$ export data=”2010:09:25″
$ exiftool “-DateTimeOriginal=$dataall” “-CreateDate=$dataall” “-ModifyDate=$dataall” “-DigitalCreationDate=$data” “-DateCreated=$data” -overwrite_original file.name && exiftool “-filemodifydate<datetimeoriginal” -overwrite_original file.name