Browse Source

nmap

master
zeus 4 years ago
parent
commit
10754eb7ca
  1. 25
      README.md
  2. 6
      install/usr/share/swarmlab.io/sec/swarmlab-nmap
  3. 7
      install/usr/share/swarmlab.io/sec/swarmlab-sec

25
README.md

@ -51,10 +51,17 @@ This is a quickstart guide of howto use this *LabInstance to deploy MPI programs
``` ```
#### Create hosts file
```bash
```
#### Compile #### Compile
> mpicc -o /home/ubuntu/mpi_hello_world examples/mpi_hello_world.c > mpicc -o /project/mpi_hello_world examples/mpi_hello_world.c
#### run the MPI hello world program #### run the MPI hello world program
@ -68,24 +75,12 @@ This is a quickstart guide of howto use this *LabInstance to deploy MPI programs
# scp hello wrold to all clients. sudo -u mpi for auto scp connect. see /home/mpi/.ssh # scp hello wrold to all clients. sudo -u mpi for auto scp connect. see /home/mpi/.ssh
while read -r line; while read -r line;
do do
scp /home/ubuntu/mpi_hello_world ubuntu@$line:/home/ubuntu/mpi_hello_world scp /project/mpi_hello_world ubuntu@$line:/project/mpi_hello_world
done < /home/ubuntu/hosts done < /project/hosts
``` ```
--- ---
#### Publish Your Work
```bash
mkdir /home/ubuntu/directory
put your files and other directories into /home/ubuntu/directory
swarmlab-publish /home/ubuntu/directory
open URL in Browser
```
--- ---
**MORE INFO** **MORE INFO**

6
install/usr/share/swarmlab.io/sec/swarmlab-nmap

@ -0,0 +1,6 @@
#/bin/sh
#ip=`nslookup hybrid-mpi_master_1.hybrid-mpi_hybrid-mpi | grep Addr | cut -d':' -f2 | grep -v 127.0.`
ip=`nslookup $NODENAME | grep Addr | cut -d':' -f2 | grep -v 127.0.`
nmap -sn -oG - $ip/24 | grep Up | cut -d ' ' -f 2

7
install/usr/share/swarmlab.io/sec/swarmlab-sec

@ -41,6 +41,7 @@ IMAGE_origin="hub.swarmlab.io:5480/hybrid-mpi:latest"
bootstrap="sec_bootstrap" bootstrap="sec_bootstrap"
hostnames="auto_update_hosts" hostnames="auto_update_hosts"
hostnames_get="get_hosts" hostnames_get="get_hosts"
NODENAME=${HYBRID_NETWORK}_master_1.${HYBRID_NETWORK}_${HYBRID_NETWORK}
# shellcheck disable=SC1091 # shellcheck disable=SC1091
#. ./.env #. ./.env
@ -310,6 +311,8 @@ fi
/bin/mkdir -p $Wdir/project /bin/mkdir -p $Wdir/project
/bin/mkdir -p $Wdir/project/bin
/bin/cp -f $DIR/project/swarmlab-nmap $Wdir/project/bin
/bin/cp -f $DIR/project/mpich-3.2.tar.gz $Wdir /bin/cp -f $DIR/project/mpich-3.2.tar.gz $Wdir
/bin/cp -f $DIR/project/examples $Wdir/project /bin/cp -f $DIR/project/examples $Wdir/project
/bin/cp -f $DIR/project/hello_world.sh $Wdir/project /bin/cp -f $DIR/project/hello_world.sh $Wdir/project
@ -333,6 +336,8 @@ services:
master: master:
image: $REGISTRY_ADDR:$REGISTRY_PORT/$IMAGE_NAME image: $REGISTRY_ADDR:$REGISTRY_PORT/$IMAGE_NAME
privileged: true privileged: true
environment:
- NODENAME=${NODENAME}
cap_add: cap_add:
- NET_ADMIN - NET_ADMIN
user: root user: root
@ -348,6 +353,8 @@ services:
worker: worker:
image: $REGISTRY_ADDR:$REGISTRY_PORT/$IMAGE_NAME image: $REGISTRY_ADDR:$REGISTRY_PORT/$IMAGE_NAME
privileged: true privileged: true
environment:
- NODENAME=${NODENAME}
cap_add: cap_add:
- NET_ADMIN - NET_ADMIN
user: root user: root

Loading…
Cancel
Save