Requires to know the Chromecast IP Address. Will simply return the pin code for guests to use the Chromecast. Useful to put on a page or somewhere in your house on a display.
Requires stedolan's 'jq' application. Alternative you may use below if you don't want to use jq:
curl -s "http://$chromecast_ip_address:8008/setup/eureka_info?options=detail" | perl -nle 'print $1 if m{"opencast_pin_code":"(\d+)"}'
Show Sample Output
to enable, replace disable with enable
usb must be bootable with rufus or other
shows all RPMs with files in the current directory & its subdirectories.
traverses e.g. "/data/myhost1.com/myrsyncshare"; logs stderr and stdout. useful with cron.
It runs on Mac OS X since it has curl installed by default. On Linux the easiest is to install curl, but wget -qU "Mozilla" "http..." will work too. It's important to specify the currencies in capital letters, or use sed -n "s/.*>\(.*\) `echo $3 | tr '[a-z]' '[A-Z]'` sed -n "s/.*>\(.*\) $3 Show Sample Output
You can actually do the same thing with a combination of head and tail. For example, in a file of four lines, if you just want the middle two lines:
head -n3 sample.txt | tail -n2
Line 1 --\
Line 2 } These three lines are selected by head -n3,
Line 3 --/ this feeds the following filtered list to tail:
Line 4
Line 1
Line 2 \___ These two lines are filtered by tail -n2,
Line 3 / This results in:
Line 2
Line 3
being printed to screen (or wherever you redirect it).
Put the string above in your ~/.bashrc or ~/.bash_profile, then source the file. Make sure your sound output is working, you have mplayer installed, then type in a word or sentence similar to below: say "why won't anyone talk to me?" It's easy to get the language to be different by changing the "en" in the string to be "de" or some other language that Google Translate supports. Have multiple "say" functions, like "say-en" "say-de", etc. Show Sample Output
Not figured by me, but a colleague of mine. See the total amount of data on an AIX machine. Show Sample Output
This is a mysql command. So, first login with mysql -u name -p. Then "use DATABASE". Lastly, issue this command to import data.
If on a web server (with access to the ssl key), decrypt SSL off the wire
Grab the multiline webhook URL definition from alarm-show. Basically it parse the following into an URL only: ```root@ctl01:/home/hombre# ceilometer alarm-show 1383a6be-fb73-4955-9991-8d65a8a23d60 +---------------------------+--------------------------------------------------------------------------+ | Property | Value | +---------------------------+--------------------------------------------------------------------------+ | alarm_actions | [u'http://10.40.50.20:8000/v1/signal/arn%3Aopenstack%3Aheat%3A%3A3d6118 | | | cc789c4db3b06fb3a382494b67%3Astacks%2Fhombre-V2R1%2Fd189e704-4f99-467 | | | 5-9ec2-eaadkc0ae8af5%2Fresources%2Fweb_server_scaleup_policy?Timestamp=20 | | | 16-10-03T14%3A05%3A27Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=09sdkd4e | | | d854347189383aba11d6353c6&SignatureVersion=2&Signature=MXxlKLZ%2BT4y4y%2 | | | BOuuAmxTLIVQ9ONKx2jKSZKHYIy83Q%3D'] | ```
To truncate a file easily, just redirect something empty with no commands. Show Sample Output
oder: ip route get $(dig +short google.com | tail -1)
My old Solaris server does not have lsof, so I have to use pfiles.
This prints "Charging" or "Discharging". Obviously, this will indicate the status of the AC adapter. The awk part could be from 1-6. I removed the comma because it is useless when only looking at one element of the output array. See acpi(1) for more info.
first off, if you just want a random UUID, here's the actual command to use:
uuidgen
Your chances of finding a duplicate after running this nonstop for a year are about the same as being hit by a meteorite before finishing this sentence
The reason for the command I have is that it's more provably unique than the one that uuidgen creates. uuidgen creates a random one by default, or an unencrypted one based on time and network address if you give it the -t option.
Mine uses the mac address of the ethernet interface, the process id of the caller, and the system time down to nanosecond resolution, which is provably unique over all computers past, present, and future, subject to collisions in the cryptographic hash used, and the uniqueness of your mac address.
Warning: feel free to experiment, but be warned that the stdin of the hash is binary data at that point, which may mess up your terminal if you don't pipe it into something. If it does mess up though, just type
reset
Show Sample Output
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.
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
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: