Assignment 1: Vapid Tips and Tricks - hawkinsw/CS5138 GitHub Wiki

Post Tips and Tricks Here!

Gradescope, build.sh, and Python

Gradescope extracts your submitted vapid.zip, runs build.sh (if present) then launches into running tests - all beginning with ./vapid.

If you get absolutely no output from Gradescope, it is because it failed to find the vapid executable. You only get output from execution of vapid, not build.sh!

It MUST be an executable file. Thankfully, you can rename your python file to just vapid to be sufficient. Messing with PyInstaller is not worth it!

For Python users, you will be happy to learn that both Python 2 and 3 are accessible and that pip is already installed for each.

To avoid frustrations of not getting any output at all from Gradescope, don't over-complicate your build process.

Don't bother trying to pipe your dependency installations through yes or use flags like --quiet unless you're really certain some sort of interactive prompt is tripping it up.

This sample build.sh should be sufficient for any Python users:

#!/bin/bash
## Gather Dependencies
# Install <whatever>
pip3 install example-module-1 example-module-2
# (use pip instead of pip3 if you are on Python 2)


## Prepare Executable
# Make accessible to current directory so executable is found
mv source/* ./

# Rename for Gradescope to find it
mv your-main-python-file.py vapid

# Set the executable bit
chmod +x vapid

PyInstaller

If you're planning to use PyInstaller to generate the single file executable binary and would like to get rid of all the excess generated files, the following build script format can be used:

#!/bin/bash

# Verify the install of a required bootloader for PyInstaller
apt-get -y update
apt-get -y install zlib1g-dev

# Install PyInstaller (and any other external modules you may need)
pip3 install pyinstaller <any extra modules you may need>

# Generate packaged executable in the same directory as your vapid.py
pyinstaller --clean -F --distpath ./ vapid.py

# Clean up the excess build files
rm -r ./build
rm vapid.spec

Note: If you are testing this build script on your host machine, you will need to run the build.sh file with sudo, but GradeScope will automatically execute the script as a root user.

Getting feedback from Gradescope on build.sh

This is an incredibly terrible workaround, but if you're desperate... you can have build.sh call your "real" build script and pipe that to a text file, then let a fake "vapid" executable read and print that file. You won't gain any points this way, but you are presented with diffs that should effectively allow you to read the output of when your real build script was ran.

Example (pseudo code, never ran):

#!/bin/bash
real-build.sh > output.txt

Then have your vapid executable open, read, and print the contents of output.txt.

It won't be pretty, but if you are at the end of your rope, this just might work... but it's probably better to just ask Will to see if he can see the output on his end.

Steps for Installing Kali and Windows guest on Ubuntu 20.04 (Edwin Cervantes):

  • First install VirtualBox via Ubuntu Software Store
  • Download Kali and extract: https://www.kali.org/get-kali/#kali-virtual-machines (64 bit VBox version)
  • Download Windows and extract: https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/ (VirtualBox)
  • Helps to extract both of these to /home/{user}/VirtualBox VMs
  • Kali VM Install: Click 'New' Fill out a Name, Leave Machine Folder as default, and Version as Oracle 64-bit Set memory size to 2048 Set 'Use an existing virtual hard disk file' and select the Kali.vdi you extracted Start VM. Default user and password is kali:kali
  • Windows VM Install: Click 'Import' Select the extracted Windows .ova Start the VM
  • Take a snapshot of both VMs so you can always have a clean VM if something happens
  • Mount a shared folder
⚠️ **GitHub.com Fallback** ⚠️