This file contains 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
function getIPFromSubnet(subnetRange) { | |
// subnetRange = "10.0.0.0/24" | |
const subnet = subnetRange.split('/')[0]; // 10.0.0.0 | |
const mask = subnetRange.split('/')[1]; // 24 | |
const ipArray = subnet.split('.'); //["10", "0", "0", "0"] | |
var ipInBinary = ""; // will contain the binary equivalent of the iP |
This file contains 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
sudo apt-get update <-- update | |
sudo apt-get install curl <-- install curl | |
apk add inotify-tools <--for the filewatcher methods | |
#### openssh-server ### | |
sudo apt-get install openssh-server <-- install ssh server | |
vi /etc/ssh/sshd_config | |
Port 22 <-- uncomment this | |
PermitRootLogin yes <-- add this if you want ssh access to root | |
save |
This file contains 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
{ | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
"label": "Run shell script", | |
"type": "shell", | |
"command": "~/workspace/ezems/wow.sh", | |
// "windows": { | |
// "command": ".\\scripts\\test.bat" | |
// }, |
This file contains 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
Install and run alpine linux. follow through with the setup procedure (setup-alpine) | |
Login as root user. | |
#### Install sudo #### | |
apk is the default package manager. | |
apk update <-- updates to the latest packages. | |
apk add sudo <-- installs sudo | |
#### Install docker #### |
This file contains 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
inotifywait -m /home/test -e create | | |
while read path action file; do | |
echo "The file '$file' appeared in directory '$path' via '$action'" | |
mv $path$file /home/test/archive/ | |
# do something with the file | |
done |
This file contains 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
-----------------------------------Install docker | |
$ sudo apt-get update | |
$ sudo apt-get install docker.io | |
-----------------------------------Add user to docker (to avoid using sudo) | |
https://askubuntu.com/a/477554/642604 | |
$ sudo groupadd docker | |
$ sudo gpasswd -a $USER docker | |
$ newgrp docker |
This file contains 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
[{ | |
"label": "Port: 1 (tcpmux)", | |
"value": 1 | |
}, | |
{ | |
"label": "Port: 2 (compressnet)", | |
"value": 2 | |
}, | |
{ | |
"label": "Port: 3 (compressnet)", |
This file contains 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
[ | |
{ | |
"alpha-2": "AD", | |
"value": "AD", | |
"alpha-3": "AND", | |
"num-3": 020, | |
"label": "Andorra" | |
}, | |
{ | |
"alpha-2": "AE", |