Commands by hbogert (1)

  • Kodi needs the youtube plugin to be installed. Show Sample Output


    0
    curl -i -X POST -d '{"jsonrpc": "2.0", "method": "Player.Open", "params": {"item": { "file" : "plugin://plugin.video.youtube/play/?video_id=YOUTUBEID"}}, "id": 1}' http://username:password@kodi/jsonrpc -H "Content-Type: application/json"
    hbogert · 2017-03-26 14:30:29 0

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands


Check These Out

Alert on Mac when server is up
When run on a mac, this command will bring up a dialog box in the Terminal when server HOSTNAME first responds to a ping.

File rotation without rename command
Rotates log files with "gz"-extension in a directory for 7 days and enumerates the number in file name. i.e.: logfile.1.gz > logfile.2.gz I needed this line due to the limitations on AIX Unix systems which do not ship with the rename command.

Slightly better compressed archives
Avoids creating useless directory entries in archive, and sorts files by (roughly) extension, which is likely to group similar files together for better compression. 1%-5% improvement.

Extract ip addresses with sed
Extracts ip addressess from file using sed. Uses a tag(ip) to grep the IP lines after extracting. Must be a way to just output regex matched on sed.

Finding the number of cpu's

Squish repeated delimiters into one
This can be particularly useful used in conjunction with a following cut command like $echo "hello::::there" | tr -s ':' | cut -d':' -f2 which prints 'there'. Much easier that guessing at -f values for cut. I know 'tr -s' is used in lots of commands here already but I just figured out the -s flag and thought it deserved to be highlighted :)

count of down available ips

Move all files in subdirectories to current dir

Display usb power mode on all devices

Get the Last tweet (Better than Twitter feed rrs)
I was using some twitter bots and twitter bloks my IP. Now im using some proxys and i use these command to validate the tweet was published.


Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: