Link Search Menu Expand Document

Homework 04: Command-line Environment

Homework Update

Run git pull to grab the latest homework.

Required Questions

  1. Let’s explore job control and signals. Write a Python script that
    1. When sent a signal.SIGINT, prints Caught interruption and continues running.
    2. When sent a signal.SIGTERM, prints Terminating and quits.

    Starter code has been provided for you in handlers.py.

  2. Create an alias dc that resolves to cd for when you type it wrongly. Save this in a file called aliases. To test this, you can source aliases and try running dc.
  3. To explore ssh, go to Overthewire and complete level 0. You will obtain a password for the bandit1 level. Store this password in a file called bandit0_password.

    As a side note, these games are pretty fun! Check them out if you’re interested in software exploits, and feel free to ask us in Discord/OH about them!

  4. Let’s explore dotfiles. To get started, create a dotfile of your choice. Add your own customizations, and feel free to go online to explore what over people have done (imitation is the sincerest form of flattery!). Once you’re done, upload that dotfile, along with a file called chosen_dotfile that contains the name of the dotfile you have created.

    For example, if I create a dotfile .zshrc, then my chosen_dotfile will contain one line:

    .zshrc
    

Upload handlers.py, aliases, bandit0_password, your chosen dotfile, and chosen_dotfile to Gradescope.

Optional Questions

This homework autograder contains a security vulnerability. If you’re interested in cracking it, please feel free to do so, demonstrating that you can get full credit on the assignment without actually doing all of the problems listed above. There is no bonus credit for this, just fun :^). Once you do so, please make a private Piazza post for us to check.

Good luck!