<commit_before># cheat sheet commands for lab #1
# life is more fun when you do it yourself...
# but sometimes you do get stuck and we understand  :)

openstack security group rule create --dst-port 80 --protocol tcp --ingress default
openstack security group rule create --dst-port 22 --protocol tcp --ingress default

INTERNAL_NETWORK_ID=`openstack network show internal -c id -f value`

openstack server create --image CirrosWeb --flavor m1.tiny --nic net-id=$INTERNAL_NETWORK_ID WebServer -c id -f value
FLOATING_IP=`openstack floating ip create public -c floating_ip_address -f value`
openstack server add floating ip WebServer $FLOATING_IP

openstack server create --image CirrosWeb --flavor m1.tiny --nic net-id=$INTERNAL_NETWORK_ID WebClient -c id -f value
FLOATING_IP=`openstack floating ip create public -c floating_ip_address -f value`
openstack server add floating ip WebClient $FLOATING_IP

INGRESS_PORT_ID=`openstack port create --network internal ingress-01 -c id -f value`
EGRESS_PORT_ID=`openstack port create --network internal egress-01 -c id -f value`

NETMON_ID=`openstack server create --image NetMon --flavor m1.small \
        --nic   net-id=$INTERNAL_NETWORK_ID \
        --nic   port-id=$INGRESS_PORT_ID \
        --nic   port-id=$EGRESS_PORT_ID \
        NetMon -c id -f value`
FLOATING_IP=`openstack floating ip create public -c floating_ip_address -f value`
openstack server add floating ip NetMon $FLOATING_IP


WEBCLIENT_ID=`openstack port list --server WebClient -c ID -f value`
neutron flow-classifier-create   --description "HTTP traffic from WebClient" \
                                 --logical-source-port $WEBCLIENT_ID \
                                 --ethertype IPv4 \
                                 --protocol tcp \
                                 --destination-port 80:80 WebClientFC
neutron port-pair-create --description "NetMon" \
                         --ingress ingress-01 \
                         --egress egress-01 PP1
neutron port-pair-group-create --port-pair PP1 PPG1
neutron port-chain-create --port-pair-group PPG1 --flow-classifier WebClientFC PC1
<commit_msg>Update Lab1-Answers.sh<commit_after># cheat sheet commands for lab #1
# life is more fun when you do it yourself...
# but sometimes you do get stuck and we understand  :)

openstack security group rule create --dst-port 80 --protocol tcp --ingress default
openstack security group rule create --dst-port 22 --protocol tcp --ingress default

INTERNAL_NETWORK_ID=`openstack network show internal -c id -f value`

openstack server create --image CirrosWeb --flavor m1.tiny --nic net-id=$INTERNAL_NETWORK_ID WebServer -c id -f value
FLOATING_IP=`openstack floating ip create public -c floating_ip_address -f value`
openstack server add floating ip WebServer $FLOATING_IP

openstack server create --image CirrosWeb --flavor m1.tiny --nic net-id=$INTERNAL_NETWORK_ID WebClient -c id -f value
FLOATING_IP=`openstack floating ip create public -c floating_ip_address -f value`
openstack server add floating ip WebClient $FLOATING_IP

INGRESS_PORT_ID=`openstack port create --network internal ingress-01 -c id -f value`
EGRESS_PORT_ID=`openstack port create --network internal egress-01 -c id -f value`

NETMON_ID=`openstack server create --image NetMon --flavor m1.small \
        --nic   net-id=$INTERNAL_NETWORK_ID \
        --nic   port-id=$INGRESS_PORT_ID \
        --nic   port-id=$EGRESS_PORT_ID \
        NetMon -c id -f value`
FLOATING_IP=`openstack floating ip create public -c floating_ip_address -f value`
openstack server add floating ip NetMon $FLOATING_IP


WEBCLIENT_ID=`openstack port list --server WebClient -c ID -f value`
neutron flow-classifier-create   --description "HTTP traffic from WebClient" \
                                 --logical-source-port $WEBCLIENT_ID \
                                 --ethertype IPv4 \
                                 --protocol tcp \
                                 --destination-port 80:80 FC1
neutron port-pair-create --description "NetMon" \
                         --ingress ingress-01 \
                         --egress egress-01 PP1
neutron port-pair-group-create --port-pair PP1 PPG1
neutron port-chain-create --port-pair-group PPG1 --flow-classifier FC1 PC1

{'fraction_non_alphanumeric': 0.08386336866902237, 'fraction_numerical': 0.012956419316843345, 'mean_word_length': 2.6228668941979523, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3897153', 'n_tokens_mistral': 1257, 'n_tokens_neox': 1215, 'n_words': 431}