├── 0x00-shell_basics ├── .0-current_working_directory.swp ├── .14-copy_html.swp ├── .base.swp ├── .school.mgc.swo ├── .school.mgc.swp ├── 0-current_working_directory ├── 1-listit ├── 10-back ├── 100-lets_mov ├── 100-lets_move ├── 101-clean_emacs ├── 102-tree ├── 103-commas ├── 11-lists ├── 12-file_type ├── 13-symbolic_link ├── 14-copy_html ├── 2-bring_me_home ├── 3-listfiles ├── 4-listmorefiles ├── 5-listfilesdigitonly ├── 6-firstdirectory ├── 7-movethatfile ├── 8-firstdelete ├── 9-firstdirdeletion ├── README.md ├── base ├── later ├── runit5 └── school.mgc ├── 0x01-shell_permissions ├── .2-groups.swp ├── 0-iam_betty ├── 1-who_am_i ├── 10-mirror_permissions ├── 100-change_owner_and_group ├── 101-symbolic_link_permissions ├── 102-if_only ├── 103-Star_Wars ├── 11-directories_permissions ├── 12-directory_permissions ├── 13-change_group ├── 2-groups ├── 3-new_owner ├── 4-empty ├── 5-execute ├── 6-multiple_permissions ├── 7-everybody ├── 8-James_Bond ├── 9-John_Doe └── README.md ├── 0x02-shell_redirections ├── .15-countthatword.swp ├── .7-file.swp ├── 0-hello_world ├── 1-confused_smiley ├── 10-no_more_js ├── 100-empty_casks ├── 101-gifs ├── 102-acrostic ├── 103-the_biggest_fan ├── 11-directories ├── 12-newest_files ├── 13-unique ├── 14-findthatword ├── 15-countthatword ├── 16-whatsnext ├── 17-hidethisword ├── 18-letteronly ├── 19-AZ ├── 2-hellofile ├── 20-hiago ├── 21-reverse ├── 22-users_and_homes ├── 3-twofiles ├── 4-lastlines ├── 5-firstlines ├── 6-third_line ├── 7-file ├── 8-cwd_state ├── 9-duplicate_last_line └── README.md ├── 0x03-shell_variables_expansions ├── .102-odd.swp ├── 0-alias ├── 1-hello_you ├── 10-love_exponent_breath ├── 100-decimal_to_hexadecimal ├── 101-rot13 ├── 102-odd ├── 103-water_and_stir ├── 11-binary_to_decimal ├── 12-combinations ├── 13-print_float ├── 2-path ├── 3-paths ├── 4-global_variables ├── 5-local_variables ├── 6-create_local_variable ├── 7-create_global_variable ├── 8-true_knowledge ├── 9-divide_and_rule └── README.md ├── 0x04-loops_conditions_and_parsing ├── 0-RSA_public_key.pub ├── 0-RSA_public_keyy.pub ├── 1-for_best_school ├── 10-fizzbuzz ├── 100-read_and_cut ├── 101-tell_the_story_of_passwd ├── 102-lets_parse_apache_logs ├── 103-dig_the-data ├── 2-while_best_school ├── 3-until_best_school ├── 4-if_9_say_hi ├── 5-4_bad_luck_8_is_your_chance ├── 6-superstitious_numbers ├── 7-clock ├── 8-for_ls ├── 9-to_file_or_not_to_file ├── README.md ├── apache-access.log └── joy.c ├── 0x05-processes_and_signals ├── 0-what-is-my-pid ├── 1-list_your_processes ├── 100-process_and_pid_file ├── 101-manage_my_process ├── 102-zombie.c ├── 2-show_your_bash_pid ├── 3-show_your_bash_pid_made_easy ├── 4-to_infinity_and_beyond ├── 5-dont_stop_me_now ├── 6-stop_me_if_you_can ├── 7-highlander ├── 8-beheaded_process ├── README.md └── manage_my_process ├── 0x06-regular_expressions ├── 0-simply_match_school.rb ├── 1-repetition_token_0.rb ├── 100-textme.rb ├── 2-repetition_token_1.rb ├── 3-repetition_token_2.rb ├── 4-repetition_token_3.rb ├── 5-beginning_and_end.rb ├── 6-phone_number.rb ├── 7-OMG_WHY_ARE_YOU_SHOUTING.rb └── README.md ├── 0x07-networking_basics ├── 0-OSI_model ├── 1-types_of_network ├── 2-MAC_and_IP_address ├── 3-UDP_and_TCP ├── 4-TCP_and_UDP_ports ├── 5-is_the_host_on_the_network └── README.md ├── 0x08-networking_basics_2 ├── 0-change_your_home_IP ├── 1-show_attached_IPs ├── 100-port_listening_on_localhost └── README.md ├── 0x09-web_infrastructure_design ├── 0-simple_web_stack ├── 1-distributed_web_infrastructure ├── 2-secured_and_monitored_web_infrastructure ├── 3-scale_up └── README.md ├── 0x0A-configuration_management ├── 0-create_a_file.pp ├── 1-install_a_package.pp ├── 2-execute_a_command.pp └── README.md ├── 0x0B-ssh ├── 0-use_a_private_key ├── 1-create_ssh_key_pair ├── 100-puppet_ssh_config.pp ├── 2-ssh_config └── README.md ├── 0x0C-web_server ├── 0-transfer_file ├── 1-install_nginx_web_server ├── 2-setup_a_domain_name ├── 3-redirection ├── 4-not_found_page_404 ├── 7-puppet_install_nginx_web_server.pp └── README.md ├── 0x0D-web_stack_debugging_0 ├── 0-give_me_a_page └── README.md ├── 0x0E-web_stack_debugging_1 ├── 1 ├── 0-nginx_likes_port_80 ├── 1-debugging_made_short └── README.md ├── 0x0F-load_balancer ├── 0-custom_http_response-header ├── 1-install_load_balancer ├── 2-puppet_custom_http_response-header.pp └── README.md ├── 0x10-https_ssl ├── 0-world_wide_web ├── 1-haproxy_ssl_termination ├── 100-redirect_http_to_https └── README.md ├── 0x11-what_happens_when_your_type_google_com_in_your_browser_and_press_enter ├── 0-blog_post ├── 1-what_happen_when_diagram └── 2-contribution-to_what-happens-when_github_answer ├── 0x12-web_stack_debugging_2 ├── 0-iamsomeoneelse ├── 1-run_nginx_as_nginx ├── 100-fix_in_7_lines_or_less └── README.md ├── 0x13-firewall ├── 0-block_all_incoming_traffic_but ├── 100-port_forwarding └── README.md ├── 0x14-mysql ├── 4-mysql_configuration_primary ├── 4-mysql_configuration_replica ├── 5-mysql_backup └── README.md ├── 0x15-api ├── 0-gather_data_from_an_API.py ├── 0-gather_data_from_an_API.py.ignore ├── 1-export_to_CSV.py ├── 2-export_to_JSON.py ├── 2.json ├── 3-dictionary_of_list_of_dictionaries.py ├── README.md └── todo_all_employees.json ├── 0x16-api_advanced ├── 0-subs.py ├── 1-top_ten.py ├── 100-count.py ├── 2-recurse.py └── README.md ├── 0x17-web_stack_debugging_3 ├── 0-strace_is_your_friend.pp └── README.md ├── 0x18-webstack_monitoring ├── 2-setup_datadog └── README.md ├── 0x19-postmortem ├── README.md ├── about.md └── image.png ├── 0x1A-application_server └── README.md ├── 0x1B-web_stack_debugging_4 ├── 0-the_sky_is_the_limit_not.pp ├── 1-user_limit.pp └── README.md ├── README.md ├── attack_is_the_best_defense ├── 0-sniffing ├── 1-dictionary_attack └── README.md └── command_line_for_the_win ├── 0-first_9_tasks.jpg ├── 0-first_9_tasks.png ├── 1-next-9-tasks.png ├── 1-next_9_tasks.png ├── 2-last-9-tasks.png ├── 2-next_9_tasks.png └── README.md /0x00-shell_basics/.0-current_working_directory.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tecnophille/alx-system_engineering-devops/374596ec9f74abbb1ee4dd338977228131f153e1/0x00-shell_basics/.0-current_working_directory.swp -------------------------------------------------------------------------------- /0x00-shell_basics/.14-copy_html.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tecnophille/alx-system_engineering-devops/374596ec9f74abbb1ee4dd338977228131f153e1/0x00-shell_basics/.14-copy_html.swp -------------------------------------------------------------------------------- /0x00-shell_basics/.base.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tecnophille/alx-system_engineering-devops/374596ec9f74abbb1ee4dd338977228131f153e1/0x00-shell_basics/.base.swp -------------------------------------------------------------------------------- /0x00-shell_basics/.school.mgc.swo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tecnophille/alx-system_engineering-devops/374596ec9f74abbb1ee4dd338977228131f153e1/0x00-shell_basics/.school.mgc.swo -------------------------------------------------------------------------------- /0x00-shell_basics/.school.mgc.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tecnophille/alx-system_engineering-devops/374596ec9f74abbb1ee4dd338977228131f153e1/0x00-shell_basics/.school.mgc.swp -------------------------------------------------------------------------------- /0x00-shell_basics/0-current_working_directory: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | pwd 3 | -------------------------------------------------------------------------------- /0x00-shell_basics/1-listit: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ls 3 | -------------------------------------------------------------------------------- /0x00-shell_basics/10-back: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd - 3 | -------------------------------------------------------------------------------- /0x00-shell_basics/100-lets_mov: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ransom 3 | -------------------------------------------------------------------------------- /0x00-shell_basics/100-lets_move: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | mv [A-Z]* /tmp/u 3 | -------------------------------------------------------------------------------- /0x00-shell_basics/101-clean_emacs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rm *~ 3 | -------------------------------------------------------------------------------- /0x00-shell_basics/102-tree: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | mkdir {welcome,welcome/to,welcome/to/school} 3 | -------------------------------------------------------------------------------- /0x00-shell_basics/103-commas: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ls -map 3 | -------------------------------------------------------------------------------- /0x00-shell_basics/11-lists: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ls -la . .. /boot 3 | -------------------------------------------------------------------------------- /0x00-shell_basics/12-file_type: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | file /tmp/iamafile 3 | -------------------------------------------------------------------------------- /0x00-shell_basics/13-symbolic_link: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ln -s /bin/ls __ls__ 3 | -------------------------------------------------------------------------------- /0x00-shell_basics/14-copy_html: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cp *.html ../ 3 | -------------------------------------------------------------------------------- /0x00-shell_basics/2-bring_me_home: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd 3 | -------------------------------------------------------------------------------- /0x00-shell_basics/3-listfiles: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ls -l 3 | -------------------------------------------------------------------------------- /0x00-shell_basics/4-listmorefiles: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ls -la 3 | -------------------------------------------------------------------------------- /0x00-shell_basics/5-listfilesdigitonly: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ls -all -n 3 | -------------------------------------------------------------------------------- /0x00-shell_basics/6-firstdirectory: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | mkdir /tmp/my_first_directory 3 | -------------------------------------------------------------------------------- /0x00-shell_basics/7-movethatfile: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | mv /tmp/betty /tmp/my_first_directory 3 | -------------------------------------------------------------------------------- /0x00-shell_basics/8-firstdelete: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rm -r /tmp/my_first_directory/betty 3 | -------------------------------------------------------------------------------- /0x00-shell_basics/9-firstdirdeletion: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rm -r /tmp/my_first_directory 3 | -------------------------------------------------------------------------------- /0x00-shell_basics/README.md: -------------------------------------------------------------------------------- 1 | ## 0x00. Shell, basics Day 2 | 3 | [0-current_working_directory](./0-current_working_directory) - Write a script that prints the absolute path name of the current working directory. 4 | 5 | [1-listit](./1-listit) - Display the contents list of your current directory. 6 | 7 | [2-bring_me_home](./2-bring_me_home) - Write a script that changes the working directory to the user’s home directory. 8 | You are not allowed to use any shell variables 9 | 10 | [3-listfiles](./3-listfiles) - Display current directory contents in a long format 11 | 12 | [4-listmorefiles](./4-listmorefiles) - Display current directory contents, including hidden files (starting with .). Use the long format. 13 | 14 | [5-listfilesdigitonly](./5-listfilesdigitonly) - Display current directory contents. 15 | Long format 16 | with user and group IDs displayed numerically 17 | And hidden files (starting with .) 18 | 19 | [6-firstdirectory](./6-firstdirectory) - Create a script that creates a directory named my_first_directory in the /tmp/ directory. 20 | 21 | [7-movethatfile](./7-movethatfile) - Move the file betty from /tmp/ to /tmp/my_first_directory. 22 | 23 | [8-firstdelete](./8-firstdelete) - Delete the file betty. 24 | 25 | The file betty is in /tmp/my_first_directory 26 | 27 | [9-firstdirdeletion](./9-firstdirdeletion) - Delete the directory my_first_directory that is in the /tmp directory. 28 | 29 | [10-back](./10-back) - Write a script that changes the working directory to the previous one. 30 | 31 | [11-lists](./11-lists) -Write a script that lists all files (even ones with names beginning with a period character, which are normally hidden) in the current directory and the parent of the working directory and the /boot directory (in this order), in long format. 32 | 33 | [12-file_type](./12-file_type) - Write a script that prints the type of the file named iamafile. The file iamafile will be in the /tmp directory when we will run your script. 34 | 35 | [13-symbolic_link](./13-symbolic_link) - Create a symbolic link to /bin/ls, named __ls__. The symbolic link should be created in the current working directory. 36 | 37 | [14-copy_html](./14-copy_html) - Create a script that copies all the HTML files from the current working directory to the parent of the working directory, but only copy files that did not exist in the parent of the working directory or were newer than the versions in the parent of the working directory. You can consider that all HTML files have the extension .html 38 | 39 | [15-lets_move](./15-lets_move) - Create a script that moves all files beginning with an uppercase letter to the directory /tmp/u. You can assume that the directory /tmp/u will exist when we will run your script 40 | 41 | [16-clean_emacs](./16-clean_emacs) - Create a script that deletes all files in the current working directory that end with the character ~. 42 | 43 | [17-tree](./17-tree) - Create a script that creates the directories welcome/, welcome/to/ and welcome/to/school in the current directory. You are only allowed to use two spaces in your script, not more. 44 | 45 | [18-commas](./18-commas) - Write a command that lists all the files and directories of the current directory, separated by commas (,). 46 | 47 | Directory names should end with a slash (/) 48 | Files and directories starting with a dot (.) should be listed 49 | The listing should be alpha ordered, except for the directories . and .. which should be listed at the very beginning 50 | Only digits and letters are used to sort; Digits should come first 51 | You can assume that all the files we will test with will have at least one letter or one digit 52 | The listing should end with a new line. 53 | 54 | [school.mgc](./school.mgc) - Create a magic file holberton.mgc that can be used with the command file to detect School data files. School data files always contain the string SCHOOL at offset 0. 55 | 56 | 57 | 58 | 59 | 60 | Shell Basics Tasks. From 0 - 18 are scripts and must start with a Shebang. After a script is created using vi or emacs, we give the system permission to read the script by writing chmod 755 FileName, afterwards write chmod u+x FileName. We do this just before writing git add , committing and pushing. 61 | 62 | 0 - pwd this is used to print the absolute path name of the working directory 63 | 64 | 1 - ls this is used to list directory content 65 | 66 | 2 - cd this is used to change directory 67 | 68 | 3 - ls -l this is used to list the directory content in long form 69 | 70 | 4 - ls -la this is used to list directory content in long form, including hidden files 71 | 72 | 5 - ls -la this is used to list files (including hidden files in a long format) in a directory. 73 | 74 | 6 - mkdir /tmp/my_first_directory this is used to creat the my_first_directory dir inside tmp directory 75 | 76 | 7 - mv /tmp/betty /tmp/my_first_directory/betty this is used to mvoe betty which is inside tmp dir into my_first_directory dir which is also inside the tmp dir 77 | 78 | 8 - rm /tmp/my_first_directory/betty this is used to remove the file betty from the my_first_directory dir 79 | 80 | 9 - rm -r /tmp/my_first_directory this used to remove the my_first_directory dir which is inside tmp dir 81 | 82 | 10 - cd - this is used to change the working directory to the previous directory 83 | 84 | 11 - ls -la . .. /boot this is used to list all files in the current directory and the parent of the working dir and the /boot dir in long format 85 | 86 | 12 - file /tmp/iamafile this is used to print the type of file named iamafile 87 | 88 | 13 - ln -s /bin/ls __ls__ this is used to create a symbolic link called __ls__ inside /bin/ls 89 | 90 | 14 - cp *.html ../ This is used to copy all html files from the current working directory to the parent working directory, but only copy files that did not exist in the parent of the working directory or were newer than the versions in the parent of the working directory 91 | 92 | 15 - mv [A-Z]* /tmp/u this is used to move all files that begin with an uppercase letter to the directory /tmp/u 93 | 94 | 16 - rm *~ this is used to delete all files in the current working directory that ends with the character ~ 95 | 96 | 17 - mkdir {welcome/, welcome/to/, welcome_/to/school} this is used to create multiple directories 97 | 98 | 18 - ls -map this is used to list all the files and directories of the current directory, separated by commas. The directory names should end with a slash, files and directories starting with a dot should be listed, etc. 99 | 100 | 19 - 0 string SCHOOL School data 101 | !:mime School ( this is not a script so it won't star with a Shebang. It's a simple magic file). 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /0x00-shell_basics/base: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tecnophille/alx-system_engineering-devops/374596ec9f74abbb1ee4dd338977228131f153e1/0x00-shell_basics/base -------------------------------------------------------------------------------- /0x00-shell_basics/later: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | mv *[A-Z] 3 | -------------------------------------------------------------------------------- /0x00-shell_basics/runit5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tecnophille/alx-system_engineering-devops/374596ec9f74abbb1ee4dd338977228131f153e1/0x00-shell_basics/runit5 -------------------------------------------------------------------------------- /0x00-shell_basics/school.mgc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tecnophille/alx-system_engineering-devops/374596ec9f74abbb1ee4dd338977228131f153e1/0x00-shell_basics/school.mgc -------------------------------------------------------------------------------- /0x01-shell_permissions/.2-groups.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tecnophille/alx-system_engineering-devops/374596ec9f74abbb1ee4dd338977228131f153e1/0x01-shell_permissions/.2-groups.swp -------------------------------------------------------------------------------- /0x01-shell_permissions/0-iam_betty: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | su betty 3 | -------------------------------------------------------------------------------- /0x01-shell_permissions/1-who_am_i: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | groups 3 | -------------------------------------------------------------------------------- /0x01-shell_permissions/10-mirror_permissions: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | chmod --reference=olleh hello 3 | -------------------------------------------------------------------------------- /0x01-shell_permissions/100-change_owner_and_group: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | chown vincent:staff * 3 | -------------------------------------------------------------------------------- /0x01-shell_permissions/101-symbolic_link_permissions: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | chown -h vincent:staff _hello 3 | -------------------------------------------------------------------------------- /0x01-shell_permissions/102-if_only: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | chown --from=guillaume betty hello 3 | -------------------------------------------------------------------------------- /0x01-shell_permissions/103-Star_Wars: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | telnet towel.blinkenlights.nl 3 | -------------------------------------------------------------------------------- /0x01-shell_permissions/11-directories_permissions: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | chmod a+X * 3 | -------------------------------------------------------------------------------- /0x01-shell_permissions/12-directory_permissions: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | mkdir -m 751 my_dir 3 | -------------------------------------------------------------------------------- /0x01-shell_permissions/13-change_group: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | chgrp school hello 3 | -------------------------------------------------------------------------------- /0x01-shell_permissions/2-groups: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | groups 3 | -------------------------------------------------------------------------------- /0x01-shell_permissions/3-new_owner: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | chown betty hello 3 | -------------------------------------------------------------------------------- /0x01-shell_permissions/4-empty: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | touch hello 3 | -------------------------------------------------------------------------------- /0x01-shell_permissions/5-execute: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | chmod u+x hello 3 | -------------------------------------------------------------------------------- /0x01-shell_permissions/6-multiple_permissions: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | chmod ug+x,o+r hello 3 | -------------------------------------------------------------------------------- /0x01-shell_permissions/7-everybody: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | chmod a+x hello 3 | -------------------------------------------------------------------------------- /0x01-shell_permissions/8-James_Bond: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | chmod 007 hello 3 | -------------------------------------------------------------------------------- /0x01-shell_permissions/9-John_Doe: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | chmod 753 hello 3 | -------------------------------------------------------------------------------- /0x01-shell_permissions/README.md: -------------------------------------------------------------------------------- 1 | alx-system_engineering-devops0x01-shell_permissions0-iam_betty 2 | -------------------------------------------------------------------------------- /0x02-shell_redirections/.15-countthatword.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tecnophille/alx-system_engineering-devops/374596ec9f74abbb1ee4dd338977228131f153e1/0x02-shell_redirections/.15-countthatword.swp -------------------------------------------------------------------------------- /0x02-shell_redirections/.7-file.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tecnophille/alx-system_engineering-devops/374596ec9f74abbb1ee4dd338977228131f153e1/0x02-shell_redirections/.7-file.swp -------------------------------------------------------------------------------- /0x02-shell_redirections/0-hello_world: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Hello, World" 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/1-confused_smiley: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "\"(Ôo)'" 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/10-no_more_js: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | find . -type f -name "*.js" -delete 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/100-empty_casks: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | find . -empty | rev | cut -d '/' -f 1 | rev 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/101-gifs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | find -type f -name "*.gif" | rev | cut -d "/" -f 1 | cut -d '.' -f 2- | rev | LC_ALL=C sort -f 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/102-acrostic: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cut -c 1 | paste -s -d '' 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/103-the_biggest_fan: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | tail -n +2 | cut -f -1 | sort -k 1 | uniq -c | sort -rnk 1 | head -n 11 | rev | cut -d ' ' -f -1 | rev 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/11-directories: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | find . -type d -not -name '.' | wc -l 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/12-newest_files: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ls -t1 | head -n 10 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/13-unique: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sort | uniq -u 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/14-findthatword: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | grep -i "root" /etc/passwd 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/15-countthatword: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | grep -c -i "bin" /etc/passwd 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/16-whatsnext: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | grep -i "root" -A 3 /etc/passwd 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/17-hidethisword: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | grep -i -v "bin" /etc/passwd 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/18-letteronly: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | grep -i "^[a-z]" /etc/ssh/sshd_config 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/19-AZ: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | tr "A" "Z" | tr "c" "e" 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/2-hellofile: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cat /etc/passwd 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/20-hiago: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | tr -d "cC" 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/21-reverse: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rev 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/22-users_and_homes: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cut -d ':' -f 1,6 /etc/passwd | sort 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/3-twofiles: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cat /etc/passwd /etc/hosts 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/4-lastlines: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | tail -n 10 /etc/passwd 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/5-firstlines: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | head -n 10 /etc/passwd 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/6-third_line: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | head -n 3 iacta | tail -n 1 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/7-file: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Best School" > \\\*\\\\"'\"Best School\"\\'"\\\\\*\$\\\?\\\*\\\*\\\*\\\*\\\*\:\) 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/8-cwd_state: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ls -la > ls_cwd_content 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/9-duplicate_last_line: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | tail -n 1 iacta >> iacta 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/README.md: -------------------------------------------------------------------------------- 1 | Readme 2 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/.102-odd.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tecnophille/alx-system_engineering-devops/374596ec9f74abbb1ee4dd338977228131f153e1/0x03-shell_variables_expansions/.102-odd.swp -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/0-alias: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | alias ls="rm *" 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/1-hello_you: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "hello $USER" 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/10-love_exponent_breath: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo $(($BREATH**$LOVE)) 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/100-decimal_to_hexadecimal: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | printf '%x\n' $DECIMAL 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/101-rot13: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | tr `echo {a..z} | tr -d ' '` `echo {n..z} $(echo {a..m}) | tr -d ' '` | tr `echo {A..Z} | tr -d ' '` `echo {N..Z} $(echo {A..M}) | tr -d ' '` 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/102-odd: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | perl -lne 'print if $. % 2 == 1' 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/103-water_and_stir: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo $(printf %o $(($((5#$(echo $WATER | tr 'water' '01234'))) + $((5#$(echo $STIR | tr 'stir.' '01234'))))) | tr '01234567' 'bestchol') 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/11-binary_to_decimal: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo $((2#$BINARY)) 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/12-combinations: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo {a..z}{a..z} | tr " " "\n" | grep -v "oo" 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/13-print_float: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | printf "%.2f" $NUM | sort 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/2-path: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export PATH=$PATH:/action 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/3-paths: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo $((`echo $PATH | grep -o ":/" | wc -l`+ 1)) 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/4-global_variables: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | printenv 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/5-local_variables: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/6-create_local_variable: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | BEST="School" 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/7-create_global_variable: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export BEST="School" 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/8-true_knowledge: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo $(($TRUEKNOWLEDGE + 128)) 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/9-divide_and_rule: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo $(($POWER / $DIVIDE)) 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/README.md: -------------------------------------------------------------------------------- 1 | alx-system_engineering-devops0x03-shell_variables_expansions 2 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/0-RSA_public_key.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCx+rE3JsDymo8ZB2WeADsw+OJgPHVsKfpir6y7GMbVkTb5pdXxfQiAMucvZkjP3e2lqRqX2IPufhtSZDnZdOmozRiFqZe0FBMbV+QeNRFnPhb/BH/KY8MJIvq50UJZpi8KUWsYC5fHw2R4N83YgsiK5zhsVy/tbfj6oINV44KO6VGQNBAlc3986OGwtuUfBPxkoV6+oP06Dp6fhVTMowy1c290rsO1xHDp2EY0k8JoMSQFDw2bmAleuxqJlJFP5bWO90ZcJCYo9DlWYYbyskNVdpL/A5GCkuGX7f5GIYfnz46PQ65y+on7chQDwe93DVeGmsoPkF+ps003ThuWXW0EhJcFDY+LaFy1onaJyZfjQuoP1dPrxOH0UJU9i3UcsoFUvJxFaxr5DPo5LutPwR1O9oNNNRSFSKDyv8BO59TxDIhd/PgkG33fJRV2uaBhM35YbGUPflQNg+o3Svzm6f891JkdHOfxQFRqMQNEC8Oob0Py141/0EGiHVWGxcZ6xes= root@7d98c0ea030a 2 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/0-RSA_public_keyy.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCJg3pWLaa66J/BQ8rUR8x9/Do5BJlM/wpHvzFK96vI9vWtYrxY0EfzGmzmYhkZteHHfdXJTJK+YiJAk352z5Z0GtLaPrndL2Y/JoBSHiAEQ4r/v9n1+KvMmNwDPMoyfMUTjVkXfn1R23jsbwBmv3OqRM5wWwJh87geOLW9a958lUEYnltjT04AMPvWHVMqMPd4zj8RSkM2aryaSWYR6MK3JgX/Uf23dyoH8dAeIhJKfyE5ZoKFQ 2 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/1-for_best_school: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # This script is displaying "Best School" 10 times 3 | 4 | for (( i=0; i<10; i++ )) 5 | do 6 | echo "Best School" 7 | done 8 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/10-fizzbuzz: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Displays numbers from 1 to 100 in list format. 3 | # Displays "FizzBuzz" when the number is a multiple of 3 and 5. 4 | # Displays "Fizz" when the number is a multiple of 3. 5 | # Displays "Buzz" when the number is a multiple of 5. 6 | # Otherwise, displays the number. 7 | 8 | for num in {1..100} 9 | do 10 | if (( num % 3 == 0 && num % 5 == 0 )) 11 | then 12 | echo "FizzBuzz" 13 | elif (( num % 3 == 0 )) 14 | then 15 | echo "Fizz" 16 | elif (( num % 5 == 0 )) 17 | then 18 | echo "Buzz" 19 | else 20 | echo "$num" 21 | fi 22 | done 23 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/100-read_and_cut: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Displays the contents of the file `/etc/passwd`. 3 | # Only displays the username, user id, and user home directory path. 4 | 5 | while IFS= read -r passwd; 6 | do 7 | echo "$passwd" | cut -d ':' -f1,3,6 8 | done < "/etc/passwd" 9 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/101-tell_the_story_of_passwd: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Tells a story based on the contents of the `/etc/passwd` file. 3 | 4 | while IFS=':' read -r username password uid gid info home shell; do 5 | echo "The user $username is part of the $gid gang,"\ 6 | "lives in $home and rides $shell."\ 7 | "$uid's place is protected by the passcode $password,"\ 8 | "more info about the user here: $info" 9 | done < "/etc/passwd" 10 | Footer 11 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/102-lets_parse_apache_logs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Parses Apache log files in list format. 3 | # Displays the IP and HTTP status code. 4 | 5 | awk '{print $1 " " $9}' apache-access.log 6 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/103-dig_the-data: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Parses Apache log files in list format. 3 | # Groups visitors by IP and HTTP status code. 4 | # Displays the number of occurrences, IP, and HTTP status 5 | #+ code of each log, in sorted order. 6 | 7 | awk '{ print $1 " " $9}' apache-access.log | sort | uniq -c | sort -rn 8 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/2-while_best_school: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Displays "Best School" 10 times using a while loop. 3 | 4 | count=0 5 | 6 | while [ $count -lt 10 ] 7 | do 8 | echo "Best School" 9 | (( count++ )) 10 | done 11 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/3-until_best_school: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Displays "Best School" 10 times using an until loop. 3 | 4 | count=0 5 | 6 | until [ $count -eq 10 ] 7 | do 8 | echo "Best School" 9 | (( count++ )) 10 | done 11 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/4-if_9_say_hi: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Displays "Best School" 10 times using a while loop. 3 | # On the 9th iteration, displays "Hi" before "Best School". 4 | 5 | count=0 6 | 7 | while [ $count -lt 10 ] 8 | do 9 | if [ $count -eq 9 ] 10 | then 11 | echo "Hi" 12 | fi 13 | echo "Best School" 14 | (( count++ )) 15 | done 16 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/5-4_bad_luck_8_is_your_chance: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Loops from 1 to 10 and displays: 3 | # "bad luck" for the 4th iteration 4 | # "good luck" for the 8th iteration 5 | # "Best School" for all other iterations 6 | 7 | count=0 8 | 9 | while [ $count -lt 10 ] 10 | do 11 | if [ $count -eq 3 ] 12 | then 13 | echo "bad luck" 14 | elif [ $count -eq 7 ] 15 | then 16 | echo "good luck" 17 | else 18 | echo "Best School" 19 | fi 20 | (( count++ )) 21 | done 22 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/6-superstitious_numbers: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Displays numbers from 1 to 20 in addition to: 3 | # "bad luck from China" for the 4th iteration 4 | # "bad luck from Japan" for the 9th iteration 5 | # "bad luck from Italy" for the 17th loop iteration 6 | 7 | count=1 8 | 9 | while [ $count -le 20 ] 10 | do 11 | echo "$count" 12 | case $count in 13 | "4") echo "bad luck from China";; 14 | "9") echo "bad luck from Japan";; 15 | "17") echo "bad luck from Italy";; 16 | esac 17 | (( count++ )) 18 | done 19 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/7-clock: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Displays the time for 12 horus and 59 minutes. 3 | # Displays hours from 0 to 12 4 | # Displays minutes from 1 to 59 5 | 6 | hour=0 7 | 8 | while [ $hour -le 12 ] 9 | do 10 | echo "Hour: $hour" 11 | minute=1 12 | while [ $minute -le 59 ] 13 | do 14 | echo "$minute" 15 | (( minute++ )) 16 | done 17 | (( hour++ )) 18 | done 19 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/8-for_ls: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Displays the contents of the current directory in list format. 3 | # Only displays the part of the name after the first dash. 4 | 5 | list=$(ls) 6 | for i in $list; do 7 | echo "$i" | cut -d '-' -f2 8 | done 9 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/9-to_file_or_not_to_file: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Displays information about the file `school`. 3 | 4 | if [ -e "school" ] 5 | then 6 | echo "school file exists" 7 | if [ -s "school" ] 8 | then 9 | echo "school file is not empty" 10 | else 11 | echo "school file is empty" 12 | fi 13 | 14 | if [ -f "school" ] 15 | then 16 | echo "school is a regular file" 17 | fi 18 | else 19 | echo "school file does not exist" 20 | fi 21 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/README.md: -------------------------------------------------------------------------------- 1 | # Loops, conditions and parsing 2 | 3 | Project done during **Full Stack Software Engineering** at **ALX**. It aims to learn about loops (`while`, `until` and `for`), condition statements (`if`, `else`, `elif` and `case`), shebangs and how to create SSH keys with **Bash**. 4 | 5 | ## Technologies 6 | * Scripts written in Bash 4 7 | * Tested on Ubuntu 20.04 LTS 8 | 9 | ## Files 10 | 11 | | Filename | Description | 12 | | -------- | ----------- | 13 | | `0-RSA_public_key.pub` | File that stores a RSA public key to access servers via SSH | 14 | | `1-for_best_school` | Displays `Best School` 10 times with a `for` loop | 15 | | `2-while_best_school` | Displays `Best School` 10 times with a `while` loop | 16 | | `3-until_best_school` | Displays `Best School` 10 times with an `until` loop | 17 | | `4-if_9_say_hi` | Displays `Best School` 10 times and displays `Hi` for the 9th iteration | 18 | | `5-4_bad_luck_8_is_your_chance` | Loops from 1 to 10 and displays `Best School`, except for 4th and 8th iteration which displays `bad luck` and `good luck`, respectively | 19 | | `6-superstitious_numbers` | Displays numbers from 1 to 20 and displays `bad luck from China`, `bad luck from Japan` and `bad luck from Italy` for the 4th, 9th and 17th iteration, respectively | 20 | | `7-clock` | Displays the time for 12 hours and 59 minutes | 21 | | `8-for_ls` | Displays the content of the current directory in a list format | 22 | | `9-to_file_or_not_to_file` | Gives information about the `Bestschool` file | 23 | | `10-fizzbuzz` | Displays the `fizzbuzz` sequence | 24 | | `100-read_and_cut` | Displays the content of the file `/etc/passwd` | 25 | | `101-tell_the_story_of_passwd` | Displays the content of the file `/etc/passwd` with an specific message | 26 | | `102-lets_parse_apache_logs` | Displays the visitor IP along with the HTTP status code from an Apache log file | 27 | | `103-dig_the-data` | Groups visitors by IP and HTTP status code and displays the occurrences, from the greatest to the lowest number | 28 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/joy.c: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /0x05-processes_and_signals/0-what-is-my-pid: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #Bash script that prints the PID 3 | echo $$ -------------------------------------------------------------------------------- /0x05-processes_and_signals/1-list_your_processes: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #Bash script that displays a list of current processes. 3 | ps auxf 4 | -------------------------------------------------------------------------------- /0x05-processes_and_signals/100-process_and_pid_file: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Create a .pid file on /var/run and this process can be killed (Have special interactions) 3 | trap "echo \"Y U no love me?!\"; exit" SIGINT 4 | trap "sudo rm /var/run/myscript.pid; exit" SIGQUIT 5 | trap "echo \"I hate the kill command\"; sudo rm /var/run/myscript.pid; exit" SIGTERM 6 | 7 | echo "$$" > /var/run/myscript.pid 8 | 9 | while true 10 | do 11 | echo "To infinity and beyond" 12 | sleep 2 13 | done 14 | -------------------------------------------------------------------------------- /0x05-processes_and_signals/101-manage_my_process: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #Bash script that creates a subprocess 3 | . /lib/lsb/init-functions 4 | 5 | PIDFILE=/var/run/my_process.pid 6 | 7 | start() { 8 | ./manage_my_process & 9 | echo "$!" > "$PIDFILE" 10 | } 11 | 12 | stop() { 13 | sudo kill -15 "$(cat "$PIDFILE")" && rm -f "$PIDFILE" 14 | } 15 | 16 | case "$1" in 17 | start) 18 | start 19 | echo "manage_my_process started" 20 | ;; 21 | stop) 22 | stop 23 | echo "manage_my_process stopped" 24 | ;; 25 | restart) 26 | stop 27 | start 28 | echo "manage_my_process restarted" 29 | ;; 30 | *) 31 | echo "Usage: manage_my_process {start|stop|restart}" 32 | esac 33 | 34 | exit 0 35 | -------------------------------------------------------------------------------- /0x05-processes_and_signals/102-zombie.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | /** 7 | * infinite_while - function that containts an infinite loop 8 | * 9 | * Return: 0 10 | */ 11 | int infinite_while(void) 12 | { 13 | while (1) 14 | { 15 | sleep(1); 16 | } 17 | return (0); 18 | } 19 | 20 | /** 21 | * main - Entry point 22 | * 23 | * Return: Always 0 24 | */ 25 | int main(void) 26 | { 27 | int i; 28 | 29 | for (i = 0; i < 5; i++) 30 | { 31 | if (fork() == 0) 32 | { 33 | dprintf(1, "Zombie process created, PID: %d\n", getpid()); 34 | return (0); 35 | } 36 | } 37 | infinite_while(); 38 | return (0); 39 | } 40 | -------------------------------------------------------------------------------- /0x05-processes_and_signals/2-show_your_bash_pid: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #Bash script that displays a list of current processes 3 | # shellcheck disable=SC2009 4 | ps aux --forest | grep bash 5 | -------------------------------------------------------------------------------- /0x05-processes_and_signals/3-show_your_bash_pid_made_easy: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #Bash script that displays the PID of processes whose name contain the word bash. 3 | pgrep -l bash 4 | -------------------------------------------------------------------------------- /0x05-processes_and_signals/4-to_infinity_and_beyond: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #Bash script that displays To infinity and beyond indefinitely 3 | while : 4 | do 5 | echo "To infinity and beyond" 6 | sleep 2 7 | done 8 | -------------------------------------------------------------------------------- /0x05-processes_and_signals/5-dont_stop_me_now: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #Bash script that kills a process 3 | pgrep -f 4-to_infinity_and_beyond | xargs kill -15 4 | -------------------------------------------------------------------------------- /0x05-processes_and_signals/6-stop_me_if_you_can: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #Bash script that kills a process 3 | pkill -f 4-to_infinity_and_beyond 4 | -------------------------------------------------------------------------------- /0x05-processes_and_signals/7-highlander: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #Bash script that displays a message when it is terminated 3 | trap 'echo "I am invincible!!!"' SIGTERM 4 | while : 5 | do 6 | echo "To infinity and beyond" 7 | sleep 2 8 | done 9 | -------------------------------------------------------------------------------- /0x05-processes_and_signals/8-beheaded_process: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #Bash script that kills a process 3 | pgrep -f 7-highlander | xargs kill -9 4 | -------------------------------------------------------------------------------- /0x05-processes_and_signals/README.md: -------------------------------------------------------------------------------- 1 | # Processes and signals 2 | 3 | Project done during **Full Stack Software Engineering** at **ALX**. It aims to learn about PID, processes and commands that handles them (`ps`, `pgrep`, `pkill`, `kill`, etc) in **Bash**. 4 | 5 | ## Technologies 6 | * Scripts written in Bash 4 7 | * Tested on Ubuntu 20.04 LTS 8 | 9 | ## Files 10 | 11 | | Filename | Description | 12 | | -------- | ----------- | 13 | | `0-what-is-my-pid` | Displays its own PID | 14 | | `1-list_your_processes` | Displays a list of currently running processes | 15 | | `2-show_your_bash_pid` | Displays lines contaning the `bash` word in a list of currently running processes | 16 | | `3-show_your_bash_pid_made_easy` | Displays the PID, along with the process name, of processes whose name contain the word `Bash` | 17 | | `4-to_infinity_and_beyond` | Displays `To infinity and beyond` indefinitely | 18 | | `5-kill_me_now` | Kills `4-to_infinity_and_beyond` process | 19 | | `6-kill_me_now_made_easy` | Kills `4-to_infinity_and_beyond` process | 20 | | `7-highlander` | Displays `To infinity and beyond` indefinitely and displays `I am invincible!!!` when receiving a `SIGTERM` signal | 21 | | `8-beheaded_process` | Kills the process `7-highlander` | 22 | | `100-process_and_pid_file` | Prints some messages according to sended signals | 23 | | `101-manage_my_process` | Init script that manages `manage_my_process` with `start`, `stop` and `restart` instructions | 24 | | `102-zombie.c` | C program that creates 5 zombie processes | 25 | -------------------------------------------------------------------------------- /0x05-processes_and_signals/manage_my_process: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Process that writes a message in a file 3 | 4 | while true 5 | do 6 | echo "I am alive!" > /tmp/my_process 7 | sleep 2 8 | done 9 | -------------------------------------------------------------------------------- /0x06-regular_expressions/0-simply_match_school.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | puts ARGV[0].scan(/School/).join 3 | -------------------------------------------------------------------------------- /0x06-regular_expressions/1-repetition_token_0.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | puts ARGV[0].scan(/hbt{2,5}n/).join 3 | -------------------------------------------------------------------------------- /0x06-regular_expressions/100-textme.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | puts ARGV[0].scan(/(?<=from:|to:|flags:).+?(?=\])/).join(',') 3 | -------------------------------------------------------------------------------- /0x06-regular_expressions/2-repetition_token_1.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | puts ARGV[0].scan(/hb?tn/).join 3 | -------------------------------------------------------------------------------- /0x06-regular_expressions/3-repetition_token_2.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | puts ARGV[0].scan(/hbt+n/).join 3 | -------------------------------------------------------------------------------- /0x06-regular_expressions/4-repetition_token_3.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | puts ARGV[0].scan(/hbt*n/).join 3 | -------------------------------------------------------------------------------- /0x06-regular_expressions/5-beginning_and_end.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | puts ARGV[0].scan(/^h.n$/).join 3 | -------------------------------------------------------------------------------- /0x06-regular_expressions/6-phone_number.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | puts ARGV[0].scan(/^\d{10}$/).join 3 | -------------------------------------------------------------------------------- /0x06-regular_expressions/7-OMG_WHY_ARE_YOU_SHOUTING.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | puts ARGV[0].scan(/[[:upper:]]/).join 3 | -------------------------------------------------------------------------------- /0x06-regular_expressions/README.md: -------------------------------------------------------------------------------- 1 | # 0x06 Regular expression 2 | Project done during **Full Stack Software Engineering** at **ALX**. It aims to learn about how to build a regular expression. 3 | 4 | ## Technologies 5 | * Scripts written in Bash 6 | * Tested on Ubuntu 20.04 LTS 7 | 8 | ## Files 9 | 10 | | Filename | Description | 11 | | -------- | ----------- | 12 | | `0-simply_match_school.rb` | A regular expression that matches `School` | 13 | | `1-repetition_token_0.rb` | A regular expression that matches `hbttn` | 14 | | `2-repetition_token_1.rb` | A regular expression that matches `htn` and `hbtn` | 15 | | `3-repetition_token_2.rb` | A regular expression that matches `hbtn`, where the letter `t` can be replied | 16 | | `4-repetition_token_3.rb` | A regular expression that matches `hbtn` with or without `t` | 17 | | `5-beginning_and_end.rb` | A regular expression that matches with a word that starts with `h` and ends with `n` | 18 | | `6-phone_number.rb` | A regular expression that match with 10 digit phone number| 19 | | `7-OMG_WHY_ARE_YOU_SHOUTING.rb` | A regular expression that only matches capital letters | 20 | | `100-textme.rb` | Filters information of a log file | 21 | -------------------------------------------------------------------------------- /0x07-networking_basics/0-OSI_model: -------------------------------------------------------------------------------- 1 | 2 2 | 2 3 | -------------------------------------------------------------------------------- /0x07-networking_basics/1-types_of_network: -------------------------------------------------------------------------------- 1 | 3 2 | 2 3 | 1 4 | -------------------------------------------------------------------------------- /0x07-networking_basics/2-MAC_and_IP_address: -------------------------------------------------------------------------------- 1 | 2 2 | 1 3 | -------------------------------------------------------------------------------- /0x07-networking_basics/3-UDP_and_TCP: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 1 4 | -------------------------------------------------------------------------------- /0x07-networking_basics/4-TCP_and_UDP_ports: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Script that displays listening ports 3 | netstat -lp 4 | -------------------------------------------------------------------------------- /0x07-networking_basics/5-is_the_host_on_the_network: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Script 3 | if [ "$#" -lt "1" ] 4 | then 5 | echo "Usage: 5-is_the_host_on_the_network {IP_ADDRESS}" 6 | else 7 | ping "$1" -c 5 8 | fi 9 | -------------------------------------------------------------------------------- /0x07-networking_basics/README.md: -------------------------------------------------------------------------------- 1 | # Networking basics 2 | Project done during **Full Stack Software Engineering** at **ALX**. It aims to learn about what is an OSI model, LAN, WAN, IP address, localhost, subnet and TCP/UDP. 3 | 4 | ## Technologies 5 | * Scripts written in Bash 6 | * Tested on Ubuntu 20.04 LTS 7 | 8 | ## Files 9 | 10 | | Filename | Description | 11 | | -------- | ----------- | 12 | | `0-OSI_model` | Answers of two questions related with OSI model | 13 | | `1-types_of_network` | Answers of three questions related with WAN and LAN | 14 | | `2-MAC_and_IP_address` | Answers of two questions related with MAC and IP address | 15 | | `3-UDP_and_TCP` | Answers of three questions related with TCP and UDP | 16 | | `4-TCP_and_UDP_ports` | Bash script that displays listening ports that only shows listening sockets | 17 | | `5-is_the_host_on_the_network` | Bash script that pings an IP address passed as an argument | 18 | -------------------------------------------------------------------------------- /0x08-networking_basics_2/0-change_your_home_IP: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Change localhost to 127.0.0.2 3 | # Change facebook.com to 8.8.8.8 4 | 5 | cp /etc/hosts ~/hosts.new 6 | sed -i 's/127.0.0.1\tlocalhost/127.0.0.2 localhost\n8.8.8.8 facebook.com/' ~/hosts.new 7 | cp -f ~/hosts.new /etc/hosts 8 | -------------------------------------------------------------------------------- /0x08-networking_basics_2/1-show_attached_IPs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # displays all active IPv4 IPs on the machine it is executed on 3 | 4 | ifconfig | grep -Eo 'inet ([0-9]{1,3}\.?){4}' | cut -d ' ' -f 2 5 | -------------------------------------------------------------------------------- /0x08-networking_basics_2/100-port_listening_on_localhost: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Listens on port 98 on localhost 3 | 4 | nc -l 98 5 | -------------------------------------------------------------------------------- /0x08-networking_basics_2/README.md: -------------------------------------------------------------------------------- 1 | # Networking basics 1 2 | Project done during **Software Engineering** at **ALX**. It aims to learn about what is localhost/127.0.0.1, what is 0.0.0.0, what is `/etc/hosts` and how to display the machine's active network interfaces. 3 | 4 | ## Technologies 5 | * Scripts written in Bash 6 | * Tested on Ubuntu 20.04 LTS 7 | 8 | ## Files 9 | 10 | | Filename | Description | 11 | | -------- | ----------- | 12 | | `0-change_your_home_IP` | Answer of a question related with `127.0.0.2` | 13 | | `1-show_attached_IPs` | Answer of a question related with ` active IPv4` | 14 | | `100-port_listening_on_localhost` | Bash script that configures an Ubuntu server | 15 | 16 | -------------------------------------------------------------------------------- /0x09-web_infrastructure_design/0-simple_web_stack: -------------------------------------------------------------------------------- 1 | https://imgur.com/a/JnoU2Pa -------------------------------------------------------------------------------- /0x09-web_infrastructure_design/1-distributed_web_infrastructure: -------------------------------------------------------------------------------- 1 | https://imgur.com/a/weoVU8j -------------------------------------------------------------------------------- /0x09-web_infrastructure_design/2-secured_and_monitored_web_infrastructure: -------------------------------------------------------------------------------- 1 | https://imgur.com/a/iYaSz5J -------------------------------------------------------------------------------- /0x09-web_infrastructure_design/3-scale_up: -------------------------------------------------------------------------------- 1 | https://imgur.com/a/Jk4lHdn -------------------------------------------------------------------------------- /0x09-web_infrastructure_design/README.md: -------------------------------------------------------------------------------- 1 | # 0x09-web_infrastructure_design 2 | 3 | Project done during **Full Stack Software Engineering** at **ALX**. It aims to learn about how to design a Web Infrastructure. 4 | 5 | ## Key concepts 6 | * Network basics 7 | * Server 8 | * Web server 9 | * Application server 10 | * DNS & DNS record types 11 | * Load Balancer 12 | * Monitoring 13 | * Database 14 | * Single point of failure 15 | * HTTP & HTTPS 16 | * Firewall 17 | 18 | ## Files 19 | 20 | | Filename | Description | 21 | | -------- | ----------- | 22 | | `0-simple_web_stack` | Web Infrastructure Design with a LAMP stack. This contains: 1 server, 1 web server, 1 application server, 1 database and 1 domain name | 23 | | `1-distributed_web_infrastructure` | Web Infrastructure Design, based on `0-simple_web_stack` that contains some additional components: 1 server, 1 web server, 1 application server, 1 load-balancer, 1 set of application files, 1 database | 24 | | `2-secured_and_monitored_web_infrastructure` | Web Infrastructure Design, based on `1-distributed_web_infrastructure` that contains some additional components: 3 firewalls, 1 SSL certificate, 3 monitoring clients | 25 | | `3-scale_up` | Web Infrastructure Design, based on `2-secured_and_monitored_web_infrastructure` that contains some additional components: 1 server, 1 load-balancer | 26 | -------------------------------------------------------------------------------- /0x0A-configuration_management/0-create_a_file.pp: -------------------------------------------------------------------------------- 1 | # Creates a file in /tmp 2 | 3 | file { '/tmp/school': 4 | ensure => file, 5 | path => '/tmp/school', 6 | mode => '0744', 7 | owner => 'www-data', 8 | group => 'www-data', 9 | content => 'I love Puppet' 10 | } 11 | -------------------------------------------------------------------------------- /0x0A-configuration_management/1-install_a_package.pp: -------------------------------------------------------------------------------- 1 | # Using Puppet, install flask from pip3 2 | 3 | package { 'flask': 4 | ensure => '2.1.0', 5 | provider => 'pip3' 6 | } 7 | -------------------------------------------------------------------------------- /0x0A-configuration_management/2-execute_a_command.pp: -------------------------------------------------------------------------------- 1 | # Kills a process name killmenow 2 | 3 | exec { 'pkill killmenow': 4 | path => '/usr/bin', 5 | command => 'pkill killmenow', 6 | provider => shell, 7 | returns => [0, 1] 8 | } -------------------------------------------------------------------------------- /0x0A-configuration_management/README.md: -------------------------------------------------------------------------------- 1 | # Configuration management 2 | Project done during **Full Stack Software Engineering** at **ALX**. It aims to learn about server configuration management using **Puppet**. 3 | 4 | ## Technologies 5 | * Scripts written in Bash 4 6 | * Tested on Ubuntu 20.04 LTS 7 | * Puppet 8 | 9 | ## Files 10 | 11 | | Filename | Description | 12 | | -------- | ----------- | 13 | | `0-create_a_file.pp` | Create a file in `/tmp` | 14 | | `1-install_a_package.pp` | Install `puppet-lint` | 15 | | `2-execute_a_command.pp` | Create a manifest that kills a process named `killmenow` | 16 | -------------------------------------------------------------------------------- /0x0B-ssh/0-use_a_private_key: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Connecting to a server through a private key 3 | ssh -i ~/.ssh/school ubuntu@18.210.33.134 4 | -------------------------------------------------------------------------------- /0x0B-ssh/1-create_ssh_key_pair: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Creates an RSA key pair 3 | ssh-keygen -t rsa -N betty -f school -b 4096 4 | -------------------------------------------------------------------------------- /0x0B-ssh/100-puppet_ssh_config.pp: -------------------------------------------------------------------------------- 1 | # Client configuration file (w/ Puppet) 2 | # Your SSH client configuration must be configured to use 3 | # the private key ~/.ssh/school 4 | # Your SSH client configuration must be configured to refuse 5 | # to authenticate using a password 6 | include stdlib 7 | file_line { 'NO password': 8 | ensure => present, 9 | path => '/etc/ssh/ssh_config', 10 | line => ' PasswordAuthentication no', 11 | match => '^PasswordAuthentication', 12 | append_on_no_match => true, 13 | } 14 | 15 | file_line { 'New private key holder': 16 | ensure => present, 17 | path => '/etc/ssh/ssh_config', 18 | line => ' IdentityFile ~/.ssh/school', 19 | match => '^IdentityFile', 20 | append_on_no_match => true, 21 | } 22 | -------------------------------------------------------------------------------- /0x0B-ssh/2-ssh_config: -------------------------------------------------------------------------------- 1 | 2 | # This is the ssh client system-wide configuration file. See 3 | # ssh_config(5) for more information. This file provides defaults for 4 | # users, and the values can be changed in per-user configuration files 5 | # or on the command line. 6 | 7 | # Configuration data is parsed as follows: 8 | # 1. command line options 9 | # 2. user-specific file 10 | # 3. system-wide file 11 | # Any configuration value is only changed the first time it is set. 12 | # Thus, host-specific definitions should be at the beginning of the 13 | # configuration file, and defaults at the end. 14 | 15 | # Site-wide defaults for some commonly used options. For a comprehensive 16 | # list of available options, their meanings and defaults, please see the 17 | # ssh_config(5) man page. 18 | 19 | Host * 20 | # ForwardAgent no 21 | # ForwardX11 no 22 | # ForwardX11Trusted yes 23 | PasswordAuthentication no 24 | # HostbasedAuthentication no 25 | # GSSAPIAuthentication no 26 | # GSSAPIDelegateCredentials no 27 | # GSSAPIKeyExchange no 28 | # GSSAPITrustDNS no 29 | # BatchMode no 30 | # CheckHostIP yes 31 | # AddressFamily any 32 | # ConnectTimeout 0 33 | # StrictHostKeyChecking ask 34 | IdentityFile ~/.ssh/school 35 | # IdentityFile ~/.ssh/id_rsa 36 | # IdentityFile ~/.ssh/id_dsa 37 | # IdentityFile ~/.ssh/id_ecdsa 38 | # IdentityFile ~/.ssh/id_ed25519 39 | # Port 22 40 | # Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc 41 | # MACs hmac-md5,hmac-sha1,umac-64@openssh.com 42 | # EscapeChar ~ 43 | # Tunnel no 44 | # TunnelDevice any:any 45 | # PermitLocalCommand no 46 | # VisualHostKey no 47 | # ProxyCommand ssh -q -W %h:%p gateway.example.com 48 | # RekeyLimit 1G 1h 49 | SendEnv LANG LC_* 50 | HashKnownHosts yes 51 | GSSAPIAuthentication yes 52 | -------------------------------------------------------------------------------- /0x0B-ssh/README.md: -------------------------------------------------------------------------------- 1 | # SSH 2 | Project done during **Full Stack Software Engineering** at **ALX**. It aims to learn about what is a SSH, how to create an SSH RSA key pair and how to connect to a remote host using SSH. 3 | 4 | ## Technologies 5 | * Scripts written in Bash 4 6 | * Tested on Ubuntu 20.04 LTS 7 | * Puppet 8 | 9 | ## Files 10 | 11 | | Filename | Description | 12 | | -------- | ----------- | 13 | | `0-use_a_private_key` | Uses `ssh` to connect to a server using a private key previously generated | 14 | | `1-create_ssh_key_pair` | Creates an RSA key pair | 15 | | `2-ssh_config` | SSH client configuration using a private key and refusing to authenticate using a password | 16 | | `4-puppet_ssh_config.pp` | Sets up the client SSH configuration file to connect to a server without typing a password | 17 | -------------------------------------------------------------------------------- /0x0C-web_server/0-transfer_file: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # transfer a file from our client to a server 3 | if [ $# -lt 3 ]; 4 | then 5 | echo "Usage: 0-transfer_file PATH_TO_FILE IP USERNAME PATH_TO_SSH_KEY"; 6 | exit; 7 | fi; 8 | 9 | if [ $# -ge 4 ]; 10 | then 11 | scp -o StrictHostKeyChecking=no -i "$4" "$1" "$3"@"$2":~/ 12 | else 13 | scp -o StrictHostKeyChecking=no "$1" "$3"@"$2":~/ 14 | fi; 15 | -------------------------------------------------------------------------------- /0x0C-web_server/1-install_nginx_web_server: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Installs Nginx with the following configurations: 3 | #+ Listens on port 80. 4 | #+ Returns a page containing "Hello World!" when queried 5 | #++ at the root with a curl GET request. 6 | 7 | sudo apt-get -y update 8 | sudo apt-get -y install nginx 9 | echo 'Hello World!' | sudo tee /var/www/html/index.html 10 | sudo service nginx start 11 | -------------------------------------------------------------------------------- /0x0C-web_server/2-setup_a_domain_name: -------------------------------------------------------------------------------- 1 | gobrand.tech 2 | -------------------------------------------------------------------------------- /0x0C-web_server/3-redirection: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # This script configures the Nginx server so that 3 | # /redirect_me is redirecting to another page 4 | 5 | sudo apt-get -y update 6 | sudo apt-get -y install nginx 7 | sudo chown -R "$USER":"$USER" /var/www 8 | echo "Hello World!" > /var/www/html/index.nginx-debian.html 9 | sed -i "48i\\\tif (\$request_filename ~ redirect_me){\n\t\t\ 10 | rewrite ^ https://www.youtube.com/watch?v=QH2-TGUlwu4 permanent;\n\t}" /etc/nginx/sites-available/default 11 | 12 | service nginx restart 13 | -------------------------------------------------------------------------------- /0x0C-web_server/4-not_found_page_404: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # This script configures the Nginx server so that 3 | # /redirect_me is redirecting to another page 4 | 5 | sudo apt-get -y update 6 | sudo apt-get -y install nginx 7 | sudo chown -R "$USER":"$USER" /var/www 8 | echo "Hello World!" > /var/www/html/index.nginx-debian.html 9 | sudo sed -i '/listen 80 default_server;/a rewrite ^/redirect_me https://www.youtube.com/watch?v=QH2-TGUlwu4 permanent;' /etc/nginx/sites-available/default 10 | sudo mkdir -p /var/www/error 11 | echo "Ceci n'est pas une page" | sudo tee /var/www/error/404.html 12 | sudo sed -i '/server_name _/a error_page 404 /404.html; location = /404.html {root /var/www/error/;internal; }' /etc/nginx/sites-available/default 13 | sudo service nginx start 14 | -------------------------------------------------------------------------------- /0x0C-web_server/7-puppet_install_nginx_web_server.pp: -------------------------------------------------------------------------------- 1 | # add stable version of nginx 2 | exec { 'add nginx stable repo': 3 | command => 'sudo add-apt-repository ppa:nginx/stable', 4 | path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 5 | } 6 | 7 | # update software packages list 8 | exec { 'update packages': 9 | command => 'apt-get update', 10 | path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 11 | } 12 | 13 | # install nginx 14 | package { 'nginx': 15 | ensure => 'installed', 16 | } 17 | 18 | # allow HTTP 19 | exec { 'allow HTTP': 20 | command => "ufw allow 'Nginx HTTP'", 21 | path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 22 | onlyif => '! dpkg -l nginx | egrep \'îi.*nginx\' > /dev/null 2>&1', 23 | } 24 | 25 | # change folder rights 26 | exec { 'chmod www folder': 27 | command => 'chmod -R 755 /var/www', 28 | path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 29 | } 30 | 31 | # create index file 32 | file { '/var/www/html/index.html': 33 | content => "Hello World!\n", 34 | } 35 | 36 | # create index file 37 | file { '/var/www/html/404.html': 38 | content => "Ceci n'est pas une page\n", 39 | } 40 | 41 | # add redirection and error page 42 | file { 'Nginx default config file': 43 | ensure => file, 44 | path => '/etc/nginx/sites-enabled/default', 45 | content => 46 | "server { 47 | listen 80 default_server; 48 | listen [::]:80 default_server; 49 | root /var/www/html; 50 | # Add index.php to the list if you are using PHP 51 | index index.html index.htm index.nginx-debian.html; 52 | server_name _; 53 | location / { 54 | # First attempt to serve request as file, then 55 | # as directory, then fall back to displaying a 404. 56 | try_files \$uri \$uri/ =404; 57 | } 58 | error_page 404 /404.html; 59 | location /404.html { 60 | internal; 61 | } 62 | 63 | if (\$request_filename ~ redirect_me){ 64 | rewrite ^ https://www.youtube.com/watch?v=QH2-TGUlwu4 permanent; 65 | } 66 | } 67 | ", 68 | } 69 | # restart nginx 70 | exec { 'restart service': 71 | command => 'service nginx restart', 72 | path => '/usr/bin:/usr/sbin:/bin', 73 | } 74 | 75 | # start service nginx 76 | service { 'nginx': 77 | ensure => running, 78 | require => Package['nginx'], 79 | } 80 | -------------------------------------------------------------------------------- /0x0C-web_server/README.md: -------------------------------------------------------------------------------- 1 | # Web server 2 | Project done during **Full Stack Software Engineering** at **ALX**. It aims to learn about the roles of web servers and their processes (parent and child), and DNS roles. 3 | 4 | ## Technologies 5 | * Scripts written in Bash 4 6 | * Tested on Ubuntu 20.04 LTS 7 | 8 | ## Files 9 | 10 | | Filename | Description | 11 | | -------- | ----------- | 12 | | `0-transfer_file` | Transfers a file from our client to a server | 13 | | `1-install_nginx_web_server` | Configures an Ubuntu machine to install NGINX web server | 14 | | `2-setup_a_domain_name` | Contains the domain name server of a created web site | 15 | | `3-redirection` | Configures an Ubuntu machine to make a redirection | 16 | | `4-not_found_page_404` | Configures a Ubuntu machine to have a custom 404 page | 17 | | `7-puppet_install_nginx_web_server.pp` | Configures a Ubuntu machine to make a redirection and a custom 404 page | 18 | -------------------------------------------------------------------------------- /0x0D-web_stack_debugging_0/0-give_me_a_page: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # run apache on holbertonschool/265-0 container 3 | 4 | echo "ServerName localhost" >> /etc/apache2.conf 5 | service apache2 start 6 | -------------------------------------------------------------------------------- /0x0D-web_stack_debugging_0/README.md: -------------------------------------------------------------------------------- 1 | # 0x0D-web_stack_debugging_0 2 |

