├── 0x00-shell_basics ├── 0-current_working_directory ├── 1-listit ├── 10-back ├── 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 ├── holberton.mgc └── school.mgc ├── 0x01-shell_permissions ├── 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 ├── .2-hellofile.swp ├── .4-lastlines.swp ├── 0-hello_world ├── 1-confused_smiley ├── 10-no_more_js ├── 100-empty_casks ├── 101-gifs ├── 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 ├── 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 ├── 1-for_best_school ├── 10-fizzbuzz ├── 100-read_and_cut ├── 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 ├── 0x05-processes_and_signals ├── 0-what-is-my-pid ├── 1-list_your_processes ├── 100-process_and_pid_file ├── 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 ├── 0x06-regular_expressions ├── 0-simply_match_school.rb ├── 1-repetition_token_0.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 ├── 0-localhost ├── 1-show_attached_IPs ├── 1-wildcard ├── 100-port_listening_on_localhost └── README.md ├── 0x0A-configuration_management ├── 0-create_a_file.pp ├── 1-install_a_package.pp ├── 2-execute_a_command.pp └── README.md └── README.md /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_move: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | mv [[:upper:]]* /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 -p welcome/to/school 3 | -------------------------------------------------------------------------------- /0x00-shell_basics/103-commas: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ls -pamv 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 -al 3 | -------------------------------------------------------------------------------- /0x00-shell_basics/5-listfilesdigitonly: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ls -an 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 /tmp/my_first_directory/betty 3 | -------------------------------------------------------------------------------- /0x00-shell_basics/9-firstdirdeletion: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rmdir /tmp/my_first_directory 3 | -------------------------------------------------------------------------------- /0x00-shell_basics/README.md: -------------------------------------------------------------------------------- 1 | Diving into shell commands 2 | -------------------------------------------------------------------------------- /0x00-shell_basics/holberton.mgc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmoseka/system_engineering-devops/cc87107613a3f8808324b06667c1e78d19cc2923/0x00-shell_basics/holberton.mgc -------------------------------------------------------------------------------- /0x00-shell_basics/school.mgc: -------------------------------------------------------------------------------- 1 | 0 search File containing "SCHOOL" 2 | -------------------------------------------------------------------------------- /0x01-shell_permissions/0-iam_betty: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | su betty 3 | -------------------------------------------------------------------------------- /0x01-shell_permissions/1-who_am_i: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | whoami 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 ugo+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 ugo+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 | shell permission commands 2 | -------------------------------------------------------------------------------- /0x02-shell_redirections/.2-hellofile.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmoseka/system_engineering-devops/cc87107613a3f8808324b06667c1e78d19cc2923/0x02-shell_redirections/.2-hellofile.swp -------------------------------------------------------------------------------- /0x02-shell_redirections/.4-lastlines.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmoseka/system_engineering-devops/cc87107613a3f8808324b06667c1e78d19cc2923/0x02-shell_redirections/.4-lastlines.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 -printf %f'\n' 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/101-gifs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | find . -type f -name \*.gif -printf "%f\n" | LC_ALL=C sort -f | rev | cut -b 5- | rev 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/11-directories: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | find . -type d -path './*' -print | wc -l 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/12-newest_files: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ls -t | head 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 "bin" /etc/passwd 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/16-whatsnext: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | grep -iA 3 "root" /etc/passwd 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/17-hidethisword: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | grep -v "bin" /etc/passwd 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/18-letteronly: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | grep '^[A-Za-z]' /etc/ssh/sshd_config 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/19-AZ: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | tr Ac Ze 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':' -f1,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 /etc/passwd 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/5-firstlines: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | head -10 /etc/passwd 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/6-third_line: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | head --lines=3 iacta | tail --lines=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 --lines=1 iacta >> iacta 3 | -------------------------------------------------------------------------------- /0x02-shell_redirections/README.md: -------------------------------------------------------------------------------- 1 | Shell I/0 redirections 2 | -------------------------------------------------------------------------------- /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 'A-Za-z' 'N-ZA-Mn-za-m' 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/102-odd: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cat -n | cut -b 6- | grep ^[13579] | cut -f2 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/103-water_and_stir: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | printf '%o\n' $(( 5#$( echo $WATER | tr water 01234) + 5#$( echo $STIR | tr stir. 01234 ) )) | tr 01234567 behlnort 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 | printf %s'\n' {a..z}{a..z} | grep -v "oo" 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/13-print_float: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | printf %0.2f'\n' $NUM 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/2-path: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | PATH=$PATH:/action 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/3-paths: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo $PATH |tr -s ':' '\n' | wc -l 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 | BETTY="Holberton" 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/7-create_global_variable: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export HOLBERTON="Betty" 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/8-true_knowledge: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo $((128+TRUEKNOWLEDGE)) 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/9-divide_and_rule: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo $((POWER/DIVIDE)) 3 | -------------------------------------------------------------------------------- /0x03-shell_variables_expansions/README.md: -------------------------------------------------------------------------------- 1 | Shell, init files, variables and expansions 2 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/0-RSA_public_key.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCrpnDhH/dblOUpB/f3lpWkCPtCXRAF04QM5UUdgybbdSrbgXw8JlCM85tshTEoPA2/3xAlE1a36ECgL5U4YXEqySg5tjH9GdOmz7w0HvbNOJy9E4D3godIzXBaM69rs+Sms9ok028SO3qPMv/ubxbBk8PsO9Ko4d+dNhHdVP6SC2W7LCNDLnKWRozpcqxf7EKDspw/GAnX8ZpSeZiD3ZLcmfgvXYNxx+4goY1wopoRLOaVVGPYw8/7K1yzfh3kHOPaONLxmpK6a5yI4Nr/nJZefW+rrleyYO//xmjM0C9r+NHOMvOspeWfgtkmfm/J5FDV4+9fyXh4tjWEcjvFBf0F vagrant@vagrant-ubuntu-trusty-64 -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/1-for_best_school: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # This Bash script displays Best School 10 times 3 | for ((i = 0; i < 10; i++)) 4 | do 5 | echo "Best School" 6 | done -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/10-fizzbuzz: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #Display a FizzBuzz 3 | for ((i = 1; i<= 100; i++)) 4 | do 5 | if ((i % 3 == 0)) && ((i % 5 == 0)) 6 | then 7 | echo "FizzBuzz" 8 | elif ((i % 3 == 0)) 9 | then 10 | echo "Fizz" 11 | elif ((i % 5 == 0)) 12 | then 13 | echo "Buzz" 14 | else 15 | echo $i 16 | fi 17 | done 18 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/100-read_and_cut: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #displays the content of the file /etc/passwd 3 | while read line 4 | do 5 | echo "$line" | cut -d ':' -f1,3,6 6 | done < /etc/passwd 7 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/2-while_best_school: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # A Bash script that displays Holberton School 10 times. 3 | i=0 4 | while ((i < 10)) 5 | do 6 | echo "Best School" 7 | ((i++)) 8 | done 9 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/3-until_best_school: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # a Bash script that displays Best School 10 times 3 | i=1 4 | until [ $i -gt 10 ] 5 | do 6 | echo "Best School" 7 | ((i++)) 8 | done 9 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/4-if_9_say_hi: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #A Bash script that displays Holberton School 10 times and hi 3 | i=0 4 | while [ $i -lt 10 ] 5 | do 6 | ((i++)) 7 | echo "Best School" 8 | if [ $i == 9 ]; then 9 | echo "Hi" 10 | 11 | done 12 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/5-4_bad_luck_8_is_your_chance: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #A Bash script that displays a strings using a while loop and if statemant 3 | i=0 4 | while [ $i -lt 10 ] 5 | do 6 | ((i++)) 7 | if [ $i == 4 ]; then 8 | echo "bad luck" 9 | elif [ $i == 8 ]; then 10 | echo "good luck" 11 | else 12 | echo "Best School" 13 | fi 14 | done 15 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/6-superstitious_numbers: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #A Bash script that displays numbers from 1 to 20 3 | i=1 4 | while ((i <= 20)) 5 | do 6 | echo $i 7 | case $i in 8 | 4) 9 | echo "bad luck from China" ;; 10 | 9) 11 | echo "bad luck from Japan" ;; 12 | 17) 13 | echo "bad luck from Italy" ;; 14 | esac 15 | ((i++)) 16 | done 17 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/7-clock: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #displays the time for 12 hours and 59 minutes 3 | hour=0 4 | while ((hour < 13)) 5 | do 6 | echo "Hour: $hour" 7 | min=1 8 | while ((min < 60)) 9 | do 10 | echo $min 11 | ((min++)) 12 | done 13 | ((hour++)) 14 | done 15 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/8-for_ls: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #This script display the content of the current directory 3 | for ls in * 4 | do 5 | echo "$ls" | cut -d '-' -f2 6 | done 7 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/9-to_file_or_not_to_file: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #Script that give us information about the holbertonschool file 3 | FILE=holbertonschool 4 | if [ -e $FILE ] 5 | then 6 | echo "$FILE file exists" 7 | if [ -s $FILE ] 8 | then 9 | echo "$FILE file is not empty" 10 | else 11 | echo "$FILE file is empty" 12 | fi 13 | if [ -f $FILE ] 14 | then 15 | echo "$FILE is a regular file" 16 | fi 17 | else 18 | echo "$FILE file does not exist" 19 | fi 20 | -------------------------------------------------------------------------------- /0x04-loops_conditions_and_parsing/README.md: -------------------------------------------------------------------------------- 1 | # 0x04. Loops, conditions and parsing 2 | 3 | ## Resources:books: 4 | Read or watch: 5 | * [Loops sample](https://intranet.hbtn.io/rltoken/fRCmr2B_Ne-rQdFZdfUDcA) 6 | * [Variable assignment and arithmetic](https://intranet.hbtn.io/rltoken/o8mucWW2XddN4MHiHSArkA) 7 | * [Comparison operators](https://intranet.hbtn.io/rltoken/jN0bfG-Qpkg3aYJM-n3LHw) 8 | * [File test operators](https://intranet.hbtn.io/rltoken/mYWUvI1VFqR_KWNWZngq7Q) 9 | * [Make your scripts portable](https://intranet.hbtn.io/rltoken/Dyrnap2UC-LrzrmCOJRx8A) 10 | 11 | --- 12 | ## Learning Objectives:bulb: 13 | What you should learn from this project: 14 | 15 | * How to create SSH keys 16 | * What is the advantage of using #!/usr/bin/env bash over #!/bin/bash 17 | * How to use while, until and for loops 18 | * How to use if, else, elif and case condition statements 19 | * How to use the cut command 20 | * What are files and other comparison operators, and how to use them 21 | 22 | --- 23 | 24 | ### [0. Create a SSH RSA key pair](./0-RSA_public_key.pub) 25 | * Read for this task: 26 | 27 | 28 | ### [1. For Holberton School loop](./1-for_holberton_school) 29 | * Write a Bash script that displays Holberton School 10 times. 30 | 31 | 32 | ### [2. While Holberton School loop](./2-while_holberton_school) 33 | * Write a Bash script that displays Holberton School 10 times. 34 | 35 | 36 | ### [3. Until Holberton School loop](./3-until_holberton_school) 37 | * Write a Bash script that displays Holberton School 10 times. 38 | 39 | 40 | ### [4. If 9, say Hi!](./4-if_9_say_hi) 41 | * Write a Bash script that displays Holberton School 10 times, but for the 9th iteration, displays Holberton School and then Hi on a new line. 42 | 43 | 44 | ### [5. 4 bad luck, 8 is your chance](./5-4_bad_luck_8_is_your_chance) 45 | * Write a Bash script that loops from 1 to 10 and: 46 | 47 | 48 | ### [6. Superstitious numbers](./6-superstitious_numbers) 49 | * Write a Bash script that displays numbers from 1 to 20 and: 50 | 51 | 52 | ### [7. Clock](./7-clock) 53 | * Write a Bash script that displays the time for 12 hours and 59 minutes: 54 | 55 | 56 | ### [8. For ls](./8-for_ls) 57 | * Write a Bash script that displays: 58 | 59 | 60 | ### [9. To file, or not to file](./9-to_file_or_not_to_file) 61 | * Write a Bash script that gives you information about the holbertonschool file. 62 | 63 | 64 | ### [10. FizzBuzz](./10-fizzbuzz) 65 | * Write a Bash script that displays numbers from 1 to 100. 66 | 67 | --- 68 | 69 | ## Author 70 | * **Jamila Moseka** - [jmoseka](https://github.com/jmoseka) -------------------------------------------------------------------------------- /0x05-processes_and_signals/0-what-is-my-pid: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #Bash script that displays its own PID 3 | echo $$ 4 | -------------------------------------------------------------------------------- /0x05-processes_and_signals/1-list_your_processes: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #displays a list of currently running processes. 3 | ps -auxf 4 | -------------------------------------------------------------------------------- /0x05-processes_and_signals/100-process_and_pid_file: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #A Bash script that receiving a SIGTERM SIGINT SIGQUIT 3 | echo $$ > /var/run/holbertonscript.pid 4 | trap "echo I hate the kill command; sudo rm /var/run/holbertonscript.pid; exit" SIGTERM 5 | trap "echo Y U no love me?!; exit" SIGINT 6 | trap "sudo rm /var/run/holbertonscript.pid; exit" SIGQUIT 7 | while ((1)) 8 | do 9 | echo "To infinity and beyond" 10 | sleep 2 11 | done 12 | -------------------------------------------------------------------------------- /0x05-processes_and_signals/2-show_your_bash_pid: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #displays lines containing the bash word 3 | ps -aux | grep bash 4 | -------------------------------------------------------------------------------- /0x05-processes_and_signals/3-show_your_bash_pid_made_easy: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #displays the PID, along with the process name, 3 | #of processes whose name contain the word bash. 4 | pgrep -l -f bash 5 | -------------------------------------------------------------------------------- /0x05-processes_and_signals/4-to_infinity_and_beyond: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #displays To infinity and beyond indefinitely 3 | while ((1)) 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 | #kills 4-to_infinity_and_beyond process 3 | kill "$(pgrep -f 4-to_infinity_and_beyond)" 4 | -------------------------------------------------------------------------------- /0x05-processes_and_signals/6-stop_me_if_you_can: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #kills 4-to_infinity_and_beyond process without kill command or killall 3 | pkill -f 4-to_infinity_and_beyond 4 | -------------------------------------------------------------------------------- /0x05-processes_and_signals/7-highlander: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #displays I am invincible!!! when receiving a SIGTERM signal 3 | 4 | trap "echo I am invincible!!!" SIGTERM 5 | while ((1)) 6 | do 7 | echo "To infinity and beyond" 8 | sleep 2 9 | done 10 | -------------------------------------------------------------------------------- /0x05-processes_and_signals/8-beheaded_process: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #kills the process 7-highlander 3 | kill -SIGKILL "$(pgrep -f 7-highlander)" 4 | -------------------------------------------------------------------------------- /0x05-processes_and_signals/README.md: -------------------------------------------------------------------------------- 1 | # 0x05. Processes and signals 2 | 3 | ## Resources:books: 4 | Read or watch: 5 | * [Linux PID](https://intranet.hbtn.io/rltoken/FcpEdqz8hau7eEB0Pi8Ong) 6 | * [Linux process](https://intranet.hbtn.io/rltoken/hX_t2YK0erLPbdTq0-uKwQ) 7 | * [Linux signal](https://intranet.hbtn.io/rltoken/SojW4zvL8j1yaoa7_NM6rA) 8 | 9 | --- 10 | ## Learning Objectives:bulb: 11 | What you should learn from this project: 12 | 13 | * What is a PID 14 | * What is a process 15 | * How to find a process’ PID 16 | * How to kill a process 17 | * What is a signal 18 | * What are the 2 signals that cannot be ignored 19 | 20 | --- 21 | 22 | ### [0. What is my PID](./0-what-is-my-pid) 23 | * Write a Bash script that displays its own PID. 24 | 25 | 26 | ### [1. List your processes](./1-list_your_processes) 27 | * Write a Bash script that displays a list of currently running processes. 28 | 29 | 30 | ### [2. Show your Bash PID](./2-show_your_bash_pid) 31 | * Using your previous exercise command, write a Bash script that displays lines containing the bash word, thus allowing you to easily get the PID of your Bash process. 32 | 33 | 34 | ### [3. Show your Bash PID made easy](./3-show_your_bash_pid_made_easy) 35 | * Write a Bash script that displays the PID, along with the process name, of processes whose name contain the word bash. 36 | 37 | 38 | ### [4. To infinity and beyond](./4-to_infinity_and_beyond) 39 | * Write a Bash script that displays To infinity and beyond indefinitely. 40 | 41 | 42 | ### [5. Kill me now](./5-kill_me_now) 43 | * We killed our 4-to_infinity_and_beyond process using ctrl+c in the previous task, there is actually another way to do this. 44 | 45 | 46 | ### [6. Kill me now made easy](./6-kill_me_now_made_easy) 47 | * Write a Bash script that kills 4-to_infinity_and_beyond process. 48 | 49 | 50 | ### [7. Highlander](./7-highlander) 51 | * Write a Bash script that displays: 52 | 53 | 54 | ### [8. Beheaded process](./8-beheaded_process) 55 | * Write a Bash script that kills the process 7-highlander. 56 | 57 | --- 58 | 59 | ## Author 60 | * **Cristina Rueda** - [CrisRuedaP](https://github.com/CrisRuedaP) -------------------------------------------------------------------------------- /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/2-repetition_token_1.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | puts ARGV[0].scan(/h.{1,2}n/).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(/^[0-9]{10}$/).join 3 | -------------------------------------------------------------------------------- /0x06-regular_expressions/7-OMG_WHY_ARE_YOU_SHOUTING.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | puts ARGV[0].scan(/[A-Z]*/).join 3 | -------------------------------------------------------------------------------- /0x06-regular_expressions/README.md: -------------------------------------------------------------------------------- 1 | # 0x06. Regular expression 2 | 3 | ## Resources:books: 4 | Read or watch: 5 | * [Regular expressions - basics](https://intranet.hbtn.io/rltoken/SJ2eQ7V2iQlCgLc-L96zWg) 6 | * [Regular expressions - advanced](https://intranet.hbtn.io/rltoken/qyjWL-J1_qUaZGR690gH1Q) 7 | * [Rubular is your best friend](https://intranet.hbtn.io/rltoken/WCjn8NgohbQ5NGXEObWZvQ) 8 | * [Use a regular expression against a problem: now you have 2 problems](https://intranet.hbtn.io/rltoken/Zfvv_ydOCvJ_YaBB6eDqVw) 9 | * [Learn Regular Expressions with simple, interactive exercises](https://intranet.hbtn.io/rltoken/Y-OVGcJ5cskdXWIBowiE_A) 10 | 11 | --- 12 | ## Learning Objectives:bulb: 13 | What you should learn from this project: 14 | 15 | --- 16 | 17 | ### [0. Simply matching Holberton](./0-simply_match_holberton.rb) 18 | * 19 | 20 | 21 | ### [1. Repetition Token #0](./1-repetition_token_0.rb) 22 | * 23 | 24 | 25 | ### [2. Repetition Token #1](./2-repetition_token_1.rb) 26 | * 27 | 28 | 29 | ### [3. Repetition Token #2](./3-repetition_token_2.rb) 30 | * 31 | 32 | 33 | ### [4. Repetition Token #3](./4-repetition_token_3.rb) 34 | * 35 | 36 | 37 | ### [5. Not quite HBTN yet](./5-beginning_and_end.rb) 38 | * Requirements: 39 | 40 | 41 | ### [6. Call me maybe](./6-phone_number.rb) 42 | * This task is brought to you by Holberton mentor Neha Jain, Senior Software Engineer at LinkedIn. 43 | 44 | 45 | ### [7. OMG WHY ARE YOU SHOUTING?](./7-OMG_WHY_ARE_YOU_SHOUTING.rb) 46 | * 47 | 48 | --- 49 | 50 | -------------------------------------------------------------------------------- /0x07-networking_basics/0-OSI_model: -------------------------------------------------------------------------------- 1 | 2 2 | 2 -------------------------------------------------------------------------------- /0x07-networking_basics/1-types_of_network: -------------------------------------------------------------------------------- 1 | 3 2 | 2 3 | 1 -------------------------------------------------------------------------------- /0x07-networking_basics/2-MAC_and_IP_address: -------------------------------------------------------------------------------- 1 | 2 2 | 1 -------------------------------------------------------------------------------- /0x07-networking_basics/3-UDP_and_TCP: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 1 -------------------------------------------------------------------------------- /0x07-networking_basics/4-TCP_and_UDP_ports: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #Bash script that displays listening ports 3 | #That only shows listening sockets 4 | #That shows the PID and name of the program to which each socket belongs 5 | netstat -lp 6 | -------------------------------------------------------------------------------- /0x07-networking_basics/5-is_the_host_on_the_network: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #Bash script that pings an IP address passed as an argument 3 | #if no argument passed Ping the IP 5 times 4 | ip=$1 5 | if [ "$ip" == "" ]; then 6 | echo "Usage: 5-is_the_host_on_the_network {IP_ADDRESS}" 7 | else 8 | ping -c 5 "$ip" 9 | fi 10 | -------------------------------------------------------------------------------- /0x07-networking_basics/README.md: -------------------------------------------------------------------------------- 1 | # 0x07. Networking basics #0 2 | 3 | ## Resources:books: 4 | Read or watch: 5 | * [OSI model](https://intranet.hbtn.io/rltoken/ERGikvYsVP3sa9ZdlAAV4w) 6 | * [Different types of network](https://intranet.hbtn.io/rltoken/H2peG3mV1MDDEK9c9FpGjA) 7 | * [LAN network](https://intranet.hbtn.io/rltoken/GLVy5U4Ja4c2BnKYDPwT5Q) 8 | * [WAN network](https://intranet.hbtn.io/rltoken/IghQOBbQi3Y-H82l3s9ERg) 9 | * [Internet](https://intranet.hbtn.io/rltoken/osfQ04v-6oWuX4LdcpMYfQ) 10 | * [MAC address](https://intranet.hbtn.io/rltoken/DjY02-vo10kphmiYSa2Msg) 11 | * [What is an IP address](https://intranet.hbtn.io/rltoken/_pRm6TVS3zWV_cKg51Gn4Q) 12 | * [Private and public address](https://intranet.hbtn.io/rltoken/Tj1tSxadTHv8kS9Q7lzTpQ) 13 | * [IPv4 and IPv6](https://intranet.hbtn.io/rltoken/t9AVXK9jpPJrL5ikz5fvKA) 14 | * [Localhost](https://intranet.hbtn.io/rltoken/uqDHdS73W-CJQakM8vERtQ) 15 | * [TCP and UDP](https://intranet.hbtn.io/rltoken/nOeDjXQrw-N8eFmTBiuzqw) 16 | * [TCP/UDP ports List](https://intranet.hbtn.io/rltoken/gfKJyK0ztzhyNO0SIvVibQ) 17 | * [What is ping /ICMP](https://intranet.hbtn.io/rltoken/OPrB4crHtTLwUynA5YjVNw) 18 | * [Positional parameters](https://intranet.hbtn.io/rltoken/yN_ZinFzBaLXuJhOhKiMfw) 19 | 20 | --- 21 | ## Learning Objectives:bulb: 22 | What you should learn from this project: 23 | 24 | * What it is 25 | * How many layers it has 26 | * How it is organized 27 | 28 | --- 29 | 30 | ### [0. OSI model](./0-OSI_model) 31 | * OSI (Open Systems Interconnection) is an abstract model to describe layered communication and computer network design. The idea is to segregate the different parts of what make communication possible. 32 | 33 | 34 | ### [1. Types of network](./1-types_of_network) 35 | * 36 | 37 | 38 | ### [2. MAC and IP address](./2-MAC_and_IP_address) 39 | * 40 | 41 | 42 | ### [3. UDP and TCP](./3-UDP_and_TCP) 43 | * 44 | 45 | 46 | ### [4. TCP and UDP ports](./4-TCP_and_UDP_ports) 47 | * Once packets have been sent to the right network device using IP using either UDP or TCP as a mode of transportation, it needs to actually enter the network device. 48 | 49 | 50 | ### [5. Is the host on the network](./5-is_the_host_on_the_network) 51 | * 52 | 53 | --- 54 | -------------------------------------------------------------------------------- /0x08-networking_basics_2/0-change_your_home_IP: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #Bash script that configures an Ubuntu server 3 | cp /etc/hosts ~/hosts.new 4 | sed -i s/127.0.0.1/127.0.0.2/ ~/hosts.new 5 | echo "8.8.8.8 facebook.com" >> ~/hosts.new 6 | cp -f ~/hosts.new /etc/hosts 7 | -------------------------------------------------------------------------------- /0x08-networking_basics_2/0-localhost: -------------------------------------------------------------------------------- 1 | 2 -------------------------------------------------------------------------------- /0x08-networking_basics_2/1-show_attached_IPs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #Bash script that displays all active IPv4 IPs on the machine it’s executed on 3 | ifconfig | grep "inet addr:" | cut -d ":" -f2 | cut -d " " -f1 -------------------------------------------------------------------------------- /0x08-networking_basics_2/1-wildcard: -------------------------------------------------------------------------------- 1 | 1 -------------------------------------------------------------------------------- /0x08-networking_basics_2/100-port_listening_on_localhost: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #Bash script that listens on port 98 on localhost 3 | nc -l 98 4 | -------------------------------------------------------------------------------- /0x08-networking_basics_2/README.md: -------------------------------------------------------------------------------- 1 | # 0x08. Networking basics #1 2 | 3 | ## Resources:books: 4 | Read or watch: 5 | * [What is localhost](https://intranet.hbtn.io/rltoken/7SedZ8ILSQulYf7xzSbraQ) 6 | * [What is 0.0.0.0](https://intranet.hbtn.io/rltoken/n5IFAt_OWGJtGW33t7Jfag) 7 | * [What is the hosts file](https://intranet.hbtn.io/rltoken/21l3Uqizr3LpA1ZGrYPg3g) 8 | * [Netcat examples](https://intranet.hbtn.io/rltoken/uMleIIzkRoR2w8EkwItSEg) 9 | 10 | --- 11 | ## Learning Objectives:bulb: 12 | What you should learn from this project: 13 | 14 | * What is localhost/127.0.0.1 15 | * What is 0.0.0.0 16 | * What is /etc/hosts 17 | * How to display your machine’s active network interfaces 18 | 19 | --- 20 | 21 | ### [0. Localhost](./0-localhost) 22 | * What is localhost? 23 | 24 | 25 | ### [1. All IPs](./1-wildcard) 26 | * What is 0.0.0.0? 27 | 28 | 29 | ### [2. Change your home IP](./2-change_your_home_IP) 30 | * Write a Bash script that configures an Ubuntu server with the below requirements. 31 | 32 | 33 | ### [3. Show attached IPs](./3-show_attached_IPs) 34 | * Write a Bash script that displays all active IPv4 IPs on the machine it’s executed on. 35 | 36 | --- 37 | -------------------------------------------------------------------------------- /0x0A-configuration_management/0-create_a_file.pp: -------------------------------------------------------------------------------- 1 | # A resource declaration 2 | file { '/tmp/holberton': 3 | ensure => file, 4 | path => '/tmp/holberton', 5 | mode => '0744', 6 | owner => 'www-data', 7 | group => 'www-data', 8 | content => 'I love Puppet' #this text will be inside the file 9 | } 10 | -------------------------------------------------------------------------------- /0x0A-configuration_management/1-install_a_package.pp: -------------------------------------------------------------------------------- 1 | # Installs a package puppet-lint 2 | package { 'puppet-lint': 3 | ensure => '2.1.1', 4 | provider => 'gem', 5 | } 6 | -------------------------------------------------------------------------------- /0x0A-configuration_management/2-execute_a_command.pp: -------------------------------------------------------------------------------- 1 | # Create a manifest that kills a process named killmenow 2 | exec { 'killmenow': 3 | command => 'pkill -f killmenow', 4 | path => '/usr/bin' 5 | } 6 | -------------------------------------------------------------------------------- /0x0A-configuration_management/README.md: -------------------------------------------------------------------------------- 1 | # 0x0A Configuration management 2 | 3 | ## Resources:books: 4 | Read or watch: 5 | * [Intro to Configuration Management](https://intranet.hbtn.io/rltoken/r-NmkYO8bxIKp2qEx2ZjKQ) 6 | * [Puppet resource type: file](https://intranet.hbtn.io/rltoken/fuhnsI9_1_F4GrHwGT3GxA) 7 | * [Puppet’s Declarative Language: Modeling Instead of Scripting](https://intranet.hbtn.io/rltoken/Fqmb5rnChQgYAypvKoTxAQ) 8 | * [Puppet lint](https://intranet.hbtn.io/rltoken/oezu0m_hJ8nEVA6a9o17Tw) 9 | * [Puppet emacs mode](https://intranet.hbtn.io/rltoken/N70cVw8mG3707He-OxjP1w) 10 | 11 | --- 12 | ## Learning Objectives:bulb: 13 | What you should learn from this project: 14 | 15 | --- 16 | 17 | ### [0. Create a file](./0-create_a_file.pp) 18 | * Using Puppet, create a file in /tmp. 19 | 20 | 21 | ### [1. Install a package](./1-install_a_package.pp) 22 | * Using Puppet, install puppet-lint. 23 | 24 | 25 | ### [2. Execute a command](./2-execute_a_command.pp) 26 | * Using Puppet, create a manifest that kills a process named killmenow. 27 | 28 | --- 29 | 30 | ## Author 31 | * **jamila moseka** - [jmoseka](https://github.com/jmoseka) 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Shell permission commands 2 | --------------------------------------------------------------------------------