diff --git a/contact-details.txt b/contact-details.txt index a19eda5..3565215 100644 --- a/contact-details.txt +++ b/contact-details.txt @@ -1,2 +1,2 @@ -name: first last -email: name@email.com +name: Shai Kamenker +email: kamenker92@gmail.com diff --git a/vagrant/.vagrant/machines/server1/virtualbox/action_provision b/vagrant/.vagrant/machines/server1/virtualbox/action_provision new file mode 100644 index 0000000..991c4b9 --- /dev/null +++ b/vagrant/.vagrant/machines/server1/virtualbox/action_provision @@ -0,0 +1 @@ +1.5:b54041f5-4c69-4c8b-b66b-6dc80a4d6d02 \ No newline at end of file diff --git a/vagrant/.vagrant/machines/server1/virtualbox/action_set_name b/vagrant/.vagrant/machines/server1/virtualbox/action_set_name new file mode 100644 index 0000000..0752b10 --- /dev/null +++ b/vagrant/.vagrant/machines/server1/virtualbox/action_set_name @@ -0,0 +1 @@ +1566334730 \ No newline at end of file diff --git a/vagrant/.vagrant/machines/server1/virtualbox/box_meta b/vagrant/.vagrant/machines/server1/virtualbox/box_meta new file mode 100644 index 0000000..7fc45b0 --- /dev/null +++ b/vagrant/.vagrant/machines/server1/virtualbox/box_meta @@ -0,0 +1 @@ +{"name":"ubuntu/precise64","version":"20170427.0.0","provider":"virtualbox","directory":"boxes/ubuntu-VAGRANTSLASH-precise64/20170427.0.0/virtualbox"} \ No newline at end of file diff --git a/vagrant/.vagrant/machines/server1/virtualbox/creator_uid b/vagrant/.vagrant/machines/server1/virtualbox/creator_uid new file mode 100644 index 0000000..c227083 --- /dev/null +++ b/vagrant/.vagrant/machines/server1/virtualbox/creator_uid @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/vagrant/.vagrant/machines/server1/virtualbox/id b/vagrant/.vagrant/machines/server1/virtualbox/id new file mode 100644 index 0000000..62bd883 --- /dev/null +++ b/vagrant/.vagrant/machines/server1/virtualbox/id @@ -0,0 +1 @@ +b54041f5-4c69-4c8b-b66b-6dc80a4d6d02 \ No newline at end of file diff --git a/vagrant/.vagrant/machines/server1/virtualbox/index_uuid b/vagrant/.vagrant/machines/server1/virtualbox/index_uuid new file mode 100644 index 0000000..c3ed979 --- /dev/null +++ b/vagrant/.vagrant/machines/server1/virtualbox/index_uuid @@ -0,0 +1 @@ +f15ec8cbb9e04025b4d10a6b78ea0e5e \ No newline at end of file diff --git a/vagrant/.vagrant/machines/server1/virtualbox/private_key b/vagrant/.vagrant/machines/server1/virtualbox/private_key new file mode 100644 index 0000000..b43e0c3 --- /dev/null +++ b/vagrant/.vagrant/machines/server1/virtualbox/private_key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEAuPjODk633+6xITW+TT5H1W4U9spp4BHLcYa48LOeL8p1Vqjk +g9ADAbFwcY6S7Ln8tA1aZX9ADmuGujXhWsCVGMNQvPh0XS5dCgnNvVy5GuZKG270 +KW9ltIlOmahhRaGOltmwVzMjQTkyQlpdIOQz9/VIQhVMQvpD5SOSMtBv4d315t/z +RtPqdCp4yFKR2R7UnFb7UOzVkoOaP9R4QNAuchzwW/719N5YSP/JLA02ZarmoJlf +Ry3Sqa+QqPMwCb2O/wE4NxSoxU/9X+brLnPd86n1lAHJdgKRcMtZrnWB9LQcyRqt +OxfbVgh6Vl+OzlKRJEaalKcxGJRoD8L3iGY9xwIDAQABAoIBABLRJM0pzuTV+GkD +eZ+MBWy97R4KC2lDBio/ZVL/Qslj1DoDpnOOVq/2aBT1RxcT+JQsg5SttEuDPsp0 +rr83tjM1s2H1+Ih+LfLWenqYEzCcWs+dovMQJQ2PplJVYcfeno3UCW9lgWGiOu2r +Gaw96td/uWEXn5F0ujF2Q+otcCRO7tO+MTnwcdh/HIVEIOyUjlUhNI4dYYMptNRA +9+PJhTX0MFOk1Z0SQE3h930erKufRRzEU6uOr9/SG399f0i1cTBN/ecLcSslY10p +CdA0wK3sFh4SiBvAP1jp+lX8chdyZ/hnzSxvK5dvyC4PxCmv1KhZiBYLorLPwmsU +O4wRuUECgYEA6OBa1qjaGppG3F2HlMGR9ZUkdiCjcvM+O29FxY3vNcCh/Sf/MX4i +iAFXkTGHYibC+504FGHl4kGxY9kL/GSBwT2m8s14oWRxR133efx1xUEzGoLKlPBt +3Qap0ZdYuKiAWMmoXQ7MO5f+LDpaa/7s6pn7X0YDAKQUhBhUWaF+O2cCgYEAy1a7 +mY80h+U32xF+Eeo43AuN188ag/gdoPANNtX/TldYOjUlFJqt7/3YeIW/eQAgmpFb ++hJ2OwhYDX6nKZPF4x1FTD75cXMgRnp9ZqBdhSVSahgQYLUG+UGR85s10aJZMA6p +M0AOpZgM2qcF7wg5+oxcL9eoCfaJSgjqqC5azqECgYB9nV+CgMw9I1Dr10umEw// +b3aefZaND+ZWuvvgx2HsFb+LRcLi2I4Z3Nd2S0giypPMk47Hd9M/y327RT2w5CoV +qYLfX7QdIof0Hhy64VJJl5TQTRKnalVorwp1MvU5jjLFMemuYKgL0T3ab5OMw5La +LTsptiMyek9SvajqPDFSKwKBgBexH2KhAOnkl0F7JElKFR3uarR+eQRvYGRkE+YT +wQ+LtcfycUOZUjLoTNSeINUkYqgfz6uvgv8V1cycuTVq9l+kBXMA02eYlmYf14Sh +osPkuVmLPD1IWmuobC0KJJcsZ1/mFWjXSd2ZfcXsOBDF0JuUxxj786RViWGK8Gxw +GjyBAoGBAKMkGK+uNRLBtIaS0jvEanLBIH3mTSBJYmFWgnl9FYqhlXVC5IFjDh+J +u7vE9gPpQOdWPiOJ8CtrM8/AJHcp+sOAbdJXlgaX/lfs0VnqZacSX0/hO/8WTWVG +etQWkyQDYR76pDB8pRUcAUpFGDtKtAgnoQds0oL7ePRlstCvbYLV +-----END RSA PRIVATE KEY----- diff --git a/vagrant/.vagrant/machines/server1/virtualbox/synced_folders b/vagrant/.vagrant/machines/server1/virtualbox/synced_folders new file mode 100644 index 0000000..44de99c --- /dev/null +++ b/vagrant/.vagrant/machines/server1/virtualbox/synced_folders @@ -0,0 +1 @@ +{"virtualbox":{"/vagrant":{"guestpath":"/vagrant","hostpath":"C:/Users/shai/Documents/GitHub/candidates-assignment/vagrant","disabled":false,"__vagrantfile":true}}} \ No newline at end of file diff --git a/vagrant/.vagrant/machines/server1/virtualbox/vagrant_cwd b/vagrant/.vagrant/machines/server1/virtualbox/vagrant_cwd new file mode 100644 index 0000000..5d47ea5 --- /dev/null +++ b/vagrant/.vagrant/machines/server1/virtualbox/vagrant_cwd @@ -0,0 +1 @@ +C:/Users/shai/Documents/GitHub/candidates-assignment/vagrant \ No newline at end of file diff --git a/vagrant/.vagrant/machines/server2/virtualbox/action_provision b/vagrant/.vagrant/machines/server2/virtualbox/action_provision new file mode 100644 index 0000000..8e74841 --- /dev/null +++ b/vagrant/.vagrant/machines/server2/virtualbox/action_provision @@ -0,0 +1 @@ +1.5:33720ad2-b642-469b-a5d3-7fcb7b984f7d \ No newline at end of file diff --git a/vagrant/.vagrant/machines/server2/virtualbox/action_set_name b/vagrant/.vagrant/machines/server2/virtualbox/action_set_name new file mode 100644 index 0000000..ed3d9ef --- /dev/null +++ b/vagrant/.vagrant/machines/server2/virtualbox/action_set_name @@ -0,0 +1 @@ +1566334852 \ No newline at end of file diff --git a/vagrant/.vagrant/machines/server2/virtualbox/box_meta b/vagrant/.vagrant/machines/server2/virtualbox/box_meta new file mode 100644 index 0000000..7fc45b0 --- /dev/null +++ b/vagrant/.vagrant/machines/server2/virtualbox/box_meta @@ -0,0 +1 @@ +{"name":"ubuntu/precise64","version":"20170427.0.0","provider":"virtualbox","directory":"boxes/ubuntu-VAGRANTSLASH-precise64/20170427.0.0/virtualbox"} \ No newline at end of file diff --git a/vagrant/.vagrant/machines/server2/virtualbox/creator_uid b/vagrant/.vagrant/machines/server2/virtualbox/creator_uid new file mode 100644 index 0000000..c227083 --- /dev/null +++ b/vagrant/.vagrant/machines/server2/virtualbox/creator_uid @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/vagrant/.vagrant/machines/server2/virtualbox/id b/vagrant/.vagrant/machines/server2/virtualbox/id new file mode 100644 index 0000000..c59ea1f --- /dev/null +++ b/vagrant/.vagrant/machines/server2/virtualbox/id @@ -0,0 +1 @@ +33720ad2-b642-469b-a5d3-7fcb7b984f7d \ No newline at end of file diff --git a/vagrant/.vagrant/machines/server2/virtualbox/index_uuid b/vagrant/.vagrant/machines/server2/virtualbox/index_uuid new file mode 100644 index 0000000..dbf6dbc --- /dev/null +++ b/vagrant/.vagrant/machines/server2/virtualbox/index_uuid @@ -0,0 +1 @@ +a8f6bec7e2c74378b0b2c938fb988d3a \ No newline at end of file diff --git a/vagrant/.vagrant/machines/server2/virtualbox/private_key b/vagrant/.vagrant/machines/server2/virtualbox/private_key new file mode 100644 index 0000000..fe24a5f --- /dev/null +++ b/vagrant/.vagrant/machines/server2/virtualbox/private_key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAsmmGHnher2eR3rRqTVX3Xy4pSiX9y1gW6a6tzGjB8QL7mDXk +ZwYx4PMa+sSca0nRqFL0IMnO0OZ0kLZrLmPQIwG/Fu3XQrGZQNNQ7QVH4Qa3UGsh +ks+Vwa5T4jjWTSenQQBWil5LFk9JWy/0SsNC5Ccv/rzL+dNm52Tjux5GCgXahkv3 +GO1Wzw5kyKx1UVyU2mKk64NUrYF5qCz+8EfEc9kYLmfNA3mc8E+gf6HVwf/RRqSh +bamxY9xQ/6o99SNwi87/EC1I3OzKZ9GeUxx61dPoeAbmhTu06rrSjdMUrvBVUySF +2sDP9Da6PbCguGAC6qk3iL5TxpcUBbEzfkq0dQIDAQABAoIBAHDxfIYtjUNdPWrO +q7zpfwAyKNFX26Ku0VJ90mhkqOH6EWv6Me1Gbq0JOTsm3B7PTHpSiVl4aAS233P9 +Bz0G0uxWXrIVPwBpjasMG17wyOAbcFDogQh/gT5rLY84i/Gr+KWdoStXJhGpf7bK +VMw/cEkexbNtsXMl8S7rH3+FWrFck64gPwaz1FTcCzrinrC9BtpmrfV55y2nVJ0q +9R7gZnLbh+7mVMyzDkorHTerDy13w3UD5iM6w3VCqAIO5oHuK4tvchdW+UwQ4xp1 +aSZZ6ngaHbLqyVacyA1MGElTvKeBUz/OqXfl+Zw/uVwGKtO9x3jk4FX1CHFGfCIL +VmZKOgECgYEA6SCahR1H+9JL0MVKzdoR/Y84yy9Cl5FCMTDOBoSFiHBcq4Xqpqdu +fKc2tQx9lunO5FMjyVokISGd5a3NC3x55/zzFNcLUfIxo/lek2fpMdx4Xu/ffwwu +Y4MjJmiqq+Zz3X1QUWmlcRCupuKHTCrBIPOgluCK5OxW0QqUGBx/7T0CgYEAw+qn +lw/EyAcGgIVrK+/2ba799sjwsQTbpzd/PXgqEA9SM4eGTwQ59CvqLRYW4AN9VbiE +huDeeb+wRMl6nUoIuOALOHjaxzZ9perLFc4Oja0DVoIURjFv2yp0ZG+GKdMP/8ac +9YMUJ30xQnmrzjkOkqVPW62yTror11DDT8vSR5kCgYEA5fGUt+uzzr0Uru2K5RRN +Xm5gNHl/E4ThZyeeb2tTUsqRfVVvp8XKAwXjvhx929bujOM8jyRsMom39o3Bi6zR +iXNESK/7qG5dbEFRec+qgdXWnL25EtVvBBSbHQ1sGnYKntM137d2ydkMi+swTH53 +VAs5wNfl5/r9ft8SR94EiHkCgYEAg7K++84u0uPeHBET7RI/DpZexEFpgyWn3m1x +DEo1xFv4PwlwYLePmbLXlX1O3UGbRD9oXx7UjvUrseHamddFq7l38XtUXiwkJJ+D +62F76QMPxlxk8paTAbo1Sbqqbn0iOSczJdr6dl0y+uO9eUBjqnKTuSY3QbLme7Qf +xwlVjqkCgYB11ye6LPasqX8sTztEBPwQUhCqA+TlMfg+f47dDH20/WHSqKtdKP1G +5ejQxRL47xv6vNjmwWY/9fOTMW0cYoEB7NICJFhIJYDmQlhHk/b3RZRyyw9zJttv +mbZjeF0JVtLr+FTmCWsLQ+hdDgxC8MLCD2oIzg/mtrhLYW1//CND8Q== +-----END RSA PRIVATE KEY----- diff --git a/vagrant/.vagrant/machines/server2/virtualbox/synced_folders b/vagrant/.vagrant/machines/server2/virtualbox/synced_folders new file mode 100644 index 0000000..44de99c --- /dev/null +++ b/vagrant/.vagrant/machines/server2/virtualbox/synced_folders @@ -0,0 +1 @@ +{"virtualbox":{"/vagrant":{"guestpath":"/vagrant","hostpath":"C:/Users/shai/Documents/GitHub/candidates-assignment/vagrant","disabled":false,"__vagrantfile":true}}} \ No newline at end of file diff --git a/vagrant/.vagrant/machines/server2/virtualbox/vagrant_cwd b/vagrant/.vagrant/machines/server2/virtualbox/vagrant_cwd new file mode 100644 index 0000000..5d47ea5 --- /dev/null +++ b/vagrant/.vagrant/machines/server2/virtualbox/vagrant_cwd @@ -0,0 +1 @@ +C:/Users/shai/Documents/GitHub/candidates-assignment/vagrant \ No newline at end of file diff --git a/vagrant/.vagrant/rgloader/loader.rb b/vagrant/.vagrant/rgloader/loader.rb new file mode 100644 index 0000000..c3c05b0 --- /dev/null +++ b/vagrant/.vagrant/rgloader/loader.rb @@ -0,0 +1,9 @@ +# This file loads the proper rgloader/loader.rb file that comes packaged +# with Vagrant so that encoded files can properly run with Vagrant. + +if ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"] + require File.expand_path( + "rgloader/loader", ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"]) +else + raise "Encoded files can't be read outside of the Vagrant installer." +end diff --git a/vagrant/fixScripts/exercise1-fix.sh b/vagrant/fixScripts/exercise1-fix.sh index 1a444f4..55aabbf 100644 --- a/vagrant/fixScripts/exercise1-fix.sh +++ b/vagrant/fixScripts/exercise1-fix.sh @@ -1,2 +1,6 @@ #!/bin/bash #add fix to exercise1 here + +sudo ip route delete 208.86.224.90/32 dev eth0 src 192.168.100.10 + + diff --git a/vagrant/fixScripts/exercise2-fix.sh b/vagrant/fixScripts/exercise2-fix.sh index e8ca137..e60fd14 100644 --- a/vagrant/fixScripts/exercise2-fix.sh +++ b/vagrant/fixScripts/exercise2-fix.sh @@ -1,2 +1,5 @@ #!/bin/bash #add fix to exercise2 here + +sudo sed -i 's/127.0.0.1 www.ascii-art.de/#127.0.0.1 www.ascii-art.de/' /etc/hosts + diff --git a/vagrant/fixScripts/exercise3-fix.sh b/vagrant/fixScripts/exercise3-fix.sh index cfc4cb9..07bc545 100644 --- a/vagrant/fixScripts/exercise3-fix.sh +++ b/vagrant/fixScripts/exercise3-fix.sh @@ -1,2 +1,6 @@ #!/bin/bash #add fix to exercise3 here + +sudo sed -i 's/deny from all/Allow from all/' /etc/apache2/sites-available/default +sudo service apache2 restart + diff --git a/vagrant/fixScripts/exercise4-fix_server1.sh b/vagrant/fixScripts/exercise4-fix_server1.sh index 0555101..c113fb6 100644 --- a/vagrant/fixScripts/exercise4-fix_server1.sh +++ b/vagrant/fixScripts/exercise4-fix_server1.sh @@ -1,2 +1,8 @@ #!/bin/bash #add fix to exercise4-server1 here + +sudo chown vagrant /etc/hosts +echo "192.168.100.11 server2" >> /etc/hosts +sudo chown root /etc/hosts + + diff --git a/vagrant/fixScripts/exercise4-fix_server2.sh b/vagrant/fixScripts/exercise4-fix_server2.sh index 8f91d6f..c61c8d0 100644 --- a/vagrant/fixScripts/exercise4-fix_server2.sh +++ b/vagrant/fixScripts/exercise4-fix_server2.sh @@ -1,2 +1,6 @@ #!/bin/bash #add fix to exercise4-server2 here + +sudo chown vagrant /etc/hosts +echo "192.168.100.10 server1" >> /etc/hosts +sudo chown root /etc/hosts diff --git a/vagrant/fixScripts/exercise5-fix_server1.sh b/vagrant/fixScripts/exercise5-fix_server1.sh index a55c0bd..6b49936 100644 --- a/vagrant/fixScripts/exercise5-fix_server1.sh +++ b/vagrant/fixScripts/exercise5-fix_server1.sh @@ -1,2 +1,6 @@ #!/bin/bash #add fix to exercise5-server1 here + +ssh-keygen +ssh-copy-id vagrant@192.168.100.11 +ssh -o "StrictHostKeyChecking=no" vagrant@server2 diff --git a/vagrant/fixScripts/exercise5-fix_server2.sh b/vagrant/fixScripts/exercise5-fix_server2.sh index cb527b1..51911d2 100644 --- a/vagrant/fixScripts/exercise5-fix_server2.sh +++ b/vagrant/fixScripts/exercise5-fix_server2.sh @@ -1,2 +1,7 @@ #!/bin/bash #add fix to exercise5-server2 here + +ssh-keygen +ssh-copy-id vagrant@192.168.100.10 +ssh -o "StrictHostKeyChecking=no" vagrant@server1 + diff --git a/vagrant/fixScripts/exercise6-fix.sh b/vagrant/fixScripts/exercise6-fix.sh index 0379480..fec1d2c 100644 --- a/vagrant/fixScripts/exercise6-fix.sh +++ b/vagrant/fixScripts/exercise6-fix.sh @@ -1,2 +1,27 @@ #!/bin/bash -#add fix to exercise6-fix here +#e6-fix here + +if [ $# -lt 2 ]; +then + echo "Need to insert at least 2 parameter" + echo "exercise6-fix.sh [ file1 [, file2, ..], dest_dir ]" + exit 2 + +else + ARGS=("$@") + #AR=ARGS[${ARGS[@]}-1] + unset ARGS[${#ARGS[@]}-1] + counter=0 + fileSize=0 + dest="${@: -1}" + for file in "${ARGS[@]}"; + do + scp $file vagrant@server2:/$dest + fileSize="$(stat --printf="%s" "$file")" + counter=$((fileSize + counter)) + done + + echo $counter +fi + +