Skip to content

GoodM4ven/CLI_LINUX_dot-bash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

بسم الله الرحمن الرحيم

Dot-Bash (v2)

An extremely opinionated set of Bash scripts, and their setup, that I rely on in Ubuntu for general computing and as well as web development...

The scripts are split into three layers:

  1. Inlined aliases
  2. Functioned commands
  3. Full script files

Setup

  1. Keep this repo at a stable path (example):
    ~/Code/Scripts/CLI_LINUX_dot-bash
  2. Source all command layers in your ~/.bashrc under # Alias definitions.:
    [ -f ~/Code/Scripts/CLI_LINUX_dot-bash/.bash_aliases ] && source ~/Code/Scripts/CLI_LINUX_dot-bash/.bash_aliases
    [ -f ~/Code/Scripts/CLI_LINUX_dot-bash/.bash_functions ] && source ~/Code/Scripts/CLI_LINUX_dot-bash/.bash_functions
    [ -f ~/Code/Scripts/CLI_LINUX_dot-bash/.bash_files ] && source ~/Code/Scripts/CLI_LINUX_dot-bash/.bash_files

Caution

Watch out for the spacing needed for Github README when you copy!

  1. Ensure script files are executable:
    chmod +x ~/Code/Scripts/CLI_LINUX_dot-bash/files/*.sh
  2. Reload shell:
    source ~/.bashrc

Dependencies

The scripts rely on these dependencies; so before using those, you need these installed on your system:

  • Core: bash, sed, awk, perl
  • Media: ffmpeg, ffprobe
  • Downloads: aria2c
  • CSV/XLSX: python3 + openpyxl (script can install via apt)
  • PHP/Laravel stack commands: php, composer, npm, project vendor/bin/*

1) Inlined Aliases (.bash_aliases)

These are direct aliases with no Bash function wrapper.

System

  • update: apt + flatpak + snap update pipeline.
  • cleancache: removes temp/update caches and vacuums journals to 7 days.
  • resnet: restarts network services and flushes DNS cache.

Laravel / PHP

  • cda: composer dump-autoload
  • art: php artisan
  • mfs: php artisan migrate:fresh --seed
  • opt: php artisan optimize:clear
  • dev: npm run dev
  • que: php artisan queue:work
  • pest: clears terminal then runs ./vendor/bin/pest

Git

  • oops: pull current branch with rebase from origin/<current-branch>.
  • chest: stash including untracked files (git stash push -u).
  • grit: merge origin/dev using -X theirs strategy option.
  • maiv: hard reset to origin/main then force-push with lease.
  • nometa: disable executable-bit tracking (core.fileMode false).

Warning

maiv is destructive (git reset --hard + force push). Use only when you intentionally want to discard local divergence.

Tooling

  • vsix: install npm deps then package extension via vsce package.
  • clodex: runs claude with CLAUDE_CODE_MAX_OUTPUT_TOKENS=1000000.

Custom

  • lara: enters the lara-stacker script directory and runs ./lara-stacker.sh.

2) Functioned Commands (.bash_functions)

These are real Bash functions (or function-wrapped aliases) for argument-aware behavior, or complex process possible failure...

System

  • own [path]: recursive chown to current user/group (defaults to current directory).

Laravel / Testing

  • bench [args...]: runs Testbench in local + APP_DEBUG=true.
  • pestbug [slowmo=400] [pest args...]: headed Playwright debug mode (HEADLESS=false PWDEBUG=1) and forwards arguments.

Git

  • girm <path>: git rm -r --cached for tracked file/dir untracking.
  • oopsie: pull-rebase current branch, rebase onto origin/main, then force-push with lease.

Tip

oops only rebases your current branch on origin/<current-branch> before pull, while oopsie also fetches and rebases that branch onto origin/main, then force-pushes with lease.

Note

In simple terms, use oops when push is rejected because your current remote branch moved (failed to push some refs / branch behind). And use oopsie when your branch is old compared to main and you need a clean rebase before PR; it rewrites history and force-pushes, so avoid it on actively shared branches.

Editors / Tools

  • code <path>: opens path in codium.
  • download <url...>: aria2c with aggressive segmented download flags.
  • permit <target>: runs the external lara-stacker helper at:
    /home/goodm4ven/Code/Scripts/CLI_LARAVEL_lara-stacker/scripts/helpers/permit.sh

3) Full Script Files (.bash_files -> files/*.sh)

These aliases point to standalone scripts in this repo.

Arabic

  • aranum: convert Western digits <-> Arabic-Indic digits.
    • Example: aranum 1234 -> ١٢٣٤
  • arastrip: removes harakat/combining marks and normalizes ٱ to ا.
    • Example: arastrip "أَيُّ سَمَاءٍ تُظِلُّنِي، أَوْ أَيُّ أَرْضٍ تُقِلُّنِي، إِنْ أَنَا قُلْتُ فِي كِتابِ اللَّهِ مَا لَا أَعْلَمُ؟" -> أي سماء تظلني، أو أي أرض تقلني، إن أنا قلت في كتاب الله ما لا أعلم؟

Media (FFmpeg)

  • vid-combine <file1..|list.txt> <output.mp4>: concatenates clips with timestamp normalization.
  • vid-compress [-1080|-720] [-lq] <input> [output]: H.265 compression with optional downscale and lower quality mode.
  • vid-eq-audio <input> [output]: denoise/EQ/loudness-normalized audio track.
  • vid-extract-audio <input> [start] [end] [output.mp3]: extracts audio (supports flexible timestamps).
  • vid-extract-video <input> [start] [end] [output.mp4]: extracts video segment with re-encode.
  • vid-pic <file|dir> [output_dir]: robust thumbnail generator with fallback strategies.
  • vid-trim <input> [start] [end] [output]: trims with inclusive end handling and safe output flags.

Utilities

  • unicode-csv <folder|file.csv>: CSV -> XLSX converter (auto-detects encoding/delimiter, RTL sheet formatting).
  • anyurl <url>: strips protocol, www., and trailing slash.

Credits


والحمد لله رب العالمين

About

A personal developer's collection of CLI scripts.

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Contributors

Languages