Skip to content

PsicoI/Dot-Files-Psicol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Final Project

Overview

In this final project, you will create a dotfiles project, a collection of configuration files and installation scripts, to help you quickly set up your development environment on a new machine. This project will allow you to configure your favorite tools, customize your shell, and automate the installation of essential software and packages.

Learning Objectives

  • Create a dotfiles repository on a version control system.
  • Customize and organize configuration files for various development tools.
  • Write installation scripts to automate the setup of software and packages.
  • Document the usage and setup instructions for your dotfiles project.

Task 1: Setting Up local bin scripts

Use the provided DotSetup.sh template script as a driver to manage your tasks.

Your initial task involves creating a function or a separate script that links your dotfiles/bin folder to your $HOME/bin folder. To achieve this, follow the steps below:

  • Check if your $HOME/bin/ folder or symbolic link already exists. If it does, delete it to avoid conflicts.
  • Create a symbolic link from your dotfiles/bin to your $HOME/bin folder. This ensures that scripts and executables in your bin folder are accessible globally.
  • Update your system's environment variables by adding the new folder/link to your $PATH. If you're using the bash shell, you'll need to modify your $HOME/.bashr file accordingly. Note: If you are using a different shell, ensure you make the necessary changes to the corresponding configuration file.
  • Verify that the setup is working correctly. We have provided a test script, hello_local_bin, inside the bin folder to help you confirm that the local bin scripts are accessible.

Deliverables:

  • A script or function that performs the steps described above, setting up local bin scripts.
  • An updated configuration file (e.g., $HOME/.bashrc) that includes the new folder in your $PATH.
  • Successful testing of the setup using the provided test script.

Submission:

Ensure that your local bin setup script is functional and that the configuration file is updated as required. Also, include the URL to your repository for evaluation.

Grading Criteria:

  • Successful creation of the local bin setup script.
  • Proper configuration of the $PATH in the shell's configuration file.
  • Successful testing of the local bin setup using the provided test script.
  • This task establishes a foundation for managing local bin scripts, making them accessible from any location in your development environment. It also ensures that your system recognizes the new scripts' location and adds it to the system's path.

Sample run without any files

# Note: Make sure you document your script progress along the way

$ ./DotSetup.sh 
Configuring your local bin
*** Creating Link to /home/codespace/bin from /workspaces/cs3030-flex-instructor-notes/finalProject/bin folder
*** Creating Link
*** Adding /home/codespace/bin to your PATH variable in .bashrc

Sample run with existing files

# Note: Make sure you document your script progress along the way

$ ./DotSetup.sh 
Configuring your local bin
*** Creating Link to /home/codespace/bin from /workspaces/cs3030-flex-instructor-notes/finalProject/bin folder
*** Removing old Link
*** Creating new Link
*** Adding /home/codespace/bin to your PATH variable in .bashrc

Testing local bin script

Depending on how you setup your script, you may need to restart your terminal to load your new $PATH which includes the $HOME/bin folder

# source new configuration
$ source ~/.bashrc 
# test script
$ hello_local_bin 
Hello from local bin folder [/workspaces/cs3030-flex-instructor-notes/finalProject]
# Note: You should not call your script with ./hello_local_bin, but as 
# part of a local binary

Task 2: Setting Up Python Conda Environment

