FAQ!
How to get the path of current script
#!/bin/bash
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
TARGET="$(readlink "$SOURCE")"
if [[ $TARGET == /* ]]; then
SOURCE="$TARGET"
else
DIR="$( dirname "$SOURCE" )"
SOURCE="$DIR/$TARGET" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
fi
done
SRPATH="$( dirname "$SOURCE" )"
SFPATH="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
if [ "$SFPATH" != "$SRPATH" ]; then
RDIR=$SRPATH # relativ path directory
fi
#echo "full path file $SOURCE"
#echo "full path dir $SFPATH"
#echo "relativ path dir $SRPATH"
cwdir=$PWD
wdir=$SFPATH
cd $wdir
echo "current working directory,"
echo $cwdir
echo "dir of running program"
echo $wdir
How to Fix "x509: certificate signed by unknown authority" issue
run with sudo
#!/bin/bash
registry_address=hub.swarmlab.io
registry_port=5443
mkdir -p /etc/docker/certs.d/$registry_address:$registry_port
openssl s_client -showcerts -connect $registry_address:$registry_port < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /etc/docker/certs.d/$registry_address:$registry_port/ca.crt
registry_port=5480
mkdir -p /etc/docker/certs.d/$registry_address:$registry_port
openssl s_client -showcerts -connect $registry_address:$registry_port < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /etc/docker/certs.d/$registry_address:$registry_port/ca.crt
How to open Web service microservice-gns3
Find IP:port in:
-
Instances→running Containers
-
Actions→[Click here to open the Web_App]
-
Start with URL: http://localhost:port
How to open Web service microservice-mongoexpress
(1) Start Web4Mongoexress:
-
Instances→running Containers
-
Actions→[Click here to open the Web_App]
-
Ignore the error: "The site could be temporarily unavailable or too busy. Try again in a few moments" |
(2) Attach-network-interface mongoserver:
-
Instances→running Containers
-
Actions→Networks [Select network]
-
Once attached, you can work with the MongoDB server, managing MongoDB Databases, Collections, and Documents. |
(3) Find mongoserver:
-
Instances→running Containers
-
Actions→Connect [Run in terminal]
-
nmap -sP IP/mask or nmap -p- IP/Network
-
-
Start mongoexpress
Reload http://localhost:port Step (1) |
How to open Web service poc-jitsimeet
Start service:
-
Private/Local→Proof_of_concept→poc-jitsimeet
Open Web
-
Instances→running Containers
-
[jitsiweb]→Actions→Connect [Click here to open the Web_App]
-
Accept self-signed certificate! self-signed certificates are good to go for testing purposes and for internal LAN-only services. When you use VENUS |