All Projects → thmsbfft → bash

thmsbfft / bash

Licence: MIT License
A collection of small bash utils.

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to bash

bat
Battery management utility for Linux laptops.
Stars: ✭ 107 (+613.33%)
Mutual labels:  utility
sc2gears
The COMPLETE (!) source code of the Sc2gears universe (Sc2gears app + Sc2gears Database + web-based parsing engine - bundled in an Eclipse project).
Stars: ✭ 30 (+100%)
Mutual labels:  utility
xbytes
Parse bytes to human readable sizes (4747) → ('4.75 KB') and vice versa.
Stars: ✭ 17 (+13.33%)
Mutual labels:  utility
osmicsx
An utility style framework for React Native
Stars: ✭ 162 (+980%)
Mutual labels:  utility
Isometry
📦 Sketch plugin that allows to create isometric projections from layers
Stars: ✭ 18 (+20%)
Mutual labels:  utility
Resource Monitor
Resource_Monitor is a GNOME Shell extension that Monitor the use of system resources like cpu, ram, disk, network and display them in GNOME Shell top bar.
Stars: ✭ 62 (+313.33%)
Mutual labels:  utility
google-photos-exif
A tool to populate missing `DateTimeOriginal` EXIF metadata in Google Photos takeout, using Google's JSON metadata.
Stars: ✭ 288 (+1820%)
Mutual labels:  utility
pynotify
A Python package to send emails like humans.
Stars: ✭ 21 (+40%)
Mutual labels:  utility
Shadbot
A configurable multipurpose bot bringing you music, multiplayer games, moderation commands and more!
Stars: ✭ 48 (+220%)
Mutual labels:  utility
Pagination-Utils
A collection of methods to make message pagination with JDA easier.
Stars: ✭ 20 (+33.33%)
Mutual labels:  utility
redtimer
RedTimer - Redmine Time Tracker
Stars: ✭ 59 (+293.33%)
Mutual labels:  utility
smcutil
SMC utility for modifying and examining Apple's SMC payloads.
Stars: ✭ 30 (+100%)
Mutual labels:  utility
MentalGL
Single header OpenGL utility library in the public domain
Stars: ✭ 20 (+33.33%)
Mutual labels:  utility
l2cu
L²CU: LDraw Linux Command line Utility
Stars: ✭ 14 (-6.67%)
Mutual labels:  utility
groupby
Group lines by a regex
Stars: ✭ 14 (-6.67%)
Mutual labels:  utility
deno-debug
Debugging utility for deno. Ported from https://npmjs.com/debug
Stars: ✭ 15 (+0%)
Mutual labels:  utility
pv
Unix Pipe Viewer (pv) utility in Node.js
Stars: ✭ 20 (+33.33%)
Mutual labels:  utility
diskusage
FANTASTIC SPEED utility to find out top largest folders/files on the disk.
Stars: ✭ 64 (+326.67%)
Mutual labels:  utility
pyGroff
laTEX is awesome but we are lazy -> groff with markdown syntax and inline code execution
Stars: ✭ 25 (+66.67%)
Mutual labels:  utility
YetAnotherKeyDisplayer
The application for displaying pressed keys of the keyboard
Stars: ✭ 88 (+486.67%)
Mutual labels:  utility

A collection of small bash utils.



general

Do something to every file in a folder:

#!/bin/bash
for filename in *; do
    echo "$filename"
done

Do something every 5s:

#!/bin/bash
while sleep 5
do    
    echo "yo"
done

Ask for parameters:

#!/bin/bash
read -p "Do it? (y/n) " doit

if [[ $doit == "y" || $doit == "Y" ]]; then
	echo "Do it"
else
	exit
fi

Use the clipboard:

# Print clipboard content to text file
pbpaste > file.txt

Get today's date (YYYY-MM-DD):

DATE=`date +%Y-%m-%d`

Ping an API:

Here, a simple script outputs the contrast ratio of white on a color. We use webaim.org’s API, and pipe the output into jq to read a value out of the resulting json. xargs echo -n can allow to strip whitespace after the result.

COLOR="$1"
curl -s https://webaim.org/resources/contrastchecker/\?fcolor\=FFFFFF\&bcolor\="$1"\&api | jq -r '.ratio'

Display a notification:

osascript -e 'display notification "Lorem ipsum dolor sit amet" with title "Title"'

tips

To use a script as an executable, change the extension to .command. This will start the script from /, though, so you might want to tell it to navigate to where the script is located before doing anything. Add cd "$(dirname "$0")" at the top of the script to do so. You'll also have to chmod 777 name_of_your_script.command to be able to execute it.

To use a script from anywhere, add it to /usr/local/bin/.

Command substitution allows to replace a command with its output, e.g. $(pwd) gives the value of pwd.


todo

  • Add utils for imagemagick
  • Add utils for ffmpeg

to explore

  • Script as a service (macOS)
  • "Daemons" & init scripts
  • Scripts in Alfred
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].