Check These Out
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
ZSH ships a couple random number generators via the $RANDOM environment variable and rand48() via zsh/mathfunc, but neither are cryptographically secure. This code produces a 32-bit random number suitable for cryptography. It's only dependency is /dev/urandom and it does not rely on any shell commands or 3rd party utilities. It assumes ZSH was compiled with 64-bit integer support.
If you're like me and want to keep all your music rated, and you use xmms2, you might like this command.
I takes 10 random songs from your xmms2 library that don't have any rating, and adds them to your current playlist. You can then rate them in another xmms2 client that supports rating (I like kuechenstation).
I'm pretty sure there's a better way to do the grep ... | sed ... part, probably with awk, but I don't know awk, so I'd welcome any suggestions.
Very quick way to change a word in a file. I use it all the time to change variable names in my PHP scripts (sed -i 's/$oldvar/$newvar/g' index.php)
Returns logs between HH:M[Mx-My], for example, between 13:40 and 13:45.
just make some data scrolling off the terminal. wow.
Create a exact mirror of the local folder "/root/files", on remote server 'remote_server' using SSH command (listening on port 22)
(all files & folders on destination server/folder will be deleted)
Explanation
Firstly the function checks if user gave it any input, and notifies the user if they failed to do so.
If user has inputed a search string, the function will call upon youtube-dl to find url of the audio of the first matching youtube video and play that with mpv.
Call function by wrapping search string in quotes:
listen-to-yt "sultans of swing"
You have to paste the line in your .zshrc and source .zshrc for it to work.
Limitations
The dependancies are youtube-dl and mpv.
this oneliner is stolen from http://www.bashoneliners.com/oneliners/302/