-
9 votes
-
Bats: Bash automated testing system for verifying that the UNIX programs you write behave as expected
8 votes -
kalua: an OpenWrt extension for building large mesh-networks
8 votes -
bashdb: a gdb-like debugger for Bash
10 votes -
How to write idempotent Bash scripts
7 votes -
Pure Bash bible: a collection of pure Bash alternatives to external processes
13 votes -
ShellCheck: a static analysis tool for shell scripts
25 votes -
Shellharden: a tool to semi-automate the rewriting of scripts to ShellCheck conformance
7 votes -
x86 assembler in Bash
15 votes -
FireHOL: an iptables stateful packet filtering firewall for humans
4 votes -
EasyBashGUI: a library of Bash functions to simplify adding GUIs to scripts
17 votes -
Amber: a high-level programming language that compiles to Bash
11 votes -
shite: the little hot-reloadin' static site generator from shell (assumes Bash 4.4+)
22 votes -
pass: the standard u̴n̴i̴x̴ Bash password manager
17 votes -
xz/liblzma: Bash-stage obfuscation explained
9 votes -
Bashible: an Ansible-like deployment and automation tool written in Bash
7 votes -
Steam Tinker Launch: a GUI Bash script for configuring custom launch options and companion programs for Steam games
9 votes -
pseudo3d: a raycaster in Bash
12 votes -
Bash Line Editor: a line editor written in pure Bash with syntax highlighting, auto suggestions, vim modes, etc
11 votes -
HTTP.sh: a web framework written entirely in Bash
20 votes -
ctypes.sh: a Bash plugin that provides a foreign function interface directly in your shell
10 votes -
A Slack clone in 5 lines of Bash
20 votes -
My thoughts on writing a Minecraft server from scratch (in Bash)
25 votes -
Some surprising code execution sources in Bash
11 votes -
Today I learned that Bash has hashmaps
23 votes -
nb: a command-line and local web note-taking, bookmarking, archiving, and knowledge base application, written in 119,172 lines of Bash
16 votes -
OpenGL bindings for Bash
21 votes -
Bashly: A command-line application (written in Ruby) that declaratively generates feature-rich Bash scripts
20 votes -
Bash++: Bash with classes
13 votes -
Sunsetting cursed terminal emulation
10 votes -
Fish 4.0: The Fish of Theseus
24 votes -
Share your personal dotfile treats and Unix tool recommendations
I am currently preparing for a new job and cleaning up my dotfile repository. During the process, I had the idea that it would be nice to create a list of amazing tools, aliases, functions, and...
I am currently preparing for a new job and cleaning up my dotfile repository. During the process, I had the idea that it would be nice to create a list of amazing tools, aliases, functions, and recommendations together.
I will start.
First, here is a list of nice tools to
apt-get install
orbrew install
that I can wholeheartedly recommend:nvim
is just an amazing text editor.fzf
is a very good fuzzy finder util. For example, you can quickly find files with it.eza
is a goodls
replacement (and the successor ofexa
).bat
is a great replacement forcat
with nice integrations and many options.stow
is great for managing your dotfiles. Thanks to @TangibleLight for telling me about it some while ago. I really love it.tmux
is a terminal multiplexer, i.e. you can have many sessions in one single terminal window. It's easy to use and super helpful. (When on a mac, I prefer iTerm tabs, though.)nvm
is practically a must if you are working with Node.glow
is an excellent markdown reader.tldr
is a niceman
replacement. (You must runtldr -u
after installing it to update available texts.)z
, an amazing tool for switching directories quickly.
Also, I can recommend Oh My ZSH! which I have been using for years.
Here is a small list of aliases I enjoy (I have 100+ aliases and I tried to pick some others may enjoy as well):
# Serve current dir alias serve="npx serve ." # What's my IP? alias ip="curl --silent --compressed --max-time 5 --url 'https://ipinfo.io/ip' && echo ''" # This should be the default alias mkdir="mkdir -p" # Nice git helpers alias amend="git add . && git commit --amend --no-edit" alias nuke="git clean -df && git reset --hard" # Make which more powerful which='(alias; declare -f) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot' # This saves so many keystrokes, honestly alias -- +x="chmod +x" # Turns your path into a nice list and prints it alias path='echo -e ${PATH//:/\\n}' # Map over arguments and run a command # Usage: map <command> # Example: ls | map cat alias map="xargs -n1"
And, finally, here are some fun functions:
# Get cheat sheets for almost anything! # https://github.com/chubin/cheat.sh cheat() { WITH_PLUS=$(echo $@ | sed 's/ /+/g') CAT_TOOL=$(command -v batcat || command -v bat || command -v cat) curl "cheat.sh/$WITH_PLUS" | $CAT_TOOL } # Send everything to /dev/null nullify() { "$@" >/dev/null 2>&1 } # Create a new dir and enter it mk() { mkdir -p "$@" && cd "$_" } # Create a data URL from a file # Source: https://github.com/mathiasbynens/dotfiles/blob/master/.functions data-url() { local mimeType=$(file -b --mime-type "$1"); if [[ $mimeType == text/* ]]; then mimeType="${mimeType};charset=utf-8"; fi echo "data:${mimeType};base64,$(openssl base64 -in "$1" | tr -d '\n')"; }
74 votes -
best way to go about with a script that seems to need both bash and python functionality
Gonna try and put this into words. I am pretty familiar with bash and python. used both quite a bit and feel more or less comfortable with them. My issue is I often do a thing where if I want to...
Gonna try and put this into words.
I am pretty familiar with bash and python. used both quite a bit and feel more or less comfortable with them.
My issue is I often do a thing where if I want to accomplish a task that is maybe a bit complex, I feel like I have to wind up making a script, let's call it
hello_word.sh
but then I also make a script called.hello_world.py
and basically what I do is almost the first line of the bash script, I call the python script like
./hello_world.py $@
and take advtange of theargparse
library in python to determine what the user wants to do amongst other tasks that are easier to do in python like for loops and etc.I try to do the meat of the logic in the python scripts before I write to an
.env
file from it and then in the bash script, I will doset -o allexport source "${DIR}"/"${ENV_FILE}" set +o allexport
and then use the variable from that env file to do the rest of the logic in bash.
why do I do anything in bash?
cause I very much prefer being able to see a terminal command being executed in real-time and see what it does and be able to
Ctrl+c
if I see the command go awry.in python, you can run a command with
subprocess
or other similar system libraries but you can't get the output in real-time or terminate a command preemptively and I really hate that. you have to wait for the command to end to see what happened.But I feel like there is something obvious I am missing (like maybe bash has an argparse library I don't know about and there is some way to inject the concept of types into it) or if there is another language entirely that fits my needs?
6 votes -
Critical vulnerability in Rust's Command library allows for command injection when using its API to invoke batch scripts with arguments on Windows systems (CVE-2024-24576)
18 votes -
Atuin - SQLite-based shell history
29 votes -
Sensible $WORDCHARS for Most Developers
16 votes -
I made a pass-like password manager thingy
8 votes -
Dead simple cross platform home manager with flakes
9 votes -
bkt - Memoizing calls in shell scripts
2 votes -
mkws - A simple static site generator
12 votes -
Linux Privilege Escalation - Three Easy Ways to Get a Root Shell
9 votes -
How to build a quick and dirty subtitle player
On my desk I have two screens -- one off to the side for movies, TV, etc and my main in front. Sometimes I find myself wanting subtitles on my main screen. The main issue I've found, at least with...
On my desk I have two screens -- one off to the side for movies, TV, etc and my main in front. Sometimes I find myself wanting subtitles on my main screen. The main issue I've found, at least with macOS, is that the SRT players suck.
I figured, why not just generate a tiny black video with embedded subtitles?
ffmpeg -i subs.srt -t 3:00:00 -s 40x10 -f rawvideo -pix_fmt rgb24 -r 25 -i /dev/zero subs.mpeg
Set the ratio to be super small without being too small. This video is 40px by 10px and the video only takes a few seconds to generate. For me, this generated at ~850x speed.
From there, jack up the subtitle font size and shift it up a little bit so nothing gets cut off. This also works really well with tiling window managers.
11 votes -
Write once, build anywhere
8 votes -
Oil 0.8.pre4: The Biggest Shell Programs in the World
7 votes -
Sinx for dumb data aggregation
3 votes -
Shit, An implementation of git in (almost) pure POSIX shell
13 votes -
Powerlevel10k: A Zsh Theme
7 votes -
Beware of shell globs
9 votes -
What terminal emulator do you use?
What are your experiences with your current terminal emulator or former ones? What makes you use your current terminal emulator? What shell do you use?
16 votes -
Typesetting Markdown Blog: What Next?
Some of you have read the Typesetting Markdown blog series (https://dave.autonoma.ca/blog/). The plan was to finish the last two parts with Annotated Text (basically markup for Markdown) and...
Some of you have read the Typesetting Markdown blog series (https://dave.autonoma.ca/blog/). The plan was to finish the last two parts with Annotated Text (basically markup for Markdown) and Figure Drawing (MetaPost); however, people have asked for a post on Markdown to EPUB, others have asked for high-quality PDF theme templates using ConTeXt, and some have requested rendering Markdown into HTML.
Within the realm of Markdown, digital documentation, typesetting with ConTeXt, R, externalized interpolated strings, and bash scripting, what would interest you for the next post in the series?
(Please flip through the blog series to see the topics that have been covered.)
3 votes