This is one among the Webstack debugging series of projects where I will be given broken/bugged webstacks. The final goal is to come up with a Bash script that once executed, it will bring the webstack to a working state.

3 | -------------------------------------------------------------------------------- /0x0E-web_stack_debugging_1/0-nginx_likes_port_80: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Configures an Nginx server to listen on port 80. 3 | 4 | rm /etc/nginx/sites-enabled/default 5 | ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default 6 | service nginx restart 7 | -------------------------------------------------------------------------------- /0x0E-web_stack_debugging_1/1: -------------------------------------------------------------------------------- 1 | * Restarting nginx nginx 2 | ...done. 3 | -------------------------------------------------------------------------------- /0x0E-web_stack_debugging_1/1-debugging_made_short: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Configures an Nginx server to listen on port 80. 3 | ln -sf /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default 4 | service nginx start 5 | kill "$(pgrep 'nginx' | head -1)" 6 | -------------------------------------------------------------------------------- /0x0E-web_stack_debugging_1/README.md: -------------------------------------------------------------------------------- 1 | # Web stack debugging 1 -------------------------------------------------------------------------------- /0x0F-load_balancer/0-custom_http_response-header: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # returns a custom header on request 3 | 4 | apt-get -y update 5 | apt-get -y install nginx 6 | 7 | sed -i "47i\\\tadd_header X-Served-By $HOSTNAME;" /etc/nginx/sites-available/default 8 | echo "Hello World!" | tee /var/www/html/index.html 9 | echo "Ceci n'est pas une page" > /var/www/html/404.html 10 | 11 | service nginx start 12 | -------------------------------------------------------------------------------- /0x0F-load_balancer/1-install_load_balancer: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Install and configure HAproxy on your lb-01 server. 3 | 4 | apt-get -y install software-properties-common 5 | add-apt-repository -y ppa:vbernat/haproxy-2.6 6 | apt-get -y update 7 | apt-get -y install haproxy 8 | 9 | sed -i -e '$aENABLED=1\n' /etc/default/haproxy 10 | sed -i -e '$a\listen balancer\n\tbind :80\n\tbalance roundrobin\n\tserver 36768-web-01 34.204.186.164:80 check\n\tserver 36768-web-02 54.80.223.108:80 check\n' /etc/haproxy/haproxy.cfg 11 | service haproxy restart 12 | -------------------------------------------------------------------------------- /0x0F-load_balancer/2-puppet_custom_http_response-header.pp: -------------------------------------------------------------------------------- 1 | # Installs a Nginx server with custome HTTP header 2 | 3 | exec {'update': 4 | provider => shell, 5 | command => 'sudo apt-get -y update', 6 | before => Exec['install Nginx'], 7 | } 8 | 9 | exec {'install Nginx': 10 | provider => shell, 11 | command => 'sudo apt-get -y install nginx', 12 | before => Exec['add_header'], 13 | } 14 | 15 | exec { 'add_header': 16 | provider => shell, 17 | environment => ["HOST=${hostname}"], 18 | command => 'sudo sed -i "s/include \/etc\/nginx\/sites-enabled\/\*;/include \/etc\/nginx\/sites-enabled\/\*;\n\tadd_header X-Served-By \"$HOST\";/" /etc/nginx/nginx.conf', 19 | before => Exec['restart Nginx'], 20 | } 21 | 22 | exec { 'restart Nginx': 23 | provider => shell, 24 | command => 'sudo service nginx restart', 25 | } -------------------------------------------------------------------------------- /0x0F-load_balancer/README.md: -------------------------------------------------------------------------------- 1 | # Load Balancer -------------------------------------------------------------------------------- /0x10-https_ssl/0-world_wide_web: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Configure my domain zone: 3 | # www --> 914-lb-01 3.83.192.251 4 | # web-01 --> 914-web-01 18.205.38.219 5 | # web-02 --> 914-web-02 34.138.16.188 6 | 7 | # -- To be evaluated -- 8 | # domain_information () { 9 | # line=$(dig "$2"."$1" | grep -A1 'ANSWER SECTION:' | tr '\t' '\n' | tail -2 | tr '\n' ' ') 10 | # echo "$2 $line" | awk '{print "The subdomain " $1 " is a " $2 " record and points to " $3}' 11 | # } 12 | 13 | # if [ "$#" == 1 ] 14 | # then 15 | # domain_information "$1" "www" 16 | # domain_information "$1" "lb-01" 17 | # domain_information "$1" "web-01" 18 | # domain_information "$1" "web-02" 19 | # elif [ "$#" == 2 ] 20 | # then 21 | # domain_information "$1" "$2" 22 | # fi 23 | #-- To be evaluated -- 24 | 25 | subdomains_all=( "www" "lb-01" "web-01" "web-02" ) 26 | 27 | runDig () { 28 | subdomain=$1 29 | domain=$2 30 | 31 | dig "$subdomain.$domain" | grep -A1 'ANSWER SECTION:' | tail -1 | awk -v s="$subdomain" 'BEGIN { FS = " " } ; { print "The subdomain " s " is a " $4 " record and points to " $5 }' 32 | } 33 | 34 | if [ $# -eq 1 ]; then 35 | domain="$1" 36 | for i in "${subdomains_all[@]}" 37 | do 38 | runDig "$i" "$domain" 39 | done 40 | elif [ $# -eq 2 ]; then 41 | domain="$1" 42 | subdomain="$2" 43 | runDig "$subdomain" "$domain" 44 | fi 45 | -------------------------------------------------------------------------------- /0x10-https_ssl/1-haproxy_ssl_termination: -------------------------------------------------------------------------------- 1 | global 2 | log /dev/log local0 3 | log /dev/log local1 notice 4 | chroot /var/lib/haproxy 5 | stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners 6 | stats timeout 30s 7 | user haproxy 8 | group haproxy 9 | daemon 10 | 11 | # Default SSL material locations 12 | ca-base /etc/ssl/certs 13 | crt-base /etc/ssl/private 14 | 15 | # See: https://ssl-config.mozilla.org/#server=haproxy&server-version=2.0.3&config=intermediate 16 | ssl-default-bind-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384 17 | ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256 18 | ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets 19 | 20 | defaults 21 | log global 22 | mode http 23 | option httplog 24 | option dontlognull 25 | timeout connect 5000 26 | timeout client 50000 27 | timeout server 50000 28 | errorfile 400 /etc/haproxy/errors/400.http 29 | errorfile 403 /etc/haproxy/errors/403.http 30 | errorfile 408 /etc/haproxy/errors/408.http 31 | errorfile 500 /etc/haproxy/errors/500.http 32 | errorfile 502 /etc/haproxy/errors/502.http 33 | errorfile 503 /etc/haproxy/errors/503.http 34 | errorfile 504 /etc/haproxy/errors/504.http 35 | 36 | # start of parameters for ruthmarcuss.tech 37 | frontend gobrand.tech-http-frontend 38 | bind *:80 39 | option forwardfor 40 | default_backend nginx_webservers 41 | 42 | 43 | frontend gobrand.tech-https-frontend 44 | bind *:443 ssl crt /etc/letsencrypt/live/www.ruthmarcuss.tech.tech/fullchain.pem 45 | default_backend nginx_webservers 46 | 47 | 48 | backend nginx_webservers 49 | balance roundrobin 50 | server 61590-web-01 check 51 | server 61590-web-02 check 52 | # end of parameters 53 | -------------------------------------------------------------------------------- /0x10-https_ssl/100-redirect_http_to_https: -------------------------------------------------------------------------------- 1 | global 2 | log /dev/log local0 3 | log /dev/log local1 notice 4 | chroot /var/lib/haproxy 5 | stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners 6 | stats timeout 30s 7 | user haproxy 8 | group haproxy 9 | daemon 10 | 11 | # Default SSL material locations 12 | ca-base /etc/ssl/certs 13 | crt-base /etc/ssl/private 14 | 15 | # See: https://ssl-config.mozilla.org/#server=haproxy&server-version=2.0.3&config=intermediate 16 | ssl-default-bind-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384 17 | ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256 18 | ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets 19 | 20 | defaults 21 | log global 22 | mode http 23 | option httplog 24 | option dontlognull 25 | timeout connect 5000 26 | timeout client 50000 27 | timeout server 50000 28 | errorfile 400 /etc/haproxy/errors/400.http 29 | errorfile 403 /etc/haproxy/errors/403.http 30 | errorfile 408 /etc/haproxy/errors/408.http 31 | errorfile 500 /etc/haproxy/errors/500.http 32 | errorfile 502 /etc/haproxy/errors/502.http 33 | errorfile 503 /etc/haproxy/errors/503.http 34 | errorfile 504 /etc/haproxy/errors/504.http 35 | 36 | listen balancer 37 | # frontend config settings 38 | bind :80 39 | bind *:443 ssl crt /etc/letsencrypt/live/www.ruthmarcuss.tech/fullchain.pem 40 | http-request redirect scheme https code 301 unless { ssl_fc } 41 | 42 | # backend config settings 43 | balance roundrobin 44 | server 61590-web-01 18.204.7.186:80 check 45 | server 61590-web-02 3.83.245.14:80 check 46 | -------------------------------------------------------------------------------- /0x10-https_ssl/README.md: -------------------------------------------------------------------------------- 1 | # 0x10-https_ssl 2 | 3 | Concepts learnt: 4 | - What is HTTPS SSL 2 main roles 5 | - What is the purpose encrypting traffic 6 | - What SSL termination means -------------------------------------------------------------------------------- /0x11-what_happens_when_your_type_google_com_in_your_browser_and_press_enter/0-blog_post: -------------------------------------------------------------------------------- 1 | https://medium.com/@oliversamuel146/what-happens-when-you-type-google-com-or-any-other-url-in-your-browser-and-press-enter-82e49994d06 2 | -------------------------------------------------------------------------------- /0x11-what_happens_when_your_type_google_com_in_your_browser_and_press_enter/1-what_happen_when_diagram: -------------------------------------------------------------------------------- 1 | https://medium.com/@oliversamuel146/what-happens-when-you-type-google-com-or-any-other-url-in-your-browser-and-press-enter-82e49994d06 2 | -------------------------------------------------------------------------------- /0x11-what_happens_when_your_type_google_com_in_your_browser_and_press_enter/2-contribution-to_what-happens-when_github_answer: -------------------------------------------------------------------------------- 1 | https://github.com/alex/what-happens-when/pull/491 2 | -------------------------------------------------------------------------------- /0x12-web_stack_debugging_2/0-iamsomeoneelse: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # runs whoami command under user passed as arg1 3 | su "$1" -s /bin/bash -c 'whoami' 4 | -------------------------------------------------------------------------------- /0x12-web_stack_debugging_2/1-run_nginx_as_nginx: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # fix container:: task 2 3 | pkill -f apache2 4 | chmod 644 /etc/nginx/nginx.conf 5 | sed -i "1i user nginx;" /etc/nginx/nginx.conf 6 | sed -i 's/80/8080/' /etc/nginx/sites-enabled/default 7 | sudo -u nginx service nginx restart 8 | -------------------------------------------------------------------------------- /0x12-web_stack_debugging_2/100-fix_in_7_lines_or_less: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # fix container:: task 2 3 | pkill -f apache2 4 | chmod 644 /etc/nginx/nginx.conf 5 | sed -Ei 's/\s*#?\s*user .*/user nginx;/' /etc/nginx/nginx.conf 6 | sed -Ei 's/(listen (\[::\]:)?80) /\180 /' /etc/nginx/sites-enabled/default 7 | sudo -u nginx service nginx restart 8 | -------------------------------------------------------------------------------- /0x12-web_stack_debugging_2/README.md: -------------------------------------------------------------------------------- 1 | # 0x12-web_stack_debugging_2 2 | 3 | This project is one among the debugging series where I am given broken code to write a solution script to 4 | -------------------------------------------------------------------------------- /0x13-firewall/0-block_all_incoming_traffic_but: -------------------------------------------------------------------------------- 1 | sudo apt-get install ufw 2 | sudo ufw status 3 | sudo ufw enable -y 4 | sudo ufw default deny incoming -y 5 | sudo ufw default allow outgoing -y 6 | sudo ufw allow 22/tcp 7 | sudo ufw allow 443/tcp 8 | sudo ufw allow 80/tcp 9 | -------------------------------------------------------------------------------- /0x13-firewall/100-port_forwarding: -------------------------------------------------------------------------------- 1 | # 2 | # rules.before 3 | # 4 | # Rules that should be run before the ufw command line added rules. Custom 5 | # rules should be added to one of these chains: 6 | # ufw-before-input 7 | # ufw-before-output 8 | # ufw-before-forward 9 | # 10 | 11 | ## Section added to allow port 80 to forward to 8080 12 | *nat 13 | :PREROUTING ACCEPT [0:0] 14 | -A PREROUTING -p tcp --dport 8080 -j REDIRECT --to-port 80 15 | COMMIT 16 | # end of added section 17 | 18 | # Don't delete these required lines, otherwise there will be errors 19 | *filter 20 | :ufw-before-input - [0:0] 21 | :ufw-before-output - [0:0] 22 | :ufw-before-forward - [0:0] 23 | :ufw-not-local - [0:0] 24 | # End required lines 25 | 26 | 27 | # allow all on loopback 28 | -A ufw-before-input -i lo -j ACCEPT 29 | -A ufw-before-output -o lo -j ACCEPT 30 | 31 | # quickly process packets for which we already have a connection 32 | -A ufw-before-input -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT 33 | -A ufw-before-output -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT 34 | -A ufw-before-forward -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT 35 | 36 | # drop INVALID packets (logs these in loglevel medium and higher) 37 | -A ufw-before-input -m conntrack --ctstate INVALID -j ufw-logging-deny 38 | -A ufw-before-input -m conntrack --ctstate INVALID -j DROP 39 | 40 | # ok icmp codes for INPUT 41 | -A ufw-before-input -p icmp --icmp-type destination-unreachable -j ACCEPT 42 | -A ufw-before-input -p icmp --icmp-type time-exceeded -j ACCEPT 43 | -A ufw-before-input -p icmp --icmp-type parameter-problem -j ACCEPT 44 | -A ufw-before-input -p icmp --icmp-type echo-request -j ACCEPT 45 | 46 | # ok icmp code for FORWARD 47 | -A ufw-before-forward -p icmp --icmp-type destination-unreachable -j ACCEPT 48 | -A ufw-before-forward -p icmp --icmp-type time-exceeded -j ACCEPT 49 | -A ufw-before-forward -p icmp --icmp-type parameter-problem -j ACCEPT 50 | -A ufw-before-forward -p icmp --icmp-type echo-request -j ACCEPT 51 | 52 | # allow dhcp client to work 53 | -A ufw-before-input -p udp --sport 67 --dport 68 -j ACCEPT 54 | 55 | # 56 | # ufw-not-local 57 | # 58 | -A ufw-before-input -j ufw-not-local 59 | 60 | # if LOCAL, RETURN 61 | -A ufw-not-local -m addrtype --dst-type LOCAL -j RETURN 62 | 63 | # if MULTICAST, RETURN 64 | -A ufw-not-local -m addrtype --dst-type MULTICAST -j RETURN 65 | 66 | # if BROADCAST, RETURN 67 | -A ufw-not-local -m addrtype --dst-type BROADCAST -j RETURN 68 | 69 | # all other non-local packets are dropped 70 | -A ufw-not-local -m limit --limit 3/min --limit-burst 10 -j ufw-logging-deny 71 | -A ufw-not-local -j DROP 72 | 73 | # allow MULTICAST mDNS for service discovery (be sure the MULTICAST line above 74 | # is uncommented) 75 | -A ufw-before-input -p udp -d 224.0.0.251 --dport 5353 -j ACCEPT 76 | 77 | # allow MULTICAST UPnP for service discovery (be sure the MULTICAST line above 78 | # is uncommented) 79 | -A ufw-before-input -p udp -d 239.255.255.250 --dport 1900 -j ACCEPT 80 | 81 | # don't delete the 'COMMIT' line or these rules won't be processed 82 | COMMIT 83 | -------------------------------------------------------------------------------- /0x13-firewall/README.md: -------------------------------------------------------------------------------- 1 | # 0x13-firewall 2 | 3 | In this project, I learnt how to configure firewall to searvers. 4 | -------------------------------------------------------------------------------- /0x14-mysql/4-mysql_configuration_primary: -------------------------------------------------------------------------------- 1 | # 2 | # The MySQL database server configuration file. 3 | # 4 | # You can copy this to one of: 5 | # - "/etc/mysql/my.cnf" to set global options, 6 | # - "~/.my.cnf" to set user-specific options. 7 | # 8 | # One can use all long options that the program supports. 9 | # Run program with --help to get a list of available options and with 10 | # --print-defaults to see which it would actually understand and use. 11 | # 12 | # For explanations see 13 | # http://dev.mysql.com/doc/mysql/en/server-system-variables.html 14 | 15 | # 16 | # * IMPORTANT: Additional settings that can override those from this file! 17 | # The files must end with '.cnf', otherwise they'll be ignored. 18 | # 19 | 20 | [mysqld] 21 | pid-file = /var/run/mysqld/mysqld.pid 22 | socket = /var/run/mysqld/mysqld.sock 23 | datadir = /var/lib/mysql 24 | log-error = /var/log/mysql/error.log 25 | symbolic-links = 0 26 | server-id = 1 27 | log_bin = /var/log/mysql/mysql-bin.log 28 | binlog_do_db = tyrell_corp 29 | -------------------------------------------------------------------------------- /0x14-mysql/4-mysql_configuration_replica: -------------------------------------------------------------------------------- 1 | # 2 | # The MySQL database server configuration file. 3 | # 4 | # You can copy this to one of: 5 | # - "/etc/mysql/my.cnf" to set global options, 6 | # - "~/.my.cnf" to set user-specific options. 7 | # 8 | # One can use all long options that the program supports. 9 | # Run program with --help to get a list of available options and with 10 | # --print-defaults to see which it would actually understand and use. 11 | # 12 | # For explanations see 13 | # http://dev.mysql.com/doc/mysql/en/server-system-variables.html 14 | 15 | # 16 | # * IMPORTANT: Additional settings that can override those from this file! 17 | # The files must end with '.cnf', otherwise they'll be ignored. 18 | # 19 | 20 | [mysqld] 21 | pid-file = /var/run/mysqld/mysqld.pid 22 | socket = /var/run/mysqld/mysqld.sock 23 | datadir = /var/lib/mysql 24 | log-error = /var/log/mysql/error.log 25 | bind-address = 0.0.0.0 26 | symbolic-links = 0 27 | server-id = 2 28 | log_bin = /var/log/mysql/mysql-bin.log 29 | relay_log = /var/log/mysql/mysql-relay-bin 30 | binlog_do_db = tyrell_corp 31 | -------------------------------------------------------------------------------- /0x14-mysql/5-mysql_backup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Generates a compressed archive of a MySQL dump. 3 | mysqldump -uroot -p"$1" --all-databases > backup.sql 4 | tar -cvzf "$(date +%d-%m-%Y)".tar.gz backup.sql 5 | -------------------------------------------------------------------------------- /0x14-mysql/README.md: -------------------------------------------------------------------------------- 1 | # MySQL -------------------------------------------------------------------------------- /0x15-api/0-gather_data_from_an_API.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | """ 3 | Using https://jsonplaceholder.typicode.com 4 | returns info about employee TODO progress 5 | Implemented using recursion 6 | """ 7 | import re 8 | import requests 9 | import sys 10 | 11 | 12 | API = "https://jsonplaceholder.typicode.com" 13 | """REST API url""" 14 | 15 | 16 | if __name__ == '__main__': 17 | if len(sys.argv) > 1: 18 | if re.fullmatch(r'\d+', sys.argv[1]): 19 | id = int(sys.argv[1]) 20 | user_res = requests.get('{}/users/{}'.format(API, id)).json() 21 | todos_res = requests.get('{}/todos'.format(API)).json() 22 | user_name = user_res.get('name') 23 | todos = list(filter(lambda x: x.get('userId') == id, todos_res)) 24 | todos_done = list(filter(lambda x: x.get('completed'), todos)) 25 | print( 26 | 'Employee {} is done with tasks({}/{}):'.format( 27 | user_name, 28 | len(todos_done), 29 | len(todos) 30 | ) 31 | ) 32 | for todo_done in todos_done: 33 | print('\t {}'.format(todo_done.get('title'))) 34 | -------------------------------------------------------------------------------- /0x15-api/0-gather_data_from_an_API.py.ignore: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | """ 3 | Using https://jsonplaceholder.typicode.com 4 | returns info about employee TODO progress 5 | 6 | This script need some more thinking...for later 7 | 8 | """ 9 | import requests 10 | from sys import argv 11 | 12 | 13 | def request_data(): 14 | """Requests employees data and TODO""" 15 | employees = requests.get("https://jsonplaceholder.typicode.com/users") 16 | EMPLOYEE_NAME = "" 17 | for employee in employees.json(): 18 | if employee.get("id") == int(argv[1]): 19 | EMPLOYEE_NAME = employee.get("name") 20 | break 21 | NUMBER_OF_DONE_TASKS = 0 22 | TOTAL_NUMBER_OF_TASKS = 0 23 | TASK_TITLE = [] 24 | 25 | tasks = requests.get("https://jsonplaceholder.typicode.com/todos") 26 | for task in tasks.json(): 27 | if task.get("userId") == int(argv[1]): 28 | TOTAL_NUMBER_OF_TASKS += 1 29 | if task.get("completed") is True: 30 | NUMBER_OF_DONE_TASKS += 1 31 | TASK_TITLE.append(task.get("title")) 32 | 33 | print( 34 | f"Employee {EMPLOYEE_NAME} is done with" 35 | f" {NUMBER_OF_DONE_TASKS}/{TOTAL_NUMBER_OF_TASKS}:" 36 | ) 37 | 38 | for task in TASK_TITLE: 39 | print(f"\t {task}") 40 | 41 | 42 | if __name__ == "__main__": 43 | request_data() 44 | -------------------------------------------------------------------------------- /0x15-api/1-export_to_CSV.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | """ 3 | Using https://jsonplaceholder.typicode.com 4 | gathers data from API and exports it to CSV file 5 | Implemented using recursion 6 | """ 7 | import re 8 | import requests 9 | import sys 10 | 11 | 12 | API = "https://jsonplaceholder.typicode.com" 13 | """REST API url""" 14 | 15 | 16 | if __name__ == '__main__': 17 | if len(sys.argv) > 1: 18 | if re.fullmatch(r'\d+', sys.argv[1]): 19 | id = int(sys.argv[1]) 20 | user_res = requests.get('{}/users/{}'.format(API, id)).json() 21 | todos_res = requests.get('{}/todos'.format(API)).json() 22 | user_name = user_res.get('username') 23 | todos = list(filter(lambda x: x.get('userId') == id, todos_res)) 24 | with open('{}.csv'.format(id), 'w') as file: 25 | for todo in todos: 26 | file.write( 27 | '"{}","{}","{}","{}"\n'.format( 28 | id, 29 | user_name, 30 | todo.get('completed'), 31 | todo.get('title') 32 | ) 33 | ) 34 | -------------------------------------------------------------------------------- /0x15-api/2-export_to_JSON.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | """ 3 | Using https://jsonplaceholder.typicode.com 4 | gathers data from API and exports it to JSON file 5 | Implemented using recursion 6 | """ 7 | import json 8 | import re 9 | import requests 10 | import sys 11 | 12 | 13 | API = "https://jsonplaceholder.typicode.com" 14 | """REST API url""" 15 | 16 | 17 | if __name__ == '__main__': 18 | if len(sys.argv) > 1: 19 | if re.fullmatch(r'\d+', sys.argv[1]): 20 | id = int(sys.argv[1]) 21 | user_res = requests.get('{}/users/{}'.format(API, id)).json() 22 | todos_res = requests.get('{}/todos'.format(API)).json() 23 | user_name = user_res.get('username') 24 | todos = list(filter(lambda x: x.get('userId') == id, todos_res)) 25 | with open("{}.json".format(id), 'w') as json_file: 26 | user_data = list(map( 27 | lambda x: { 28 | "task": x.get("title"), 29 | "completed": x.get("completed"), 30 | "username": user_name 31 | }, 32 | todos 33 | )) 34 | user_data = { 35 | "{}".format(id): user_data 36 | } 37 | json.dump(user_data, json_file) 38 | -------------------------------------------------------------------------------- /0x15-api/2.json: -------------------------------------------------------------------------------- 1 | {"2": [{"task": "suscipit repellat esse quibusdam voluptatem incidunt", "completed": false, "username": "Antonette"}, {"task": "distinctio vitae autem nihil ut molestias quo", "completed": true, "username": "Antonette"}, {"task": "et itaque necessitatibus maxime molestiae qui quas velit", "completed": false, "username": "Antonette"}, {"task": "adipisci non ad dicta qui amet quaerat doloribus ea", "completed": false, "username": "Antonette"}, {"task": "voluptas quo tenetur perspiciatis explicabo natus", "completed": true, "username": "Antonette"}, {"task": "aliquam aut quasi", "completed": true, "username": "Antonette"}, {"task": "veritatis pariatur delectus", "completed": true, "username": "Antonette"}, {"task": "nesciunt totam sit blanditiis sit", "completed": false, "username": "Antonette"}, {"task": "laborum aut in quam", "completed": false, "username": "Antonette"}, {"task": "nemo perspiciatis repellat ut dolor libero commodi blanditiis omnis", "completed": true, "username": "Antonette"}, {"task": "repudiandae totam in est sint facere fuga", "completed": false, "username": "Antonette"}, {"task": "earum doloribus ea doloremque quis", "completed": false, "username": "Antonette"}, {"task": "sint sit aut vero", "completed": false, "username": "Antonette"}, {"task": "porro aut necessitatibus eaque distinctio", "completed": false, "username": "Antonette"}, {"task": "repellendus veritatis molestias dicta incidunt", "completed": true, "username": "Antonette"}, {"task": "excepturi deleniti adipisci voluptatem et neque optio illum ad", "completed": true, "username": "Antonette"}, {"task": "sunt cum tempora", "completed": false, "username": "Antonette"}, {"task": "totam quia non", "completed": false, "username": "Antonette"}, {"task": "doloremque quibusdam asperiores libero corrupti illum qui omnis", "completed": false, "username": "Antonette"}, {"task": "totam atque quo nesciunt", "completed": true, "username": "Antonette"}]} -------------------------------------------------------------------------------- /0x15-api/3-dictionary_of_list_of_dictionaries.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | """ 3 | Using https://jsonplaceholder.typicode.com 4 | gathers data from API and exports it to JSON file 5 | Implemented using recursion 6 | """ 7 | import json 8 | import requests 9 | 10 | 11 | API = "https://jsonplaceholder.typicode.com" 12 | """REST API url""" 13 | 14 | 15 | if __name__ == '__main__': 16 | users_res = requests.get('{}/users'.format(API)).json() 17 | todos_res = requests.get('{}/todos'.format(API)).json() 18 | users_data = {} 19 | for user in users_res: 20 | id = user.get('id') 21 | user_name = user.get('username') 22 | todos = list(filter(lambda x: x.get('userId') == id, todos_res)) 23 | user_data = list(map( 24 | lambda x: { 25 | 'username': user_name, 26 | 'task': x.get('title'), 27 | 'completed': x.get('completed') 28 | }, 29 | todos 30 | )) 31 | users_data['{}'.format(id)] = user_data 32 | with open('todo_all_employees.json', 'w') as file: 33 | json.dump(users_data, file) 34 | -------------------------------------------------------------------------------- /0x15-api/README.md: -------------------------------------------------------------------------------- 1 | # 0x15. API 2 | 3 | All along, we have been writing shell scripts for cross-platform communication. In this project, I am introduced to Application Programming Interfaces which is simply a software intermediary that allows two applications to talk to each other though defined interfaces. 4 | 5 | 6 | Concepts learnt: 7 | - What Bash scripting should not be used for 8 | - What is an API 9 | - What is a REST API 10 | - What are microservices 11 | - What is the CSV format 12 | - What is the JSON format 13 | - Pythonic Package and module name style 14 | - Pythonic Class name style 15 | - Pythonic Variable name style 16 | - Pythonic Function name style 17 | - Pythonic Constant name style 18 | - Significance of CapWords or CamelCase in Python 19 | 20 | 21 | This directory contains python script I wrote with this [REST API](https://jsonplaceholder.typicode.com/) 22 | -------------------------------------------------------------------------------- /0x15-api/todo_all_employees.json: -------------------------------------------------------------------------------- 1 | {"1": [{"username": "Bret", "task": "delectus aut autem", "completed": false}, {"username": "Bret", "task": "quis ut nam facilis et officia qui", "completed": false}, {"username": "Bret", "task": "fugiat veniam minus", "completed": false}, {"username": "Bret", "task": "et porro tempora", "completed": true}, {"username": "Bret", "task": "laboriosam mollitia et enim quasi adipisci quia provident illum", "completed": false}, {"username": "Bret", "task": "qui ullam ratione quibusdam voluptatem quia omnis", "completed": false}, {"username": "Bret", "task": "illo expedita consequatur quia in", "completed": false}, {"username": "Bret", "task": "quo adipisci enim quam ut ab", "completed": true}, {"username": "Bret", "task": "molestiae perspiciatis ipsa", "completed": false}, {"username": "Bret", "task": "illo est ratione doloremque quia maiores aut", "completed": true}, {"username": "Bret", "task": "vero rerum temporibus dolor", "completed": true}, {"username": "Bret", "task": "ipsa repellendus fugit nisi", "completed": true}, {"username": "Bret", "task": "et doloremque nulla", "completed": false}, {"username": "Bret", "task": "repellendus sunt dolores architecto voluptatum", "completed": true}, {"username": "Bret", "task": "ab voluptatum amet voluptas", "completed": true}, {"username": "Bret", "task": "accusamus eos facilis sint et aut voluptatem", "completed": true}, {"username": "Bret", "task": "quo laboriosam deleniti aut qui", "completed": true}, {"username": "Bret", "task": "dolorum est consequatur ea mollitia in culpa", "completed": false}, {"username": "Bret", "task": "molestiae ipsa aut voluptatibus pariatur dolor nihil", "completed": true}, {"username": "Bret", "task": "ullam nobis libero sapiente ad optio sint", "completed": true}], "2": [{"username": "Antonette", "task": "suscipit repellat esse quibusdam voluptatem incidunt", "completed": false}, {"username": "Antonette", "task": "distinctio vitae autem nihil ut molestias quo", "completed": true}, {"username": "Antonette", "task": "et itaque necessitatibus maxime molestiae qui quas velit", "completed": false}, {"username": "Antonette", "task": "adipisci non ad dicta qui amet quaerat doloribus ea", "completed": false}, {"username": "Antonette", "task": "voluptas quo tenetur perspiciatis explicabo natus", "completed": true}, {"username": "Antonette", "task": "aliquam aut quasi", "completed": true}, {"username": "Antonette", "task": "veritatis pariatur delectus", "completed": true}, {"username": "Antonette", "task": "nesciunt totam sit blanditiis sit", "completed": false}, {"username": "Antonette", "task": "laborum aut in quam", "completed": false}, {"username": "Antonette", "task": "nemo perspiciatis repellat ut dolor libero commodi blanditiis omnis", "completed": true}, {"username": "Antonette", "task": "repudiandae totam in est sint facere fuga", "completed": false}, {"username": "Antonette", "task": "earum doloribus ea doloremque quis", "completed": false}, {"username": "Antonette", "task": "sint sit aut vero", "completed": false}, {"username": "Antonette", "task": "porro aut necessitatibus eaque distinctio", "completed": false}, {"username": "Antonette", "task": "repellendus veritatis molestias dicta incidunt", "completed": true}, {"username": "Antonette", "task": "excepturi deleniti adipisci voluptatem et neque optio illum ad", "completed": true}, {"username": "Antonette", "task": "sunt cum tempora", "completed": false}, {"username": "Antonette", "task": "totam quia non", "completed": false}, {"username": "Antonette", "task": "doloremque quibusdam asperiores libero corrupti illum qui omnis", "completed": false}, {"username": "Antonette", "task": "totam atque quo nesciunt", "completed": true}], "3": [{"username": "Samantha", "task": "aliquid amet impedit consequatur aspernatur placeat eaque fugiat suscipit", "completed": false}, {"username": "Samantha", "task": "rerum perferendis error quia ut eveniet", "completed": false}, {"username": "Samantha", "task": "tempore ut sint quis recusandae", "completed": true}, {"username": "Samantha", "task": "cum debitis quis accusamus doloremque ipsa natus sapiente omnis", "completed": true}, {"username": "Samantha", "task": "velit soluta adipisci molestias reiciendis harum", "completed": false}, {"username": "Samantha", "task": "vel voluptatem repellat nihil placeat corporis", "completed": false}, {"username": "Samantha", "task": "nam qui rerum fugiat accusamus", "completed": false}, {"username": "Samantha", "task": "sit reprehenderit omnis quia", "completed": false}, {"username": "Samantha", "task": "ut necessitatibus aut maiores debitis officia blanditiis velit et", "completed": false}, {"username": "Samantha", "task": "cupiditate necessitatibus ullam aut quis dolor voluptate", "completed": true}, {"username": "Samantha", "task": "distinctio exercitationem ab doloribus", "completed": false}, {"username": "Samantha", "task": "nesciunt dolorum quis recusandae ad pariatur ratione", "completed": false}, {"username": "Samantha", "task": "qui labore est occaecati recusandae aliquid quam", "completed": false}, {"username": "Samantha", "task": "quis et est ut voluptate quam dolor", "completed": true}, {"username": "Samantha", "task": "voluptatum omnis minima qui occaecati provident nulla voluptatem ratione", "completed": true}, {"username": "Samantha", "task": "deleniti ea temporibus enim", "completed": true}, {"username": "Samantha", "task": "pariatur et magnam ea doloribus similique voluptatem rerum quia", "completed": false}, {"username": "Samantha", "task": "est dicta totam qui explicabo doloribus qui dignissimos", "completed": false}, {"username": "Samantha", "task": "perspiciatis velit id laborum placeat iusto et aliquam odio", "completed": false}, {"username": "Samantha", "task": "et sequi qui architecto ut adipisci", "completed": true}], "4": [{"username": "Karianne", "task": "odit optio omnis qui sunt", "completed": true}, {"username": "Karianne", "task": "et placeat et tempore aspernatur sint numquam", "completed": false}, {"username": "Karianne", "task": "doloremque aut dolores quidem fuga qui nulla", "completed": true}, {"username": "Karianne", "task": "voluptas consequatur qui ut quia magnam nemo esse", "completed": false}, {"username": "Karianne", "task": "fugiat pariatur ratione ut asperiores necessitatibus magni", "completed": false}, {"username": "Karianne", "task": "rerum eum molestias autem voluptatum sit optio", "completed": false}, {"username": "Karianne", "task": "quia voluptatibus voluptatem quos similique maiores repellat", "completed": false}, {"username": "Karianne", "task": "aut id perspiciatis voluptatem iusto", "completed": false}, {"username": "Karianne", "task": "doloribus sint dolorum ab adipisci itaque dignissimos aliquam suscipit", "completed": false}, {"username": "Karianne", "task": "ut sequi accusantium et mollitia delectus sunt", "completed": false}, {"username": "Karianne", "task": "aut velit saepe ullam", "completed": false}, {"username": "Karianne", "task": "praesentium facilis facere quis harum voluptatibus voluptatem eum", "completed": false}, {"username": "Karianne", "task": "sint amet quia totam corporis qui exercitationem commodi", "completed": true}, {"username": "Karianne", "task": "expedita tempore nobis eveniet laborum maiores", "completed": false}, {"username": "Karianne", "task": "occaecati adipisci est possimus totam", "completed": false}, {"username": "Karianne", "task": "sequi dolorem sed", "completed": true}, {"username": "Karianne", "task": "maiores aut nesciunt delectus exercitationem vel assumenda eligendi at", "completed": false}, {"username": "Karianne", "task": "reiciendis est magnam amet nemo iste recusandae impedit quaerat", "completed": false}, {"username": "Karianne", "task": "eum ipsa maxime ut", "completed": true}, {"username": "Karianne", "task": "tempore molestias dolores rerum sequi voluptates ipsum consequatur", "completed": true}], "5": [{"username": "Kamren", "task": "suscipit qui totam", "completed": true}, {"username": "Kamren", "task": "voluptates eum voluptas et dicta", "completed": false}, {"username": "Kamren", "task": "quidem at rerum quis ex aut sit quam", "completed": true}, {"username": "Kamren", "task": "sunt veritatis ut voluptate", "completed": false}, {"username": "Kamren", "task": "et quia ad iste a", "completed": true}, {"username": "Kamren", "task": "incidunt ut saepe autem", "completed": true}, {"username": "Kamren", "task": "laudantium quae eligendi consequatur quia et vero autem", "completed": true}, {"username": "Kamren", "task": "vitae aut excepturi laboriosam sint aliquam et et accusantium", "completed": false}, {"username": "Kamren", "task": "sequi ut omnis et", "completed": true}, {"username": "Kamren", "task": "molestiae nisi accusantium tenetur dolorem et", "completed": true}, {"username": "Kamren", "task": "nulla quis consequatur saepe qui id expedita", "completed": true}, {"username": "Kamren", "task": "in omnis laboriosam", "completed": true}, {"username": "Kamren", "task": "odio iure consequatur molestiae quibusdam necessitatibus quia sint", "completed": true}, {"username": "Kamren", "task": "facilis modi saepe mollitia", "completed": false}, {"username": "Kamren", "task": "vel nihil et molestiae iusto assumenda nemo quo ut", "completed": true}, {"username": "Kamren", "task": "nobis suscipit ducimus enim asperiores voluptas", "completed": false}, {"username": "Kamren", "task": "dolorum laboriosam eos qui iure aliquam", "completed": false}, {"username": "Kamren", "task": "debitis accusantium ut quo facilis nihil quis sapiente necessitatibus", "completed": true}, {"username": "Kamren", "task": "neque voluptates ratione", "completed": false}, {"username": "Kamren", "task": "excepturi a et neque qui expedita vel voluptate", "completed": false}], "6": [{"username": "Leopoldo_Corkery", "task": "explicabo enim cumque porro aperiam occaecati minima", "completed": false}, {"username": "Leopoldo_Corkery", "task": "sed ab consequatur", "completed": false}, {"username": "Leopoldo_Corkery", "task": "non sunt delectus illo nulla tenetur enim omnis", "completed": false}, {"username": "Leopoldo_Corkery", "task": "excepturi non laudantium quo", "completed": false}, {"username": "Leopoldo_Corkery", "task": "totam quia dolorem et illum repellat voluptas optio", "completed": true}, {"username": "Leopoldo_Corkery", "task": "ad illo quis voluptatem temporibus", "completed": true}, {"username": "Leopoldo_Corkery", "task": "praesentium facilis omnis laudantium fugit ad iusto nihil nesciunt", "completed": false}, {"username": "Leopoldo_Corkery", "task": "a eos eaque nihil et exercitationem incidunt delectus", "completed": true}, {"username": "Leopoldo_Corkery", "task": "autem temporibus harum quisquam in culpa", "completed": true}, {"username": "Leopoldo_Corkery", "task": "aut aut ea corporis", "completed": true}, {"username": "Leopoldo_Corkery", "task": "magni accusantium labore et id quis provident", "completed": false}, {"username": "Leopoldo_Corkery", "task": "consectetur impedit quisquam qui deserunt non rerum consequuntur eius", "completed": false}, {"username": "Leopoldo_Corkery", "task": "quia atque aliquam sunt impedit voluptatum rerum assumenda nisi", "completed": false}, {"username": "Leopoldo_Corkery", "task": "cupiditate quos possimus corporis quisquam exercitationem beatae", "completed": false}, {"username": "Leopoldo_Corkery", "task": "sed et ea eum", "completed": false}, {"username": "Leopoldo_Corkery", "task": "ipsa dolores vel facilis ut", "completed": true}, {"username": "Leopoldo_Corkery", "task": "sequi quae est et qui qui eveniet asperiores", "completed": false}, {"username": "Leopoldo_Corkery", "task": "quia modi consequatur vero fugiat", "completed": false}, {"username": "Leopoldo_Corkery", "task": "corporis ducimus ea perspiciatis iste", "completed": false}, {"username": "Leopoldo_Corkery", "task": "dolorem laboriosam vel voluptas et aliquam quasi", "completed": false}], "7": [{"username": "Elwyn.Skiles", "task": "inventore aut nihil minima laudantium hic qui omnis", "completed": true}, {"username": "Elwyn.Skiles", "task": "provident aut nobis culpa", "completed": true}, {"username": "Elwyn.Skiles", "task": "esse et quis iste est earum aut impedit", "completed": false}, {"username": "Elwyn.Skiles", "task": "qui consectetur id", "completed": false}, {"username": "Elwyn.Skiles", "task": "aut quasi autem iste tempore illum possimus", "completed": false}, {"username": "Elwyn.Skiles", "task": "ut asperiores perspiciatis veniam ipsum rerum saepe", "completed": true}, {"username": "Elwyn.Skiles", "task": "voluptatem libero consectetur rerum ut", "completed": true}, {"username": "Elwyn.Skiles", "task": "eius omnis est qui voluptatem autem", "completed": false}, {"username": "Elwyn.Skiles", "task": "rerum culpa quis harum", "completed": false}, {"username": "Elwyn.Skiles", "task": "nulla aliquid eveniet harum laborum libero alias ut unde", "completed": true}, {"username": "Elwyn.Skiles", "task": "qui ea incidunt quis", "completed": false}, {"username": "Elwyn.Skiles", "task": "qui molestiae voluptatibus velit iure harum quisquam", "completed": true}, {"username": "Elwyn.Skiles", "task": "et labore eos enim rerum consequatur sunt", "completed": true}, {"username": "Elwyn.Skiles", "task": "molestiae doloribus et laborum quod ea", "completed": false}, {"username": "Elwyn.Skiles", "task": "facere ipsa nam eum voluptates reiciendis vero qui", "completed": false}, {"username": "Elwyn.Skiles", "task": "asperiores illo tempora fuga sed ut quasi adipisci", "completed": false}, {"username": "Elwyn.Skiles", "task": "qui sit non", "completed": false}, {"username": "Elwyn.Skiles", "task": "placeat minima consequatur rem qui ut", "completed": true}, {"username": "Elwyn.Skiles", "task": "consequatur doloribus id possimus voluptas a voluptatem", "completed": false}, {"username": "Elwyn.Skiles", "task": "aut consectetur in blanditiis deserunt quia sed laboriosam", "completed": true}], "8": [{"username": "Maxime_Nienow", "task": "explicabo consectetur debitis voluptates quas quae culpa rerum non", "completed": true}, {"username": "Maxime_Nienow", "task": "maiores accusantium architecto necessitatibus reiciendis ea aut", "completed": true}, {"username": "Maxime_Nienow", "task": "eum non recusandae cupiditate animi", "completed": false}, {"username": "Maxime_Nienow", "task": "ut eum exercitationem sint", "completed": false}, {"username": "Maxime_Nienow", "task": "beatae qui ullam incidunt voluptatem non nisi aliquam", "completed": false}, {"username": "Maxime_Nienow", "task": "molestiae suscipit ratione nihil odio libero impedit vero totam", "completed": true}, {"username": "Maxime_Nienow", "task": "eum itaque quod reprehenderit et facilis dolor autem ut", "completed": true}, {"username": "Maxime_Nienow", "task": "esse quas et quo quasi exercitationem", "completed": false}, {"username": "Maxime_Nienow", "task": "animi voluptas quod perferendis est", "completed": false}, {"username": "Maxime_Nienow", "task": "eos amet tempore laudantium fugit a", "completed": false}, {"username": "Maxime_Nienow", "task": "accusamus adipisci dicta qui quo ea explicabo sed vero", "completed": true}, {"username": "Maxime_Nienow", "task": "odit eligendi recusandae doloremque cumque non", "completed": false}, {"username": "Maxime_Nienow", "task": "ea aperiam consequatur qui repellat eos", "completed": false}, {"username": "Maxime_Nienow", "task": "rerum non ex sapiente", "completed": true}, {"username": "Maxime_Nienow", "task": "voluptatem nobis consequatur et assumenda magnam", "completed": true}, {"username": "Maxime_Nienow", "task": "nam quia quia nulla repellat assumenda quibusdam sit nobis", "completed": true}, {"username": "Maxime_Nienow", "task": "dolorem veniam quisquam deserunt repellendus", "completed": true}, {"username": "Maxime_Nienow", "task": "debitis vitae delectus et harum accusamus aut deleniti a", "completed": true}, {"username": "Maxime_Nienow", "task": "debitis adipisci quibusdam aliquam sed dolore ea praesentium nobis", "completed": true}, {"username": "Maxime_Nienow", "task": "et praesentium aliquam est", "completed": false}], "9": [{"username": "Delphine", "task": "ex hic consequuntur earum omnis alias ut occaecati culpa", "completed": true}, {"username": "Delphine", "task": "omnis laboriosam molestias animi sunt dolore", "completed": true}, {"username": "Delphine", "task": "natus corrupti maxime laudantium et voluptatem laboriosam odit", "completed": false}, {"username": "Delphine", "task": "reprehenderit quos aut aut consequatur est sed", "completed": false}, {"username": "Delphine", "task": "fugiat perferendis sed aut quidem", "completed": false}, {"username": "Delphine", "task": "quos quo possimus suscipit minima ut", "completed": false}, {"username": "Delphine", "task": "et quis minus quo a asperiores molestiae", "completed": false}, {"username": "Delphine", "task": "recusandae quia qui sunt libero", "completed": false}, {"username": "Delphine", "task": "ea odio perferendis officiis", "completed": true}, {"username": "Delphine", "task": "quisquam aliquam quia doloribus aut", "completed": false}, {"username": "Delphine", "task": "fugiat aut voluptatibus corrupti deleniti velit iste odio", "completed": true}, {"username": "Delphine", "task": "et provident amet rerum consectetur et voluptatum", "completed": false}, {"username": "Delphine", "task": "harum ad aperiam quis", "completed": false}, {"username": "Delphine", "task": "similique aut quo", "completed": false}, {"username": "Delphine", "task": "laudantium eius officia perferendis provident perspiciatis asperiores", "completed": true}, {"username": "Delphine", "task": "magni soluta corrupti ut maiores rem quidem", "completed": false}, {"username": "Delphine", "task": "et placeat temporibus voluptas est tempora quos quibusdam", "completed": false}, {"username": "Delphine", "task": "nesciunt itaque commodi tempore", "completed": true}, {"username": "Delphine", "task": "omnis consequuntur cupiditate impedit itaque ipsam quo", "completed": true}, {"username": "Delphine", "task": "debitis nisi et dolorem repellat et", "completed": true}], "10": [{"username": "Moriah.Stanton", "task": "ut cupiditate sequi aliquam fuga maiores", "completed": false}, {"username": "Moriah.Stanton", "task": "inventore saepe cumque et aut illum enim", "completed": true}, {"username": "Moriah.Stanton", "task": "omnis nulla eum aliquam distinctio", "completed": true}, {"username": "Moriah.Stanton", "task": "molestias modi perferendis perspiciatis", "completed": false}, {"username": "Moriah.Stanton", "task": "voluptates dignissimos sed doloribus animi quaerat aut", "completed": false}, {"username": "Moriah.Stanton", "task": "explicabo odio est et", "completed": false}, {"username": "Moriah.Stanton", "task": "consequuntur animi possimus", "completed": false}, {"username": "Moriah.Stanton", "task": "vel non beatae est", "completed": true}, {"username": "Moriah.Stanton", "task": "culpa eius et voluptatem et", "completed": true}, {"username": "Moriah.Stanton", "task": "accusamus sint iusto et voluptatem exercitationem", "completed": true}, {"username": "Moriah.Stanton", "task": "temporibus atque distinctio omnis eius impedit tempore molestias pariatur", "completed": true}, {"username": "Moriah.Stanton", "task": "ut quas possimus exercitationem sint voluptates", "completed": false}, {"username": "Moriah.Stanton", "task": "rerum debitis voluptatem qui eveniet tempora distinctio a", "completed": true}, {"username": "Moriah.Stanton", "task": "sed ut vero sit molestiae", "completed": false}, {"username": "Moriah.Stanton", "task": "rerum ex veniam mollitia voluptatibus pariatur", "completed": true}, {"username": "Moriah.Stanton", "task": "consequuntur aut ut fugit similique", "completed": true}, {"username": "Moriah.Stanton", "task": "dignissimos quo nobis earum saepe", "completed": true}, {"username": "Moriah.Stanton", "task": "quis eius est sint explicabo", "completed": true}, {"username": "Moriah.Stanton", "task": "numquam repellendus a magnam", "completed": true}, {"username": "Moriah.Stanton", "task": "ipsam aperiam voluptates qui", "completed": false}]} -------------------------------------------------------------------------------- /0x16-api_advanced/0-subs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | """ 3 | Function that queries the Reddit API and returns 4 | the number of subscribers for a given subreddit. 5 | """ 6 | import requests 7 | import sys 8 | 9 | 10 | def number_of_subscribers(subreddit): 11 | """ Queries to Reddit API """ 12 | u_agent = 'Mozilla/5.0' 13 | 14 | headers = { 15 | 'User-Agent': u_agent 16 | } 17 | 18 | url = "https://www.reddit.com/r/{}/about.json".format(subreddit) 19 | res = requests.get(url, headers=headers, allow_redirects=False) 20 | if res.status_code != 200: 21 | return 0 22 | dic = res.json() 23 | if 'data' not in dic: 24 | return 0 25 | if 'subscribers' not in dic.get('data'): 26 | return 0 27 | return res.json()['data']['subscribers'] 28 | -------------------------------------------------------------------------------- /0x16-api_advanced/1-top_ten.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | """ 3 | Function that queries the Reddit API and prints 4 | the top ten hot posts of a subreddit 5 | """ 6 | import requests 7 | import sys 8 | 9 | 10 | def top_ten(subreddit): 11 | """ Queries to Reddit API """ 12 | u_agent = 'Mozilla/5.0' 13 | 14 | headers = { 15 | 'User-Agent': u_agent 16 | } 17 | 18 | params = { 19 | 'limit': 10 20 | } 21 | 22 | url = "https://www.reddit.com/r/{}/hot.json".format(subreddit) 23 | res = requests.get(url, 24 | headers=headers, 25 | params=params, 26 | allow_redirects=False) 27 | if res.status_code != 200: 28 | print(None) 29 | return 30 | dic = res.json() 31 | hot_posts = dic['data']['children'] 32 | if len(hot_posts) is 0: 33 | print(None) 34 | else: 35 | for post in hot_posts: 36 | print(post['data']['title']) 37 | -------------------------------------------------------------------------------- /0x16-api_advanced/100-count.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | '''A module containing functions for working with the Reddit API. 3 | ''' 4 | import requests 5 | 6 | 7 | def sort_histogram(histogram={}): 8 | '''Sorts and prints the given histogram. 9 | ''' 10 | histogram = list(filter(lambda kv: kv[1], histogram)) 11 | histogram_dict = {} 12 | for item in histogram: 13 | if item[0] in histogram_dict: 14 | histogram_dict[item[0]] += item[1] 15 | else: 16 | histogram_dict[item[0]] = item[1] 17 | histogram = list(histogram_dict.items()) 18 | histogram.sort( 19 | key=lambda kv: kv[0], 20 | reverse=False 21 | ) 22 | histogram.sort( 23 | key=lambda kv: kv[1], 24 | reverse=True 25 | ) 26 | res_str = '\n'.join(list(map( 27 | lambda kv: '{}: {}'.format(kv[0], kv[1]), 28 | histogram 29 | ))) 30 | if res_str: 31 | print(res_str) 32 | 33 | 34 | def count_words(subreddit, word_list, histogram=[], n=0, after=None): 35 | '''Counts the number of times each word in a given wordlist 36 | occurs in a given subreddit. 37 | ''' 38 | api_headers = { 39 | 'Accept': 'application/json', 40 | 'User-Agent': ' '.join([ 41 | 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', 42 | 'AppleWebKit/537.36 (KHTML, like Gecko)', 43 | 'Chrome/97.0.4692.71', 44 | 'Safari/537.36', 45 | 'Edg/97.0.1072.62' 46 | ]) 47 | } 48 | sort = 'hot' 49 | limit = 30 50 | res = requests.get( 51 | '{}/r/{}/.json?sort={}&limit={}&count={}&after={}'.format( 52 | 'https://www.reddit.com', 53 | subreddit, 54 | sort, 55 | limit, 56 | n, 57 | after if after else '' 58 | ), 59 | headers=api_headers, 60 | allow_redirects=False 61 | ) 62 | if not histogram: 63 | word_list = list(map(lambda word: word.lower(), word_list)) 64 | histogram = list(map(lambda word: (word, 0), word_list)) 65 | if res.status_code == 200: 66 | data = res.json()['data'] 67 | posts = data['children'] 68 | titles = list(map(lambda post: post['data']['title'], posts)) 69 | histogram = list(map( 70 | lambda kv: (kv[0], kv[1] + sum(list(map( 71 | lambda txt: txt.lower().split().count(kv[0]), 72 | titles 73 | )))), 74 | histogram 75 | )) 76 | if len(posts) >= limit and data['after']: 77 | count_words( 78 | subreddit, 79 | word_list, 80 | histogram, 81 | n + len(posts), 82 | data['after'] 83 | ) 84 | else: 85 | sort_histogram(histogram) 86 | else: 87 | return 88 | -------------------------------------------------------------------------------- /0x16-api_advanced/2-recurse.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | """ 3 | Function that queries the Reddit API and prints 4 | the top ten hot posts of a subreddit 5 | """ 6 | import requests 7 | import sys 8 | 9 | 10 | def add_title(hot_list, hot_posts): 11 | """ Adds item into a list """ 12 | if len(hot_posts) == 0: 13 | return 14 | hot_list.append(hot_posts[0]['data']['title']) 15 | hot_posts.pop(0) 16 | add_title(hot_list, hot_posts) 17 | 18 | 19 | def recurse(subreddit, hot_list=[], after=None): 20 | """ Queries to Reddit API """ 21 | u_agent = 'Mozilla/5.0' 22 | headers = { 23 | 'User-Agent': u_agent 24 | } 25 | 26 | params = { 27 | 'after': after 28 | } 29 | 30 | url = "https://www.reddit.com/r/{}/hot.json".format(subreddit) 31 | res = requests.get(url, 32 | headers=headers, 33 | params=params, 34 | allow_redirects=False) 35 | 36 | if res.status_code != 200: 37 | return None 38 | 39 | dic = res.json() 40 | hot_posts = dic['data']['children'] 41 | add_title(hot_list, hot_posts) 42 | after = dic['data']['after'] 43 | if not after: 44 | return hot_list 45 | return recurse(subreddit, hot_list=hot_list, after=after) 46 | -------------------------------------------------------------------------------- /0x16-api_advanced/README.md: -------------------------------------------------------------------------------- 1 | # API advanced -------------------------------------------------------------------------------- /0x17-web_stack_debugging_3/0-strace_is_your_friend.pp: -------------------------------------------------------------------------------- 1 | # Apache returns 500; use this script to fix typo in config 2 | 3 | exec { 'fix config typo': 4 | command => "sed -i 's/.phpp/.php/' /var/www/html/wp-settings.php", 5 | path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 6 | } 7 | -------------------------------------------------------------------------------- /0x17-web_stack_debugging_3/README.md: -------------------------------------------------------------------------------- 1 | 0x17. Web stack debugging #3 2 | -------------------------------------------------------------------------------- /0x18-webstack_monitoring/2-setup_datadog: -------------------------------------------------------------------------------- 1 | 1675380949761 2 | -------------------------------------------------------------------------------- /0x18-webstack_monitoring/README.md: -------------------------------------------------------------------------------- 1 | # Webstack monitoring -------------------------------------------------------------------------------- /0x19-postmortem/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # BooktifuL requests failure report 4 | Last week, it was reported that the BooktifuL platform was returning 500 Error on all requests made on the platform routes, all the services were down. 90% of the users were affected. The root cause was the failure of our master server web-01. 5 | 6 | ## Timeline 7 | The error was realized on Saturday 26th February 1200 hours (East Africa Time) when our Site Reliability Engineer, Mr Elie saw the master server lagging in speed. Our engineers on call disconnected the master server web-01 for further system analysis and channelled all requests to client server web-02. They soled problem by Sunday 27th Febraury 2200 hours (East Africa Time). 8 | 9 | ## Root cause and resolution 10 | The BooktifuL platform is served by 2 ubuntu cloud servers. The master server web-01 was connected to serve all requests, and it stopped functioning due to memory outage as a results of so many requests because during a previous test, the client server web-02 was disconnected temporarily for testing and was not connected to the load balancer afterwards. 11 | 12 | 13 | The issue was fixed when the master server was temporarily disconnected for memory clean-up then connected back to the loadbalancer and round-robin algorithm was configured so that both the master and client servers can handle equal amount of requests. 14 | 15 | ## Measures against such problem in future 16 | - Choose the best loadbalancing algorithm for your programs 17 | - Always keep an eye on your servers to ensure they are running properly 18 | - Have extra back-up servers to prevent your program fro completely going offline during an issue 19 | -------------------------------------------------------------------------------- /0x19-postmortem/about.md: -------------------------------------------------------------------------------- 1 | # 0x19. Postmortem 2 | This project is a sweet one. 3 | 4 | 5 | Any software system will eventually fail, and that failure can come stem from a wide range of possible factors: bugs, traffic spikes, security issues, hardware failures, natural disasters, human error… Failing is normal and failing is actually a great opportunity to learn and improve. Any great Software Engineer must learn from his/her mistakes to make sure that they won’t happen again. Failing is fine, but failing twice because of the same issue is not. 6 | 7 | 8 | A postmortem is a tool widely used in the tech industry. After any outage, the team(s) in charge of the system will write a summary that has 2 main goals: 9 | 10 | 11 | - To provide the rest of the company’s employees easy access to information detailing the cause of the outage. Often outages can have a huge impact on a company, so managers and executives have to understand what happened and how it will impact their work. 12 | - And to ensure that the root cause(s) of the outage has been discovered and that measures are taken to make sure it will be fixed. 13 | 14 | 15 | Using one of the web stack debugging project issue I have previously done or an outage I have personally faced, I am required to write a postmortem. 16 | 17 | ## Requirements: 18 | 19 | - Issue Summary (that is often what executives will read) must contain: 20 | - duration of the outage with start and end times (including timezone) 21 | - what was the impact (what service was down/slow? What were user experiencing? How many % of the users were affected?) 22 | - what was the root cause 23 | 24 | - Timeline (format bullet point, format: time - keep it short, 1 or 2 sentences) must contain: 25 | - when was the issue detected 26 | - how was the issue detected (monitoring alert, an engineer noticed something, a customer complained…) 27 | - actions taken (what parts of the system were investigated, what were the assumption on the root cause of the issue) 28 | - misleading investigation/debugging paths that were taken 29 | - which team/individuals was the incident escalated to 30 | - how the incident was resolved 31 | 32 | - Root cause and resolution must contain: 33 | - explain in detail what was causing the issue 34 | - explain in detail how the issue was fixed 35 | 36 | - Corrective and preventative measures must contain: 37 | - what are the things that can be improved/fixed (broadly speaking) 38 | - a list of tasks to address the issue (be very specific, like a TODO, example: patch Nginx server, add monitoring on server memory…) 39 | - Be brief and straight to the point, between 400 to 600 words 40 | 41 | ## Resources 42 | [Apiumhub](https://apiumhub.com/tech-blog-barcelona/software-development-project-postmortem/) -------------------------------------------------------------------------------- /0x19-postmortem/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tecnophille/alx-system_engineering-devops/374596ec9f74abbb1ee4dd338977228131f153e1/0x19-postmortem/image.png -------------------------------------------------------------------------------- /0x1A-application_server/README.md: -------------------------------------------------------------------------------- 1 | 0x1A-application_server 2 | -------------------------------------------------------------------------------- /0x1B-web_stack_debugging_4/0-the_sky_is_the_limit_not.pp: -------------------------------------------------------------------------------- 1 | # Fix problem of high amount of requests 2 | 3 | exec {'replace': 4 | provider => shell, 5 | command => 'sudo sed -i "s/ULIMIT=\"-n 15\"/ULIMIT=\"-n 4096\"/" /etc/default/nginx', 6 | before => Exec['restart'], 7 | } 8 | 9 | exec {'restart': 10 | provider => shell, 11 | command => 'sudo service nginx restart', 12 | } -------------------------------------------------------------------------------- /0x1B-web_stack_debugging_4/1-user_limit.pp: -------------------------------------------------------------------------------- 1 | # Fix problem of high amount files opened 2 | 3 | exec {'replace-1': 4 | provider => shell, 5 | command => 'sudo sed -i "s/nofile 5/nofile 50000/" /etc/security/limits.conf', 6 | before => Exec['replace-2'], 7 | } 8 | 9 | exec {'replace-2': 10 | provider => shell, 11 | command => 'sudo sed -i "s/nofile 4/nofile 40000/" /etc/security/limits.conf', 12 | } -------------------------------------------------------------------------------- /0x1B-web_stack_debugging_4/README.md: -------------------------------------------------------------------------------- 1 | # Web stack debugging 4 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # System engineering & Devops 2 | 3 | Module of **System engineering** and **Devops**, carried out during **Software Engineering** at **[ALX](https://alx-intranet.hbtn.io/)**. 4 | 5 | ## Technologies 6 | * Scripts written in Bash 7 | * Tested on Ubuntu 20.04 LTS 8 | 9 | ## Projects 10 | All of the following folders are projects done during the studies: 11 | 12 | | Project name | Description | 13 | | ------------ | ----------- | 14 | | [`0x00-shell_basics`](https://github.com/tecnophille/alx-system_engineering-devops/tree/master/0x00-shell_basics) | It aims to learn about basics commands, navigation, files and directories in **Shell** | 15 | | [`0x01-shell_permissions`](https://github.com/tecnophille/alx-system_engineering-devops/tree/master/0x01-shell_permissions) | It aims to learn about man pages, permissions (owner, group and other) of files and directories in **Shell** | 16 | | [`0x02-shell_redirections`](https://github.com/tecnophille/alx-system_engineering-devops/tree/master/0x02-shell_redirections) | It aims to learn about how to handle standard input and output and how to combine commands and filters with redirections in **Shell** | 17 | | [`0x03-shell_variable_expansions`](https://github.com/tecnophille/alx-system_engineering-devops/tree/master/0x03-shell_variables_expansions) | It aims to learn about alias builtin, help builtin, local, global and reserved variables (PATH, HOME and PS1), special parameters `$?` and single an double quotes in **Shell** | 18 | | [`0x04-loops_conditions_and_parsing`](https://github.com/tecnophille/alx-system_engineering-devops/tree/master/0x04-loops_conditions_and_parsing) | It aims to learn about loops (`while`, `until` and `for`), condition statements (`if`, `else`, `elif` and `case`), shebangs and how to create SSH keys with **Bash** | 19 | | [`0x05-processes_and_signals`](https://github.com/tecnophille/alx-system_engineering-devops/tree/master/0x05-processes_and_signals) | It aims to learn about PID, processes and commands that handles them (`ps`, `pgrep`, `pkill`, `kill`, etc) in **Bash** | 20 | | [`0x06-regular_expressions`](https://github.com/tenophille/alx-system_engineering-devops/tree/master/0x06-regular_expressions) | It aims to learn about how to build a regular expression | 21 | | [`0x07-networking_basics`](https://github.com/Tecnophille/alx-system_engineering-devops/tree/master/0x07-networking_basics) | It aims to learn about what is an OSI model, LAN, WAN, IP address, localhost, subnet and TCP/UDP | 22 | -------------------------------------------------------------------------------- /attack_is_the_best_defense/0-sniffing: -------------------------------------------------------------------------------- 1 | mypassword9898! 2 | -------------------------------------------------------------------------------- /attack_is_the_best_defense/1-dictionary_attack: -------------------------------------------------------------------------------- 1 | password123 2 | -------------------------------------------------------------------------------- /attack_is_the_best_defense/README.md: -------------------------------------------------------------------------------- 1 | # attack_is_the_best_defense 2 | -------------------------------------------------------------------------------- /command_line_for_the_win/0-first_9_tasks.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tecnophille/alx-system_engineering-devops/374596ec9f74abbb1ee4dd338977228131f153e1/command_line_for_the_win/0-first_9_tasks.jpg -------------------------------------------------------------------------------- /command_line_for_the_win/0-first_9_tasks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tecnophille/alx-system_engineering-devops/374596ec9f74abbb1ee4dd338977228131f153e1/command_line_for_the_win/0-first_9_tasks.png -------------------------------------------------------------------------------- /command_line_for_the_win/1-next-9-tasks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tecnophille/alx-system_engineering-devops/374596ec9f74abbb1ee4dd338977228131f153e1/command_line_for_the_win/1-next-9-tasks.png -------------------------------------------------------------------------------- /command_line_for_the_win/1-next_9_tasks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tecnophille/alx-system_engineering-devops/374596ec9f74abbb1ee4dd338977228131f153e1/command_line_for_the_win/1-next_9_tasks.png -------------------------------------------------------------------------------- /command_line_for_the_win/2-last-9-tasks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tecnophille/alx-system_engineering-devops/374596ec9f74abbb1ee4dd338977228131f153e1/command_line_for_the_win/2-last-9-tasks.png -------------------------------------------------------------------------------- /command_line_for_the_win/2-next_9_tasks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tecnophille/alx-system_engineering-devops/374596ec9f74abbb1ee4dd338977228131f153e1/command_line_for_the_win/2-next_9_tasks.png -------------------------------------------------------------------------------- /command_line_for_the_win/README.md: -------------------------------------------------------------------------------- 1 | ## Background Context 2 | 3 | CMD CHALLENGE is a pretty cool game challenging you on Bash skills. Everything is done via the command line and the questions are becoming increasingly complicated. It’s a good training to improve your command line skills! 4 | --------------------------------------------------------------------------------