Random shell scripts for different tasks. Mostly for Linux.
Work in progress - more to come.
Some of those scripts were written for my answers on Stack Exchange:
- Make a sound once process is complete (on Ask Ubuntu)
- How can I get my external IP address in bash? (on Unix & Linux)
- How do I find my internal ip address? (on Ask Ubuntu) Some are just for my own conveniece. Maybe they would be useful to someone else.
sn1 sn2 sn3 ok oks
For example to hear when a long-running command finishes and to hear a different sound on success and on failure:
Example with success:
ls / && ls /bin && ls /usr; oks
example with error:
ls / && ls /bim && ls /usr; oks
See ok-functions.md for more info.
Update and upgrade a Debian, Ubuntu or other APT-based Linux system.
See auu.md for more info.
Get internal IP address used for outgoing Internet connections.
TARGET is an IP address,
22.214.171.124 by default,
or a host name (if
getent are available on the system).
See internalip.md for more info.
Get external IP address that is visible by servers that you connect to over Internet.
METHOD can be: dns (default), http, https, ftp, telnet.
See externalip.md for more info.
Find what services providing external IP address via http and https are the fastest.
See externalip-benchmark.md for more info.
Most of those scripts should be stand-alone and can be copied in any place.
My recommendation is to make a
and put this in your
[ -d "$HOME/bin" ] && PATH="$HOME/bin:$PATH"
That way it's easy to put any script there:
cd ~/bin wget https://rawgit.com/rsp/scripts/master/example less example # see what was downloaded chmod a+x example
And use it at will. Of course always see what was downloaded first.
Rafał Pocztarski - https://github.com/rsp
MIT License (Expat). See LICENSE.md for details.