When working in a clustered Linux environment containing two or more servers, it is not uncommon to switch back and forth between the hosts. Even if it’s running one command.
SSH is a powerful tool, it can do allot more than act as remote shell or tunnel traffic. One of those features is sending a command string to the server and fetching the output.
Assuming that you have access and privileged user on the remote server, the command works as follows
~$ ssh email@example.com "netstat -tulpna|grep -i established"
firstname.lastname@example.org's password: *****
For an even more awesome experience, consider authenticating using ssh-key’s.
There’s always room for a classic, same artist as before. Trust No One.
All the love to my new found obsession, Artist @marcusdixon and his scetch Poisonous Romance. Now permanently tattooed to my left arm <3
With my long-lived fascination of rustic things, I decided to ink an old fashioned Mora Knife across my left arm. It turned out amazing.
The tongue like a sharp knife… Kills without drawing blood.
Ever wanted to see whats going through Squid’s cache right at the moment? But get immediately discouraged with all the timestamps, SWAPOUT, RELEASE and other cache variables?
I have a one-line for you!
~ # tail -f /var/log/squid/store.log|grep -oE '\b(http?)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]'
This will print out visited links that passes by squid in real time, it can be added to a bash alias for quick access:
alias squidcache="tail -f /var/log/squid/store.log|grep -oE '\b(http?)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]'"
Or simply run as-is for whatever reason..
~ # grep -oE '\b(http?)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]' /var/log/squid/store.log