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..fcb5599 --- /dev/null +++ b/vagrant/.vagrant/machines/server1/virtualbox/action_provision @@ -0,0 +1 @@ +1.5:22ed3fb4-4144-4f04-a6f5-a6d246f652b3 \ 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..187716b --- /dev/null +++ b/vagrant/.vagrant/machines/server1/virtualbox/action_set_name @@ -0,0 +1 @@ +1582401875 \ 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..b07fb70 --- /dev/null +++ b/vagrant/.vagrant/machines/server1/virtualbox/id @@ -0,0 +1 @@ +22ed3fb4-4144-4f04-a6f5-a6d246f652b3 \ 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..fdcdd0a --- /dev/null +++ b/vagrant/.vagrant/machines/server1/virtualbox/index_uuid @@ -0,0 +1 @@ +07eaa42d7110459cbc98566fba8103d5 \ 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..6807136 --- /dev/null +++ b/vagrant/.vagrant/machines/server1/virtualbox/private_key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAyPA2mPVKdwwffaleE03VgSaYUXdq1cpSWz/K7//kOmawncAm +yd5ZUJat8bps3BGVf+EkISj3ha3MDrWJ08NuRqnhnXiSxXAypObCJDC1pcKQFcGB +CbLPUKMKo7WKe8SuaW7bKOK3uf4jsb9H6wYk+4D3Ma4sULSa7m4PyHh+j6//CC6s +wvd4Zj8iHg7qFuj+YM0GFlWbKKRaXhbzkBboSf8/qYaYOpQeU24l4wwm+CzHh6RQ +VEVKhKhzC/24EPBCBnGsohcM1iuIi+YEqiVcjoRiWT9H5t2qxLsOCwjMABXq038S +M7EyVT30+36LKpAI/wuw7ohLL7KaoljIdJxPLwIDAQABAoIBABf/cFXWPb14Ci7E +0oJ1skEJbfmUzIKZ9joFpWQCaKx85S0B7OABGSOhy0ZqYGPsCbHLHriDHwStHAjJ +r5tF5N61nUdkRgskejftg1Q1KQyR7wlaIeIZo97aigPBQ7fCZp4a6ju4z/57lqG8 +2Yb9Jd+PqHYbehltaG9/X40urtbUFOffhsw/dni5vaD4Zfea+hw2Qsxjmp/XBFxh +Bwf71PIp5TCpjt7naLIV/Bd8RjOElprfSJWkCZ+GaqEmO6f1bUXPRafzIMEFjL0n +SEe2P0MDspImgoA6OoKSihJ5y3OM7BpN3ujqAi5zL9zCgvXTeb4KqOM6Dvs364nF +rKqbBzECgYEA63RlKo7vb3JdqNNTmz+OjbvCvy1tlTwgq8B/KeJrql3vHTXB662m +XtOLO5ay3kXm63SrzdmOx6fIoyNroBs66kUfApmTNznDDLHUsSn7mk1amF/og889 +JCXDUgEsIjX7z4lJNYt/vhT7Xk2kDQt4It1zN67yu+zipB3wkW8kz8cCgYEA2njK +G6xaXlACoJ2UD67ty7IUBf9MNIRrNeFIyUkZNMOkWjuNerjgzx4Rvws3cTHe9V/e +hnB8565Umta3jMBTzVSFR6R4beQoc2PtoNqEIUK8CW5c7SYG8OS7EvlZYOgEVbr8 +a8IqWn7RLqOSN/xozFdJrx76D/SDqjA+iA+VVVkCgYEAnJok82JwJBrX6oLr97UV +FnXMeKU5XmnIfROiQHRlEcI6WJ45pYwwvJ9M2sxHmYi6pt5JqrdJvMd+rerQGYQi +8lAY6PzGKpQTg+z/PvpiauWKHRClMI3054bqWy+GcBahrg5sj92BkCaabcWMGFUJ +iX7qtB17Ory6nVeAeuqGfF8CgYEArpr/HKLhDqNvliKapPYvwy6t5iUmKIr0jHlj +DMxJQuxhvGQALOb5dU8Y69DxHJy5Du7yEAxzJ08i+yVESU+lKmO0qY9/WISS97YT +ww0hsNt/ISJ9TmOoBHsqMH3suxBz9nidKRpjczQLxvSf9fLbZwUUNMvTG1FWsXwh +XejmdvECgYBvJyGJoVOHMN3YnTZ1NxY8S34/Qh4JwhI+ykwORnWmBhWG9RMHcfjb +TAliG1RtWq2gscTfuNHs1hVNkd/4F7OqfQvTckrQaEpc646Pjx9wmV+Sjy8AONqv +W0cEErB0XiPHrqzKbraWieUxpxlDEIPoPq0j+M6hb+TPWxPqNcCVtA== +-----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..9b7e95d --- /dev/null +++ b/vagrant/.vagrant/machines/server2/virtualbox/action_provision @@ -0,0 +1 @@ +1.5:932483b0-c5f4-4704-961f-c1b2780993fd \ 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..8d9609a --- /dev/null +++ b/vagrant/.vagrant/machines/server2/virtualbox/action_set_name @@ -0,0 +1 @@ +1582401984 \ 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..ca740b1 --- /dev/null +++ b/vagrant/.vagrant/machines/server2/virtualbox/id @@ -0,0 +1 @@ +932483b0-c5f4-4704-961f-c1b2780993fd \ 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..c97f5eb --- /dev/null +++ b/vagrant/.vagrant/machines/server2/virtualbox/index_uuid @@ -0,0 +1 @@ +7286dc18c6524bde9fca6763b94da4e0 \ 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..7463b1c --- /dev/null +++ b/vagrant/.vagrant/machines/server2/virtualbox/private_key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpQIBAAKCAQEA4MQEUFKjP9Cr23d/5yd3nj4XvQVXa3guzbuyoJsZE3keMDsv +1HhXipG5wL0ZkdX7CUr7XEGuYuE2Z9wlnxEC2wYR3Uhb22+/GnCNrJ4LkCfU3Rjs +TtvazQNZ6fY4F0NqDQ7dduDIskfrRQB3s7vEt7hRNktlc6zADPsN5+EK20aNWCFf +HYalseFMpfNb/+3yvlJXPCSk865EwMbH06TbaMEVn/rsISfGhozVZEK9PeCsQvCA +2dm4DuyAOgFRu8PFBZv3YhA5GCepwQFZz2F+4tMBHXZNoclPJK8WjTdegp8FpDQM +7FRKjJdENUkeuimx+U+FbGDqTy6hpctnGvJDeQIDAQABAoIBAQDOVOMo4VOfh23c +YIz3pBF5IMMl8DtaGs/MaRwHt5mDeNIvsIWt5HNob3I37uAEMozq8PxiqqDtgJUz +LrMSnMkkSyQnIP/CJ4klOmG0LrmqsgYEmZaEperr/MGTt0WyhV5bcmP3d06F6uOd +SlqYkix6Ayf6UahmUhVTVTxkuv/+XcMz6hA7jajJEckZlqsT7bwCmhi08FKwIm8d +zsN2LCPv7AFyo9JDkqqbokXosMZP+EhYYt+j7niUmbkAg6QKAI6/SF/+2Im2nbr0 +eupawwg4uLHx3BtgTqOH8CJ1CZK3f8R8cJ3SsRvxZkvcwUjR1QDSZAIBoqxSLnbq +o4CApnsBAoGBAPk4BuMLqw/MM1fBcWtBBguu1Aw9TzoaTE9jQSAPnfJaMgV0ZW8h +Dbw4wvemIcTgy/guvlDRhNJgsz0/dizYR3Ll7KZ0Nq67WMu2TedXu2P9IBApZ8Ey +TMuiLvcwZIKY5w8i8nrhqWlGv40quIIXCo8I9eKvmJ10rS5tw8Kezx8xAoGBAObh +qFfXwg2TQRmVWo9m2IQgTzDqUb8q9UjO7n0vN3P2bqZgEgZk5yXGJZE0eIvErvPI +2UNHkCcRz4FQ52Tcy0BLlcEMPxnGLVnkYR93ng8ANp5+gMlMvz59A0HD1Teqw/Q9 +gk7A0+OAGFH8HjEjXWvF58yrYmW78zzD0bUhaabJAoGBAI8gdCQU4WszNRFjEUYt +k9FF2JYm58dQrx6wvAgzr9wtnKixTkfiTccZOi+MA7zT9ZBVGAvGKGfCDW5RcgcT +NwVvstdtyrHS+o4T5u3D3uTvzGg7v1CfGKeiPyLLcg3mzlxND8EutGK3tO7X6Bse +LHw1AzHq8tUK2yLc+x5cokshAoGBANs+ynewQWxWu2kp9PdcOJsve0P+H2ajyo07 +RCnIXqZWC7keXb+Irh+mzCHZa+d9/I0v23ESUgdn2F76juGu8au6mxjZIkq9cG9+ +eeRB2OxxzWwwwOdnY+xZFnCrIJxeIvqaNlXGsu/EwlOIULtk09/17SrkTOpC0raP +VWLluchRAoGAY2DmKTs30xTPL4H1jbGRgNJ8Y7BsfcVtAPGx1G63jLGTftFIO/YY +UZ4Q8OZ1VofcREESfptOxTOU9VSbR6/QfGMOkQ8KLwSJVZcpyXPSG1fDxJgQcENF +dvXUPJokmb982oqJYG07ublu3c+3BnUmdyNfIEKKNSPPOoDGhPn9zf8= +-----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..d00fb43 100644 --- a/vagrant/fixScripts/exercise1-fix.sh +++ b/vagrant/fixScripts/exercise1-fix.sh @@ -1,2 +1,5 @@ #!/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..13b35eb 100644 --- a/vagrant/fixScripts/exercise3-fix.sh +++ b/vagrant/fixScripts/exercise3-fix.sh @@ -1,2 +1,5 @@ #!/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..c62d95f 100644 --- a/vagrant/fixScripts/exercise4-fix_server1.sh +++ b/vagrant/fixScripts/exercise4-fix_server1.sh @@ -1,2 +1,6 @@ #!/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..51dfe05 100644 --- a/vagrant/fixScripts/exercise5-fix_server2.sh +++ b/vagrant/fixScripts/exercise5-fix_server2.sh @@ -1,2 +1,6 @@ #!/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..0c0e102 100644 --- a/vagrant/fixScripts/exercise6-fix.sh +++ b/vagrant/fixScripts/exercise6-fix.sh @@ -1,2 +1,26 @@ -#!/bin/bash #add fix to exercise6-fix here + +#!/bin/bash + +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