Your next task is to create a function or script that automates the setup of a Python Conda environment. Follow these steps to achive this:

  • Download Installation Script: Download the official installation script for Miniconda from the official website and save it in your home directory. You can use the wget command to accomplish this. Example:
    wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O "$HOME/miniconda.sh"`
  • Install Conda: Execute the downloaded script to install Conda. Ensure it's properly installed and configured on your system.
  • Createa a sample virtual environment: Create a sample Conda virtual environment. You can name it, for instance, test_env.
  • Activate your new environment: Activate your newly created test_env to work within it.
  • Install Packages: Install the list of packages specified in the provided requirements.txt file into the test_env environment. You can use the conda install command to accomplish this.
  • Testing environment: Test the installation by running task2.py python test script. If you successfully installed the packages, you should see the following message:
    $ python task2.py
    Successfully loaded new Python Modules
  • Deactivate the environment: After installing the packages, deactivate the test_env environment so you can reutrn to the base Conda environment.
  • Remove setup script:Once the setup is complete, remove the installation script miniconda.sh from your home directory to keep your environment clean.

Sample Run:

# Note: Make sure you document your script progress along the way

 $ ./DotSetup.sh 
Configuring your local bin
*** Creating Link to /home/codespace/bin from /workspaces/cs3030-flex-instructor-notes/finalProject/bin folder
*** Removing old Link
*** Creating new Link
*** Adding /home/codespace/bin to your PATH variable in .bashrc
----------------------------------------------------------------------------------
Installing Conda Python Environment
*** Removing the conda folder
*** Downloading the conda setup script
--2023-10-30 18:46:57--  https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
Resolving repo.anaconda.com (repo.anaconda.com)... 104.16.130.3, 104.16.131.3, 2606:4700::6810:8303, ...
.....................
.....................
*** Installing conda
PREFIX=/home/codespace/miniconda
Unpacking payload ...
.....................
.....................
installation finished.
*** Creating a test conda environment
Collecting package metadata (current_repodata.json): done
Solving environment: done
.....................
.....................
Executing transaction: done                                                                                                                                                                                                                 
#
# To activate this environment, use
#
#     $ conda activate test_env
#
# To deactivate an active environment, use
#
#     $ conda deactivate

*** Activating the test conda environment
*** Installing the test conda environment
Collecting pandas (from -r /workspaces/cs3030-flex-instructor-notes/finalProject/requirements.txt (line 1))
.....................
.....................
*** Deactivating the test conda environment
*** Removing the conda setup script

Deliverables:

  • A script or function that performs the steps described above to set up a Conda environment.
  • A requirements.txt file that lists the packages to be installed in the test_env environment.
  • Successful creation and activation of the test_env environment and installation of packages.
  • Run task2.py test file
  • Removal of the installation script to maintain a clean environment.

Submission:

  • Ensure that your Conda environment setup script is functional, and the specified packages are installed. Include the URL to your repository for evaluation.

Grading Criteria:

  • Successful download and execution of the Miniconda installation script.
  • Proper installation and configuration of Conda.
  • Creation and activation of the test_env Conda environment.
  • Installation of packages from the requirements.txt file.
  • Running of task2.py file
  • Proper deactivation of the environment and removal of the installation script.

Task 3: Install extra pacackages

Your next task involves installing additional packages that you may need for your development environment. Follow these steps to achieve this:

  • Update Apt Package List: Update the list of available packages in the Apt package manager by running the following command with sudo privileges:
    sudo apt update
  • Install Packages: Install the list of packages specified in the provided packages.txt file using the Apt package manager (sudo apt install). Note: Make sure that the -y flag is used to automatically answer "yes" to prompts.
  • Verify Installation: Run the dpkg, which, other command of your choosing to verify the packages have been installed successfully.

Deliverables:

  • A script or function that performs the steps described above to install additional packages.
  • A packages.txt file that lists the packages to be installed.
  • Successful installation of the specified packages.
  • Verification that the packages have been installed as per the dpkg command.

Submission:

  • Ensure that your package installation script is functional, and the specified packages are successfully installed. Include the URL to your repository for evaluation.

Grading Criteria:

  • Successful update of the Apt package list.
  • Proper installation of packages specified in the packages.txt file.
  • Verification of the installation through the dpkg command.

Task 4: Python Script to Check system OS and Hardware

Your next task involves creating a Python script that checks your machine setup. The script should determine and display the following information:

  • The current operating system (OS) running on the machine.
  • Hardware information about the machine.

Make sure your Python script checks the return code from the script.

Deliverables:

  • Create a Python script that detects the current operating system and hardware information.
  • The script should display the gathered information in a readable and organized format.
  • Check the return code from the script to ensure it runs without errors.

Submission:

  • Ensure that your Python script successfully detects the operating system and hardware information and displays it in a readable format. Include the URL to your repository for evaluation.

Grading Criteria:

  • Accurate detection of the current operating system.
  • Proper collection and presentation of hardware information.
  • Error-checking to ensure the script runs without issues.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors