Today, I came across an interesting tool called "Seashells". It is used to pipe your Linux command's output to web in real-time. We can use it to share a Linux command's output to the support team, friends, and colleagues. Also, It can be used as monitoring tool for long-running processes which are continuously producing output in the console. Seashells is actually a client to Seashells.io website. You can either use Seashells.io directly or just install the Seashells client to pipe your output.
In this brief guide, we are going to see how to install and use Seashells in Linux.
Pipe Your Linux Command's Output To Web In Real-time Using Seashells
Important - Read before before using it
- Seashells is currently in beta stage. Please don’t use it for any uptime-critical applications.
- It is not a data storage medium. All old sessions (links) will be deleted after a day.
- Seashells doesn't have any account system yet, so each IP address is limited to 5 concurrent sessions.
Like I already said, you don't have to install anything to use Seashells web service. Just pipe your Linux command's output to "nc seashells.io 1337" as shown below. As you might already know, nc (netcat command) comes pre-installed in most Linux operating systems.
Say for example, I am going to pipe the output of 'echo' command as shown below.
$ echo 'Welcome To OSTechNix!' | nc seashells.io 1337
Sample output would be:
serving at https://seashells.io/v/ckWCBZbA
Now, your command's output using the above URL on any web browser.
Cool, isn't it? It's just an example. You can pipe the output of any Linux command or program even if they take a long time to complete.
Install Seashells Client
If you use Seashells often, it is recommended to install the Seashells client.
Seashells client is written using Python. And it supports both Python 2.x and Python 3.x., but Python 3 is officially recommend. So, it can be easily installed using pip utility. To install pip in your Linux distribution, refer the following guide.
Once PIP installed, run the following command to install ‘Seashells’.
$ sudo pip install seashells
Using Seashells Client
Once you have the client installed, you don't have to pipe the output to "nc seashells.io 1337". Instead, you can directly pipe the output to seashells. The client has some additional features, such as showing output on stdout as well as forwarding to Seashells.
Now, let me pipe the ls command's output:
$ ls -al | seashells
Sample output from my system:
serving at https://seashells.io/v/Jba3TUv2 total 36 drwxr-xr-x 3 sk sk 4096 Jul 17 15:18 . drwxr-xr-x 3 root root 4096 Jun 6 2016 .. -rw------- 1 sk sk 589 Jul 11 18:43 .bash_history -rw-r--r-- 1 sk sk 220 Jun 6 2016 .bash_logout -rw-r--r-- 1 sk sk 3771 Jun 6 2016 .bashrc drwx------ 3 sk sk 4096 Jul 17 15:17 .cache -rw-r--r-- 1 sk sk 5123 Jul 11 18:24 client.ovpn -rw-r--r-- 1 sk sk 675 Jun 6 2016 .profile -rw-r--r-- 1 sk sk 0 Jun 6 2016 .sudo_as_admin_successful
Now, your friend can view the above command's output using URL: https://seashells.io/v/Jba3TUv2.
If you want to display the output in plain text, replace the /v/{url} (v for view) with /p/{url} (p for plain text). For example, we can pipe the above command's output as plain text using URL - https://seashells.io/p/Jba3TUv2.
Please note that I have replaced the letter "v" with "p" in the above URL.
You can also delay the command's output with --delay switch.
$ htop | seashells --delay 5
The above command will wait for 5 seconds before displaying the output.
For more details about Seashells usage, run:
$ seashells --help
A common use-case for this utility is if there is any program that takes a long time to complete on your remote system, you can keep an eye on it from your local system using Seashells. Just let the program or command run using seashells on your remote system, note down the URL and monitor it anywhere via a web browser.
Suggested read:
- Share And Control Terminals In Real Time From Web Browser
- Ultimate Plumber - Writing Linux Pipes With Instant Live Preview
Resource:
Thanks for stopping by!
Help us to help you:
- Subscribe to our Email Newsletter : Sign Up Now
- Support OSTechNix : Donate Via PayPal
- Download free E-Books and Videos : OSTechNix on TradePub
- Connect with us: Reddit | Facebook | Twitter | LinkedIn | RSS feeds
Have a Good day!!