custom-linux-scripts

🛠️ My Bash Toolkit

This repository contains a collection of scripts I built to make my daily workflow on Linux Mint Cinnamon (Ubuntu-based) a bit smoother. They might not change the world, but they certainly save me some keystrokes. Feel free to use them as-is or tweak them to fit your own needs.

Note: Since these were made for my personal setup, I haven’t written exhaustive documentation—just a quick “how-to” for each tool.


🚀 1. Push

The “Lazy Git” Tool

I made this to simplify the process of publishing changes to a repository without typing the same three commands every time.

🛠️ How to use it:


⚡ 2. Start

The Morning Ritual Automator

I have a specific routine when I open my laptop: mounting disks, applying keyboard layouts, and starting services like MySQL and Apache. Doing this manually every day was annoying, so I automated it.

🛠️ How to use it:

Variable Description
XMOD_FILE Path to your custom .Xmodmap layout file
MOUNT_DEV The device identifier (e.g., /dev/sda4)
MOUNT_POINT Where you want the drive mounted (e.g., /media/mahdi/D-drive)
LOG_FILE Where to save logs (default is ~/startup.log)
START_SERVICES_CMD The command to start your services

🌐 3. Webuild

The Instant Scaffolder

I built this one day when I was bored and wanted a way to instantly generate essential website files so I wouldn’t have to create them manually every time.

🛠️ How to use it:

Command Files Created
webuild static index.html, style.css, script.js
webuild dynamic index.html, style.css, script.js, server.php
webuild platform index.html, style.css, script.js, server.php, data.json

Example Usage:


🖱️ 4. Open In Browser

The Nemo Context Menu Mapper

I made this great Nemo action to instantly map my local development directories to their respective network URLs. It adds a handy right-click option in the Nemo file manager to open a local path directly in the browser with the correct IP and port routing.

🛠️ How to use it:

You can find the necessary files for this tool in the Open-In-Browser folder in this repository.

Installation:

  1. The Script: Copy open-in-browser.sh to your local bin and make it executable: cp Open-In-Browser/open-in-browser.sh ~/.local/bin/ chmod +x ~/.local/bin/open-in-browser.sh
  2. The Action: Copy the Nemo action file (e.g., open-in-browser.nemo_action) to your Nemo actions directory: cp Open-In-Browser/*.nemo_action ~/.local/share/nemo/actions/
  3. Restart Nemo: Apply the changes by running nemo -q in your terminal.

Configuration: This action is hardcoded to specific network IPs and drive paths. You will need to edit both files to match your environment:


🗂️ 5. GitMan

The Multi-Repo Manager

When you have a lot of repositories and switch between devices, it’s easy to forget to pull before you push. GitMan solves that by giving you a clean interactive menu to manage all your repos at once from a single directory.

🛠️ How to use it:

You can find the script in the GitMan folder in this repository.

It will automatically detect every subdirectory with a .git folder and include it.

Option Description
1 Pull All Pull every detected repo at once
2 Push All Push every detected repo at once
3 Check Pull See which repos are behind the remote
4 Check Push See which repos are ahead of the remote
5 Pull Specific Pick one or more repos to pull
6 Push Specific Pick one or more repos to push
7 Help Show usage info inside the script

🌍 6. Server With Apache

The Instant Dev Server

A Nemo right-click action that sets any directory (or file) as an Apache DocumentRoot on the fly and opens it in the browser — full Apache, full .htaccess, full PHP. No spinning up vhosts manually, no typing paths, just right-click and go.

📦 Requirements

You need these installed before running the setup:

Dependency Install command
apache2 sudo apt install apache2
libapache2-mod-php sudo apt install libapache2-mod-php
python3 Pre-installed on Linux Mint
notify-send Pre-installed on Linux Mint (via libnotify-bin)

🛠️ How to use it:

You can find all three necessary files in the Server-With-Apache folder in this repository.

Installation (one-time):

  1. cd into the Server-With-Apache folder.
  2. Make the setup script executable and run it:
    chmod +x setup.sh
    ./setup.sh
    
  3. Done. The setup script handles everything automatically — no further steps needed.

What the setup script does:

Usage:

What you get:

Note: Only one directory can be served at a time. Right-clicking a new folder replaces the previous one.


That’s it for now