example.com/path/to/article
000 points · username · 0 hours ago
example.com1341 points · 389 comments · 1 year ago · speckx
aktau
latexr
trash a.txt b.png moves `a.txt` and `b.png` to the trash. Supports macOS and Linux.
The way you’re doing it trashes files sequentially, meaning you hear the trashing sound once per file and ⌘Z in the Finder will only restore the last one. You can improve that (I did it for years) but consider just using the `trash` commands which ships with macOS. Doesn’t use the Finder, so no sound and no ⌘Z, but it’s fast, official, and still allows “Put Back”.
jsonformat takes JSON at stdin and pretty-prints it to stdout.
Why prioritise node instead of jq? The latter is considerably less code and even comes preinstalled with macOS, now.
uuid prints a v4 UUID. I use this about once a month.
Any reason to not simply use `uuidgen`, which ships with macOS and likely your Linux distro?
soiltype
What's always interesting to me is how many of these I'll see and initially think, "I don't really need that." Because I'm well aware of the effect (which I'm sure has a name - I suppose it's similar to induced demand) of "make $uncommon_task much cheaper" -> "$uncommon_task becomes the basis of an entirely new workflow/skill". So I'm going to try out most of them and see what sticks!
Also: really love the style of the post. It's very clear but also includes super valuable information about how often the author actually uses each script, to get a sense ahead of time for which ones are more likely to trigger the effect described above.
A final aside about my own workflows which betrays my origins... for some of these operations and for others i occasionally need, I'll just open a browser dev tools window and use JS to do it, for example lowercasing a string :)
oceanplexian
- When I was a fresh engineer I used a pretty vanilla shell environment
- When I got a year or two of experience, I wrote tons of scripts and bash aliases and had a 1k+ line .bashrc the same as OP
- Now, as a more tenured engineer (15 years of experience), I basically just want a vanilla shell with zero distractions, aliases or scripts and use native UNIX implementations. If it's more complicated than that, I'll code it in Python or Go.
elric
Over time that's grown to an @foo script for every project I work on, every place I frequent that has some kind of specific setup. They are prefixed with an @ because that only rarely conflicts with anything, and tab-complete helps me remember the less frequently used ones.
The @project scripts setup the whole environment, alias the appropriate build tools and versions of those tools, prepare the correct IDE config if needed, drop me in the project's directory, etc. Some start a VPN connection because some of my clients only have git access over VPN etc.
Because I've worked on many things over many years, most of these scripts also output some "help" output so I can remember how shit works for a given project.
Here's an example:
# @foo
PROJECT FOO
-----------
VPN Connection: active, split tunnel
Commands:
tests: mvn clean verify -P local_tests
build all components: buildall
Tools:
java version: 17.0.16-tem
maven version: 3.9.11
Edit: a word on aliases, I frequently alias tools like maven or ansible to include config files that are specific to that project. That way I can have a .m2 folder for every project that doesn't get polluted by other projects, I don't have to remember to tell ansible which inventory file to use, etc. I'm lazy and my memory is for shit.southwindcg
sed -n 2p file
prints the second line of file. The advantage sed has over this line script is it can also print more than one line, should you need to: sed -n 2,4p file
prints lines 2 through 4, inclusive.alberand
# ex - archive extractor
# usage: ex <file>
function ex() {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.tar.xz) tar xf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1;;
*.7z) 7z x $1 ;;
*) echo "'$1' cannot be extracted via ex()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}Noumenon72
alias vz="vim ~/.zshrc && . ~/.zshrc"
I alias mdfind to grep my .docx files on my Mac: docgrep() {
mdfind "\"$@\"" -onlyin /Users/xxxx/Notes 2> >(grep --invert-match ' \[UserQueryParser\] ' >&2) | grep -v -e '/Inactive/' | sort
}
I use an `anon` function to anonymize my Mac clipboard when I want to paste something to the public ChatGPT, company Slack, private notes, etc. I ran it through itself before pasting it here, for example. anonymizeclipboard() {
my_user_id=xxxx
account_ids="1234567890|1234567890" #regex
corp_words="xxxx|xxxx|xxxx|xxxx|xxxx" #regex
project_names="xxxx|xxxx|xxxx|xxxx|xxxx" # regex
pii="xxxx|xxxx|xxxx|xxxx|xxxx|xxxx" # regex
hostnames="xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx" # regex
# anonymize IPs
pbpaste | sed -E -e 's/([0-9]{1,3})\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/\1.x.x.x/g' \
-e "s/(${corp_words}|${project_names}|${my_user_id}|${pii}|${hostnames})/xxxx/g" -e "s/(${account_ids})/1234567890/g" | pbcopy
pbpaste
}
alias anon=anonymizeclipboard
It prints the new clipboard to stdout so you can inspect what you'll be pasting for anything it missed.dannyobrien
Otherwise, I am happy to be pulled into your discussion, Marshall McLuhan style[3] to adjudicate, for a very reasonable fee.
[1] https://craphound.com/lifehacksetcon04.txt
[2] https://archive.org/details/Notcon2004DannyOBrienLifehacks
[3] https://www.openculture.com/2017/05/woody-allen-gets-marshal...
andai
The flags are for maximum compatibility (e.g. without them, some MP4s don't play in WhatsApp, or Discord on mobile, or whatever.)
ffmp4() {
input_file="$1"
output_file="${input_file%.*}_sd.mp4"
ffmpeg -i "$input_file" -c:v libx264 -crf 33 -profile:v baseline -level 3.0 -pix_fmt yuv420p -movflags faststart "$output_file"
echo "Compressed video saved as: $output_file"
}
ffmp4 foo.webm-> foo_sd.mp4
fftime() {
input_file="$1"
output_file="${input_file%.*}_cut.mp4"
ffmpeg -i "$input_file" -c copy -ss "$2" -to "$3" "$output_file"
echo "Cut video saved as: $output_file"
}
fftime foo.mp4 01:30 01:45-> foo_cut.mp4
Note, fftime copies the audio and video data without re-encoding, which can be a little janky, but often works fine, and can be much (100x) faster on large files. To re-encode just remove "-c copy"
abetusk
I tend to try to not get too used to custom "helper" scripts because I become incapacitated when working in other systems. Nevertheless, I really appreciate all these scripts if nothing else than to see what patterns other programmers pick up.
My only addition is a small `tplate` script that creates HTML, C, C++, Makefile, etc. "template" files to start a project. Kind of like a "wizard setup". e.g.
$ tplate c
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
}
And of course, three scripts `:q`, `:w` and `:wq` that get used surprisingly often: $ cat :q
#!/bin/bash
echo "you're not in vim"SoftTalker
sed, awk, grep, and xargs along with standard utilities get you a long long way.
yipbub
I have almost the same, but differently named with scratch(day), copy(xc), markdown quote(blockquote), murder, waitfor, tryna, etc.
I used to use telegram-send with a custom notification sounnd a lot for notifications from long-running scripts if I walked away from the laptop.
I used to have one called timespeak that would speak the time to me every hour or half hour.
I have go_clone that clones a repo into GOPATH which I use for organising even non-go projects long after putting go projects in GOPATH stopped being needed.
I liked writing one-offs, and I don't think it's premature optimization because I kept getting faster at it.
o11c
#!/bin/sh
if test "$#" != 2
then
echo 'Error: unmv must have exactly 2 arguments'
exit 1
fi
exec mv "$2" "$1"Noumenon72
ocr my_image.png extracts text from an image and prints it to stdout. It only works on macOS
The Mac Shortcut at https://github.com/e-kotov/macos-shortcuts lets you select a particular area of the screen (as with Cmd-Shift-4) and copies the text out of that, allowing you to copy exactly the text you need from anywhere on your screen with one keyboard shortcut. Great for popups with unselectable text, and copying error messages from coworkers' screenshares.
WA
function unix() {
if [ $# -gt 0 ]; then
echo "Arg: $(date -r "$1")"
fi
echo "Now: $(date) - $(date +%s)"
}
Prints the current date as UNIX timestamp. If you provide a UNIX timestamp as arg, it prints the arg as human readable date.arjie
#!/usr/bin/env bash
# ~/bin/,dehex
echo "$1" | xxd -r -p
and #!/usr/bin/env bash
# ~/bin/,ht
highlight() {
# Foreground:
# 30:black, 31:red, 32:green, 33:yellow, 34:blue, 35:magenta, 36:cyan
# Background:
# 40:black, 41:red, 42:green, 43:yellow, 44:blue, 45:magenta, 46:cyan
escape=$(printf '\033')
sed "s,$2,${escape}[$1m&${escape}[0m,g"
}
if [[ $# == 1 ]]; then
highlight 31 $1
elif [[ $# == 2 ]]; then
highlight 31 $1 | highlight 32 $2
elif [[ $# == 3 ]]; then
highlight 31 $1 | highlight 32 $2 | highlight 35 $3
elif [[ $# == 4 ]]; then
highlight 31 $1 | highlight 32 $2 | highlight 35 $3 | highlight 36 $4
fi
I also use the comma-command pattern where I prefix my personal scripts with a `,` which allows me to cycle between them fast etc.One thing I have found that's worth it is periodically running an aggregation on one's history and purging old ones that I don't use.
internet_points
# High level examples
run_some_command | clip
clip > file_from_my_clipboard.txt
# Copy a file's contents
clip < file.txt
# indent for markdown:
$ clip|sed 's/^/ /'|clipjrm4
Like, it's okay -- even good -- for the tools to bend to the user and not the other way around.
vilhelmen
#!/usr/bin/perl
# http://stackoverflow.com/a/9790056
use List::Util qw(max min sum);
@a=();
while(<>){
$sqsum+=$_*$_;
push(@a,$_)
};
$n=@a;
$s=sum(@a);
$a=$s/@a;
$m=max(@a);
$mm=min(@a);
$std=sqrt($sqsum/$n-($s/$n)*($s/$n));
$mid=int @a/2;
@srtd=sort @a;
if(@a%2){
$med=$srtd[$mid];
}else{
$med=($srtd[$mid-1]+$srtd[$mid])/2;
};
print "records:$n\nsum:$s\navg:$a\nstd:$std\nmed:$med\max:$m\nmin:$mm";dcassett
# If this is an xterm set the title to the directory stack
case "$TERM" in
xterm*|rxvt*)
if [ -x ~/bin/shorten-ds.pl ]; then
PS1="\[\e]0;\$(dirs -v | ~/bin/shorten-ds.pl)\a\]$PS1"
else
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
fi
;;
\*)
;;
esac
The script shorten_ds.pl takes e.g. 0 /var/log/apt
1 ~/Downloads
2 ~
and shortens it to: 0:apt 1:Downloads 2:~
#!/usr/bin/perl -w
use strict;
my @lines;
while (<>) {
chomp;
s%^ (\d+) %$1:%;
s%:.*/([^/]+)$%:$1%;
push @lines, $_
}
print join ' ', @lines;
That coupled with functions that take 'u 2' as shorthand for 'pushd +2' and
'o 2' for 'popd +2' make for easy manipulation of the directory stack: u() {
if [[ $1 =~ ^[0-9]+$ ]]; then
pushd "+$1"
else
pushd "$@"
fi
}
o() {
if [[ $1 =~ ^[0-9]+$ ]]; then
popd "+$1"
else
popd "$@" # lazy way to cause an error
fi
}chasil
$ cat /usr/local/bin/awkmail
#!/bin/gawk -f
BEGIN { smtp="/inet/tcp/0/smtp.yourco.com/25";
ORS="\r\n"; r=ARGV[1]; s=ARGV[2]; sbj=ARGV[3]; # /bin/awkmail to from subj < in
print "helo " ENVIRON["HOSTNAME"] |& smtp; smtp |& getline j; print j
print "mail from:" s |& smtp; smtp |& getline j; print j
if(match(r, ","))
{
split(r, z, ",")
for(y in z) { print "rcpt to:" z[y] |& smtp; smtp |& getline j; print j }
}
else { print "rcpt to:" r |& smtp; smtp |& getline j; print j }
print "data" |& smtp; smtp |& getline j; print j
print "From:" s |& smtp; ARGV[2] = "" # not a file
print "To:" r |& smtp; ARGV[1] = "" # not a file
if(length(sbj)) { print "Subject: " sbj |& smtp; ARGV[3] = "" } # not a file
print "" |& smtp
while(getline > 0) print |& smtp
print "." |& smtp; smtp |& getline j; print j
print "quit" |& smtp; smtp |& getline j; print j
close(smtp) } # /inet/protocol/local-port/remote-host/remote-portsdovan1
alias v='nvim'
alias vv='f=$(fzf --preview-window "right:50%" --preview "bat --color=always {1}"); test -n "$f" && v "$f"'
alias vvv='f=$(rg --line-number --no-heading . | fzf -d: -n 2.. --preview-window "right:50%:+{2}" --preview "bat --color=always --highlight-line {2} {1}"); test -n "$(echo "$f" | cut -d: -f1)" && v "+$(echo "$f" | cut -d: -f2)" "$(echo "$f" | cut -d: -f1)"'bemmu
So if you're in your projects folder and want to keep working on your latest project, I just type "cdn" to go there.
GNOMES
Ex:
> echo $PWD
/foo/bar/batz/abc/123
> dc bar && echo $PWD
/foo/bar
Useful for times when I don't want to type a long train of dot slashes(ex. cd ../../..).Also useful when using Zoxide, and I tab complete into a directory tree path where parent directories are not in Zoxide history.
Added tab complete for speed.
revicon
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias ......='cd ../../../../..'
alias .......='cd ../../../../../..'
nberkman
clippy image.png # then paste into Slack, etc. as upload
clippy -r # copy most recent download
pasty # copy file in Finder, then paste actual file here
https://github.com/neilberkman/clippy / brew install clippyinterestica
I use this as a bookmarklet to grab the front page of the new york times (print edition). (You can also go back to any date up to like 2011)
I think they go out at like 4 am. So, day-of, note that it will fail if you're in that window before publishing.
javascript:(()=>{let d=new Date(new Date().toLocaleString('en-US',{timeZone:'America/New_York'})),y=d.getFullYear(),m=('0'+(d.getMonth()+1)).slice(-2),g=('0'+d.getDate()).slice(-2);location.href=`https://static01.nyt.com/images/${y}/${m}/${g}/nytfrontpage/scan.pdf`})()alentred
alphabet just prints the English alphabet in upper and lowercase. I use this surprisingly often (probably about once a month)
I genuinely wonder, why would anyone want to use this, often?
a_e_k
It occurred to me that it would be more useful to me in Emacs, and that might make a fun little exercise.
And that's how I discovered `M-x nato-region` was already a thing.
briansm
helicaltwine
andai
alias mpa='mpv --no-video'
mpa [youtube_url]
I use this to listen to music / lectures in the terminal.I think it needs yt-dlp installed — and reasonably up to date, since YouTube keeps breaking yt-dlp... but the updates keep fixing it :)
linsomniac
I have used it to build an "escmd" tool for interacting with Elasticsearch. It makes the available commands much more discoverable, the output it formats in tables, and gets rid of sending JSON to a curl command.
A variety of small tools that interact with Jira (list my tickets, show tickets that are tagged as needing ops interaction in the current release).
A tool to interact with our docker registry to list available tags and to modify tags, including colorizing them based on the sha hash of the image so it's obvious which ones are the same. We manage docker container deploys based on tags so if we "cptag stg prod" on a project, that releases the staging artifact to production, but we also tag them by build date and git commit hash, so we're often working with 5-7 tags.
Script to send a "Software has successfully been released" message via gmail from the command-line.
A program to "waituntil" a certain time to run a command: "waituntil 20:00 && run_release", with nice display of a countdown.
I have a problem with working on too many things at once and then committing unrelated things tagged with a particular Jira case. So I had it write me a commit program that lists my tickets, shows the changed files, and lets me select which ones go with that ticket.
All these are things I could have built before, but would have taken me hours each. With the GenAI, they take 5-15 minutes of my attention to build something like this. And Gen AI seems really, really great at building these small, independent tools.
WhyNotHugo
cpwd copies the current directory to the clipboard. Basically pwd | copy. I often use this when I’m in a directory and I want use that directory in another terminal tab; I copy it in one tab and cd to it in another. I use this once a day or so.
You can configure your shell to notify the terminal of directory changes, and then use your terminal’s “open new window” function (eg: ctrl+shift+n) to open a new window retaining the current directory.
chamomeal
spiffyk
url "$my_url" parses a URL into its parts. I use this about once a month to pull data out of a URL, often because I don’t want to click a nasty tracking link.
This sounds pretty useful!
Coincidentally, I have recently learned that Daniel Stenberg et al (of cURL fame) wrote trurl[1], a libcurl-based CLI tool for URL parsing. Its `--json` option seems to yield similar results as TFA's url, if slightly less concise because of the JSON encoding. The advantage is that recent releases of common Linux distros seem to include trurl in their repos[2].
sedatk
`rn` prints the current time and date using date and cal.
And you can type `rn -rf *` to see all timezones recursively. :)
Tempest1981
alphabet just prints the English alphabet in upper and lowercase. I use this surprisingly often
I'm curious to hear some examples (feel like I'm missing out)
internet_points
Also re: alphabet
$ echo {a..z}
a b c d e f g h i j k l m n o p q r s t u v w x y zsorenjan
cool-RR
$ posh /home/ramrachum/Dropbox/notes.txt
$DX/notes.txt
Of course, it only becomes useful when you define a bunch of environment variables for the paths that you use often.I use this a lot in all of my scripts. Basically whenever any of my script prints a path, it passes it through `posh`.
javier123454321
lolive
[that, plus LinkHint plugin for Firefox, and i3 for WM is my way to go for a better life]
fragmede
greenpizza13
cshores
Heres my script if anyone is interested in as I find it to be incredibly useful.
find . -type f \( -name ".tf" -o -name ".tfvars" -o -name ".json" -o -name ".hcl" -o -name ".sh" -o -name ".tpl" -o -name ".yml" -o -name ".yaml" -o -name ".py" -o -name ".md" \) -exec sh -c 'for f; do echo "### FILE: $f ###"; cat "$f"; echo; done' sh {} +
lillesvin
Like, I'd have to remember both `prettypath` and `sed`, and given that there's hardly any chance I'll not need `sed` in other situations, I now need to remember two commands instead of one.
On top of that `prettypath` only does s/:/\\n/ on my path, not on other strings, making its use extremely narrow. But generally doing search and replace in a string is incredibly useful, so I'd personally rather just use `sed` directly and become more comfortable with it. (Or `perl`, but the point is the same.)
As I said, that's obviously just my opinion, if loads of custom scripts/commands works for you, all the more power to you!
hyperman1
So 'p ISSUE-123' :
* creates a folder issues/ISSUE-123 for work files, containing links to a backed up folder and the project repository . The shell is cd'd to it
* The repo might get a new branch with the issue name.
* An IDE might start containing the project.
* The browsers home button brings you to a page with all kinds of relevant links:. The issue tracker, the CI, all kinds of test pages, etc...
* The open/save dialogs for every program gets a shortcut named'issue'
* A note is made in a log that allows me to do time tracking at the end if the week.
* A commit message template with the issue is created.
0xbadcafebee
brainzap
and alias debian="docker run -it --rm -v $(pwd):/mnt/host -w /mnt/host --name debug-debian debian"
yellowapple
On every machine of mine I tend to accumulate a bunch of random little scripts along these lines in my ~/.local/bin, but I never seem to get around to actually putting them anywhere. Trying to knock that habit by putting any new such scripts in a “snippets” repo (https://fsl.yellowapple.us/snippets); ain't a whole lot in there yet, but hopefully that starts to change over time.
some_guy_nobel
Here are some super simple ones I didn't see that I use almost every day:
cl="clear"
g="git"
h="history"
ll="ls -al"
path='echo -e ${PATH//:/\\n}'
lv="live-server"
And for common navigation:
dl="cd ~/Downloads"
dt="cd ~/Desktop"
hiq
As an aside, I find most of these commands very long. I tend to use very short aliases, ideally 2 characters. I'm assuming the author uses tab most of the time, if the prefixes don't overlap beyond 3 characters it's not that bad, and maybe the history is more readable.
amterp
Folks interested in scripting like this might like this tool I'm working on https://github.com/amterp/rad
Rad is built specifically for writing CLI scripts and is perfect for these sorts of small to medium scripts, takes a declarative approach to script arguments, and has first-class shell command integration. I basically don't write scripts in anything else anymore.
rcarmo
vunderba
haskellshill
`nato bar` returns Bravo Alfa Romeo. I use this most often when talking to customer service and need to read out a long alphanumeric string, which has only happened a couple of times in my whole life. But it’s sometimes useful!
Even more useful is just learning the ICAO Spelling Alphabet (aka NATO Phonetic Alphabet, of which it is neither). It takes like an afternoon and is useful in many situations, even if the receiver does not know it.
sid-
zeckalpha
jsonformat -> jq
running -> pgrep
exasperaited
I set this stuff up so long ago I sort of forgot that I did it at all; it's like a standard feature. I have to remember I did it.
pmontra
A password or token generator, simple or complicated random text.
Scripts to list, view and delete mail messages inside POP3 servers
n, to start Nautilus from terminal in the current directory.
lastpdf, to open the last file I printed as PDF.
lastdownload, to view the names of the n most recent files in the Downloads directory.
And many more but those are the ones that I use often and I remember without looking at ~/bin
sitebolts
They're not all necessarily the most efficient/proper way to accomplish a task, but they're nice to have on hand and be able to quickly share.
Admittedly, their usefulness has been diminished a bit since the rise of LLMs, but they still come in handy from time to time.
nullgeo
kp () {
if [ -z "$1" ] then
echo "Usage: kp <port>"
return 1
fi
lsof -nP -iTCP:"$1" -sTCP:LISTEN | awk 'NR>1 {print $2}' | xargs kill -9
}teo_zero
echo 1 2 3 | each "rm {}"
is the same as rm 1
rm 2
rm 3
while echo 1 2 3 | xargs rm
is the same as rm 1 2 3
I would rather say that 'each' replaces (certain uses of) 'for': for i in 1 2 3; do rm $i; donexiphias2
Anyways, my favourite alias that I use all the time is this:
alias a='nvim ~/.zshrc && . ~/.zshrc'
It solves the ,,not loaded automatically'' part at least for the current terminal1vuio0pswjnm7
This can be replaced with
sed -n $1p\;$1q
Test it versus
head -$1|tail -1
[deleted]
wiether
There also some very niche stuff that I won't use but found funny
jimmySixDOF
[deleted]
jwsteigerwalt
omnster
hughdbrown
desireco42
botverse
`alias clip="base64 | xargs -0 printf '\e]52;c;%s\007'"`
It just sends it to the client’s terminal clipboard.
`cat thing.txt | clip`
liqilin1567
apricot13
internet_points
frodo8sam
headgasket
SuperHeavy256
CrimpCity
panki27
lt () { ls --color=always -lt ${1} | head }vzaliva
encom
senderista
PUSH_AX
naikrovek
wifi toggle
this fella doesn't know what "toggle" means. in this context, it means "turn off if it's currently on, or turn on if it's currently off."
this should be named `wifi cycle` instead. "cycle" is a good word for turning something off then on again.
naming things is hard, but it's not so hard that you can't use the right word. :)
_gmkt
czertyaka
yegle
^ (jump to the beginning)
ctrl+v (block selection)
j (move cursor down)
shift+i (bulk insert?)
type ><space>
ESC
thibran
blackhaj7
blackhaj7
akullpp
alias df='duf'
alias ls='eza'
alias ll='eza -l'
alias cat='bat'
alias cap='bat -p'
alias man='tldr'
alias top='glances'
alias grep='rg'
alias ps='procs'
alias cd='z'
alias g='gitui'
alias gs='git st'
alias gp='git pull'
alias gu='git add . && git commit -m "Update" && git push'
alias check='shellcheck'
alias v='nvim'
alias len='wc -l'
alias uuid='uuidgen'
alias src='source ~/.zshrc'
indigodaddy
https://gist.github.com/jgbrwn/7dd4b262c544f750cb0291161b2ec...
(actually avoids having to do a one liner like: for h in {1..5}; do dig +short A mail”${h}”.domain.com @1.1.1.1 )
Hmm speaking of which I need to add in support for using a specific DNS server
merksoftworks
hshdhdhehd
E.g. cat --copy
weregiraffe
ttflee
kwar13
duncangh
progforlyfe
munchlax
banku_brougham
holyknight
samtrack2019
It memoizes the command passed to it.
Manually clearing it (for example if I know the underlying data has changed: In-pipeline memoization (includes the input in the hash of the lookup): This allows me to rapidly iterate on shell pipelines. The main goal is to minimize my development latency, but it also has positive effects on dependencies (avoiding redundant RPC calls). The classic way of doing this is storing something in temporary files: But I find this awkward, and makes it harder than necessary to experiment with the expensive command itself. Both of those will run curl once.NOTE: Currently environment variables are not taken into account when hashing.