All Projects → slavaGanzin → await

slavaGanzin / await

Licence: MIT license
28Kb, small memory footprint, single binary that run list of commands in parallel and waits for their termination

Programming Languages

c
50402 projects - #5 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to await

coderun
⏯️ Code runner CLI that can run any languages
Stars: ✭ 23 (-68.49%)
Mutual labels:  posix, runner
python-appium-framework
Complete Python Appium framework in 360 degree
Stars: ✭ 43 (-41.1%)
Mutual labels:  parallel, runner
Flowa
🔥Service level control flow for Node.js
Stars: ✭ 66 (-9.59%)
Mutual labels:  parallel, runner
Iterm Fish Fisher Osx
Complete guide and Bash script to install Command Line Tools + Homebrew + iTerm2 + Fish Shell + Fisher + Plugins for development purposes
Stars: ✭ 249 (+241.1%)
Mutual labels:  fish
dotfiles
My NixOS configuration featuring awesome and neovim
Stars: ✭ 40 (-45.21%)
Mutual labels:  fish
snmpman
Easy massive SNMP-agent simulation with the use of simple YAML files
Stars: ✭ 28 (-61.64%)
Mutual labels:  parallel
Java-AgentSpeak
LightJason - AgentSpeak(L++) for Java
Stars: ✭ 21 (-71.23%)
Mutual labels:  parallel
Silver
A cross-shell customizable powerline-like prompt with icons
Stars: ✭ 238 (+226.03%)
Mutual labels:  fish
QshOni
The QShell on IBM i library contains useful CL wrapper commands to allow QShell and PASE apps to be called and consumed from regular IBM i jobs via CL, RPG or COBOL programs.
Stars: ✭ 34 (-53.42%)
Mutual labels:  runner
UnityCLI
Unity TCP CLI communication for debugging
Stars: ✭ 22 (-69.86%)
Mutual labels:  util
MatlabProgressBar
This MATLAB class provides a smart progress bar like tqdm in the command window and is optimized for progress information in simple iterations or large frameworks with full support of parallel parfor loops provided by the MATLAB Parallel Computing Toolbox.
Stars: ✭ 44 (-39.73%)
Mutual labels:  parallel
IPpy
🚀 Ping IP addresses and domains in parallel to find the accessible and inaccessible ones.
Stars: ✭ 54 (-26.03%)
Mutual labels:  parallel
bc
An implementation of the POSIX bc calculator with GNU extensions and dc, moved away from GitHub. Finished, but well-maintained.
Stars: ✭ 115 (+57.53%)
Mutual labels:  posix
Starship
☄🌌️ The minimal, blazing-fast, and infinitely customizable prompt for any shell!
Stars: ✭ 20,504 (+27987.67%)
Mutual labels:  fish
pacstall
An AUR-inspired package manager for Ubuntu
Stars: ✭ 842 (+1053.42%)
Mutual labels:  fish
Plugin Git
Git plugin for Oh My Fish (similar to oh-my-zsh git)
Stars: ✭ 240 (+228.77%)
Mutual labels:  fish
parallel-event-emitter
Parallel event emitter built on futures-rs
Stars: ✭ 29 (-60.27%)
Mutual labels:  parallel
go-sysconf
sysconf for Go, without using cgo
Stars: ✭ 119 (+63.01%)
Mutual labels:  posix
distrobox
Use any linux distribution inside your terminal. Enable both backward and forward compatibility with software and freedom to use whatever distribution you’re more comfortable with. Mirror available at: https://gitlab.com/89luca89/distrobox
Stars: ✭ 4,371 (+5887.67%)
Mutual labels:  posix
bfetch
📠 Dynamic fetch displayer that SuperB
Stars: ✭ 114 (+56.16%)
Mutual labels:  posix

await

28Kb, small memory footprint, single binary that run list of commands in parallel and waits for their termination

documentation

linux install

curl https://i.jpillora.com/slavaGanzin/await! | bash

With await you can:

Take action on specific file type changes

await 'stat **.c' --change --forever --exec 'gcc *.c -o await -lpthread'
# you can filter with:
`stat --format '%n %z' **; | grep -v node_modules`

Wait for FAANG to fail

await 'whois facebook.com' \
      'nslookup apple.com' \
      'dig +short amazon.com' \
      'sleep 1 | telnet netflix.com 443 2>/dev/null' \
      'http google.com' --fail

Notify yourself when your site down

await "curl 'https://whatnot.ai' &>/dev/null && echo UP || echo DOWN" \
      --forever --change --exec "ntfy send 'whatnot.ai \1'"

Use as concurrently

await "stylus --watch --compress --out /home/vganzin/work/whatnot/front /home/vganzin/work/whatnot/front/index.styl" \
      "pug /home/vganzin/work/whatnot/front/index.pug --out /home/vganzin/work/whatnot/front --watch --pretty 2>/dev/null" --forever --stdout --silent

Substitute while substituting

await 'echo -n 10' 'echo -n $RANDOM' 'expr \1 + \2' --exec 'echo \3' --forever --silent

Furiously wait for new iPhone in background process

await 'curl "https://www.apple.com/iphone/" -s | pup ".hero-eyebrow text{}" | grep -v 12' --interval 1000 --change --daemon --exec 'ntfy send "\1"'

Restart database and connect immediately after it become fully functional

sudo systemctl restart redis; await 'socat -u OPEN:/dev/null UNIX-CONNECT:/tmp/redis.sock' --exec 'redis-cli -s /tmp/redis.sock'

--help

await [arguments] commands

# runs list of commands and waits for their termination

OPTIONS:
  --help	#print this help
  --stdout -o	#print stdout of commands
  --silent -V	#do not print spinners and commands
  --fail -f	#waiting commands to fail
  --status -s	#expected status [default: 0]
  --any -a	#terminate if any of command return expected status
  --change -c	#waiting for stdout to change and ignore status codes
  --exec -e	#run some shell command on success;
  --interval -i	#milliseconds between one round of commands [default: 200]
  --forever -F	#do not exit ever
  --service -S	#create systemd user service with same parameters and activate it


NOTES:
# \1, \2 ... \n - will be subtituted with n-th command stdout
# you can use stdout substitution in --exec and in commands itself:
  await 'echo -n 10' 'echo -n $RANDOM' 'expr \1 + \2' --exec 'echo \3' --forever --silent


EXAMPLES:
# action on specific file type changes
 await 'stat **.c' --change --forever --exec 'gcc *.c -o await -lpthread'

# waiting google (or your internet connection) to fail
  await 'curl google.com' --fail

# waiting only google to fail (https://ec.haxx.se/usingcurl/usingcurl-returns)
  await 'curl google.com' --status 7

# waits for redis socket and then connects to
  await 'socat -u OPEN:/dev/null UNIX-CONNECT:/tmp/redis.sock' --exec 'redis-cli -s /tmp/redis.sock'

# lazy version
  await 'ls /tmp/redis.sock'; redis-cli -s /tmp/redis.sock

# daily checking if I am on french reviera. Just in case
  await 'curl https://ipapi.co/json 2>/dev/null | jq .city | grep Nice' --interval 86400

# Yet another server monitor
  await "curl 'https://whatnot.ai' &>/dev/null && echo 'UP' || echo 'DOWN'" --forever --change\
    --exec "ntfy send \'whatnot.ai \1\'"

# waiting for new iPhone in daemon mode
  await 'curl "https://www.apple.com/iphone/" -s | pup ".hero-eyebrow text{}" | grep -v 12'\
 --change --interval 86400 --daemon --exec "ntfy send \1"
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].