In daily development, operation and maintenance, and even simple system management, we will always encounter some “obviously small things, but particularly troublesome” operations: Want to quickly find a certain process? Want to format JSON? Want to see the parameters of your current JVM? Want to repeatedly execute a command to observe changes? These things can be solved by writing scripts, but it is a waste of time to write from scratch every time.
useful-scripts (GitHub: oldratlee/useful-scripts) was born to solve this “troublesome little thing”.
This is a scripting toolbox continuously maintained by developer oldratlee, which collects a large number of practical, concise, and directly usable scripts, mainly for programmers and operators in Linux/Mac environments. It’s not a framework, it’s not a huge toolkit — it’s a set of “Swiss Army knives on the go”.
Why do you need useful-scripts?
Because in the real world—especially on development machines and servers—high-frequency operations are often to:
- repetitive
- mechanical
- And you can’t make a mistake
These actions are extremely suitable for script automation, but we don’t want to rewrite them every time.
useful-scripts is to integrate these scripts that are “too lazy to write but really need” and solve them with one click.
Project features:
1. Small but fine script collection
Each script does only one thing, but it is done cleanly. For example:
json-format: Format JSONkill-by-name: Kill the process by namegit-undo: Quickly undo the commitrepeat: Execute commands in a loop to observe changesding: Automatically reminds you when the command is executed
The goal of all scripts is clear: to reduce repetition of labor and increase efficiency in your daily work.
2. Java and Shell scenario friendly
The author has a Java background, so there are quite a few JVM helper scripts in the project:
- Review the JVM startup parameters
- Print classpath
- JVM debug assistance
For Java engineers, this is almost a portable toolkit.
3. Easy to deploy and easy to use across platforms
- Support Linux / macOS
- Clone it and you can use it
- Basically, no additional dependencies are required
It is ideal for various environments such as servers, CI/CD, and development machines.
How should these scripts be viewed and used? (Key additions)
Many people will ask when they see this warehouse for the first time:
“There are so many scripts, how can I find and understand them quickly?”
In fact, it is very simple, in three ways:
Method 1: View directly on the GitHub page
Steps:
- Open the warehouse:
https://github.com/oldratlee/useful-scripts - Mainly look at
bin/the table of contents – most of the scripts are here. - Click on any script, such as
bin/json-format:- GitHub displays the script source code
- At the very top is usually an explanatory note (function + usage)
You can also use GitHub’s search bar to look up keywords, such as:
jsongitkilljvm
Quickly find the script you need.
Method 2: Clone the repository to view locally
If you are used to operating in the terminal:
git clone https://github.com/oldratlee/useful-scripts.git
cd useful-scripts
See the list of scripts:
ls bin
To view the contents of a script:
less bin/json-format
The script is usually written with detailed notes and is easy to read.
Method 3: Try to run the script directly (the fastest way to understand)
Add execution permissions to the script:
chmod +x bin/*
Temporarily join the PATH:
export PATH="$PWD/bin:$PATH"
For example, a json-formattrial :
echo '{"a":1,"b":2}' | json-format
The effect is clear at a glance.
There are 3 tips for determining what each script does
- Look at the comments at the top of the script (most commonly used)
- See if there is an introduction in the README or docs
- –help of the execution script
json-format --help
You can figure out what it is used for in just 10 seconds.
Why is it worth collecting?
Because it solves the “little troubles” that you really encounter every day. These scripts may only save you 10 seconds, but they add up to a year-long difference in efficiency.
useful-scripts is an experienced engineer who has compiled “high-frequency scripting tools accumulated over the years” for you to use.
How to get started?
git clone https://github.com/oldratlee/useful-scripts.git
cd useful-scripts
Then run the script as needed.
Github:https://github.com/oldratlee/useful-scripts
Tubing: