Giter Club home page Giter Club logo

prepnote's Introduction

Dynamic PrepNote Script

Description

The prepnote script is a customizable bash utility designed to streamline the setup process for various projects, focusing especially on penetration testing and cybersecurity tasks. It automates the creation of a structured directory layout for showcasing achievements and organizing project efforts efficiently. This script is particularly useful for individuals engaging in platforms like Hack The Box or for any project requiring an organized file structure. It assumes that the Showcase directory is a duplicate of the Local Notes folder from Obsidian, facilitating seamless integration with your knowledge management practices.

Requirements

  • Bash or Zsh shell environment
  • Standard Unix utilities (cp, mkdir, echo, awk)

Installation

To make the prepnote function available in your shell environment, add it to your .bashrc or .zshrc file. This makes the function accessible anytime you open a terminal.

  1. Open your .bashrc or .zshrc file in a text editor. For example:

    nano ~/.bashrc

    or

    nano ~/.zshrc
  2. Copy and paste the prepnote function into the file.

  3. Save the file and exit the editor.

  4. Apply the changes by sourcing your .bashrc or .zshrc file:

    source ~/.bashrc

    or

    source ~/.zshrc

Usage

How to Use

Invoke the prepnote script by calling it with the desired project name as an argument:

prepnote <project_name>

The script performs the following actions:

  • Creates a new project folder in two specified locations with adaptable naming conventions: one for showcasing (with the first letter capitalized) and another for project files (in lowercase).
  • Duplicates a template directory (your Local Notes from Obsidian for the Showcase part) into the showcase directory.
  • Establishes a structured set of directories within the project files location, catering to various project needs.

Function Template

Here's a customizable template of the prepnote function:

prepnote() {
  # Define your template and destination directories
  local template_dir="<path_to_template>"
  local showcase_destination="<path_to_showcase_dir>"
  local project_destination="<path_to_project_dir>"
  
  local new_folder_name="$1"
  # Customize the naming convention here
  local showcase_folder_name=$(echo "$new_folder_name" | awk '{customize this part}')
  local project_folder_name=$(echo "$new_folder_name" | awk '{customize this part}')
  
  # Operations for the Showcase directory
  cp -r "$template_dir" "$showcase_destination/$showcase_folder_name"
  
  # Operations for the project files directory
  mkdir -p "$project_destination/$project_folder_name"
  # Add subdirectories as needed
  mkdir -p "$project_destination/$project_folder_name/subdirectory1"
  # Continue for other subdirectories...
  
  echo "Setup completed for $showcase_destination/$showcase_folder_name"
  echo "Setup completed for $project_destination/$project_folder_name"
}

Adjust <path_to_template>, <path_to_showcase_dir>, and <path_to_project_dir> with the actual paths on your system. Customize the awk commands to format your folder names according to your preferences.

Contributing

You should of course adapt this to your liking and environment. This is a template

prepnote's People

Contributors

0xdynamo avatar

Stargazers

 avatar  avatar Gaetan Fox avatar  avatar Chad Hendrix avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.