Skip to content

About

Collection of useful shell scripts for Debian-based systems

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

31 Commits

Folders and files

Repository files navigation

Collection of useful shell/bash scripts for Linux systems.

Why This Repository?

I created this repository to share useful shell scripts that solve common Linux problems. Instead of searching for solutions every time, I keep all my scripts in one place.


1. keyboard-reset.sh

Works in every Linux distro!

Fixes built-in laptop keyboard not working after sleep/wake


The Problem

When you close your laptop lid or put it to sleep, the built-in keyboard sometimes stops working after waking up.

Why this happens:

  • When laptop goes to sleep, the system unloads the keyboard driver to save power
  • When waking up, the driver (i8042) sometimes fails to reinitialize properly
  • The keyboard remains unresponsive even though the system is awake

Symptoms:

  • Built-in keyboard doesn't type anything
  • External USB keyboard still works
  • Touchpad still works
  • Only the keyboard is affected

How to Run It

Step 1: Make the script executable (first time only)

chmod +x keyboard-reset.sh

Step 2: Run the script

sudo ./keyboard-reset.sh

You don't have to run this every time! Just run this and this problem will be gone. If not, run it again.


2. up.sh

Complete system update script for Debian-based systems

What it does:

  • Updates package lists
  • Upgrades all installed packages
  • Removes unnecessary packages
  • Cleans the package cache

Why use this? Instead of typing 4 separate commands every time, just run one script!


How to Run It

Step 1: Make the script executable (first time only)

chmod +x up.sh

Step 2: Run the script

./up.sh

3. run.sh

Interactive compilation and execution script for multi-language projects

Works in every Linux distro!

What it does:

  • Prompts for directory location, file name, language, and compiler
  • Supports Java, C, C++, and Python with sensible default compilers
  • Handles automatic compilation and execution in a single step
  • Validates directory paths and file existence to prevent runtime errors

Why use this? Instead of manually switching directories, compiling files, and executing binaries with separate commands, just run one script!

How to copy directory paths from File Managers:

  • Terminal: Run pwd to print and copy your current directory path.
  • Nautilus (GNOME): Press Ctrl + L to highlight the address bar, then Ctrl + C to copy the path.
  • Dolphin (KDE Plasma): Press Ctrl + L to copy the address bar path, or right-click a folder and select Copy Location (Ctrl + Alt + C).

How to Run It

Step 1: Make the script executable (first time only)

chmod +x run.sh

Step 2: Run the script

./run.sh

4. bash-git-branch-indicator

A Bash script snippet that displays your active Git branch in your terminal prompt.

It will work on distros where Bash is the default shell (Ubuntu, Kubuntu, Arch, Fedora, Debian, Linux Mint, Manjaro, openSUSE, etc.).

What it does:

  • Automatically detects if your directory is a Git repository.
  • Shows the current branch name in bold yellow text next to your path.
  • Colors your user/hostname (bold green) and path (bold blue).

Why use this? Instantly see which branch you are on without typing git status.

How to Install

Step 1: Copy the code from "bash-git-branch-indicator.txt"

Step 2: Edit bashrc

nano ~/.bashrc

Step 3: Paste the code that you copied

i. Paste it at the end (Press Ctrl + Shift + V)
ii. Press Ctrl+S
iii. Press Ctrl+X

Step 4: Apply changes

source ~/.bashrc

About

Collection of useful shell scripts for Debian-based systems

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages