find '.odt' files that contain USAGE: grepodt
Requirements: Google Authenticator is configured as per document (http://blogs.vmware.com/consulting/files/2015/02/VMW_15Q1_TD_Horizon-View-Google-Authenticator_021715_FINAL_EMonjoin.pdf) including the patch at the end of the document. Login as the user to be provisioned. su username Command will: 1. Silently provision a user for Google Authenticator (TOTP) 2. Remove the unnecessary (and unsecure) code that uses google.com to create the QR code in browser. 3. Decode URL (first instance) 4. Decode URL (second instance) 5. Create a QR code 6. Send email to an account with the QR Code attached User scans QR code with Google Authenticator.
Basically, \033[ is a semi-portable unix escape character. It should work in linux, osx, bsd, etc. The first option is 38. This tells whatever is interpreting this (and this is merely convention) that a special color sequence follows. The next option is 5 which says that the next option will specify a color ? {0..256} of course. These options, as you can see, are separated by a single `;` and the entire escape sequence is followed by a mandatory `m`. The second escape sequence (following "COLOR") is simply to clear all terminal attributes (for our purposes, it clears color). This for loop is helpful for testing all 256 colors in a 256 console (note: this will not work in a standard Linux tty console) or to see which number corresponds to which color so that perhaps you can use it! Show Sample Output
Changelog: Changing ping to "ping -A -c1 -w10" - targeting a quick and reliable ping, even on slow networks.
IMPORTANT: You need Windows PowerShell to run this command - in your Windows Command Prompt, type
powershell
Create a log file of your Motorola Surfboard SB6141 downstream signal strengths.
Uses the built-in curl to request signal strength data from your SB6141 cable modem.
HTML page 192.168.100.1/cmSignalData.htm has the signal strength numbers for the 8 downstreams.
Some HTML/DOM processing parses out the 8 values from the above page.
The eight extracted signal strengths are then logged to a file.
A small while-loop watches the clock & repeats the process every 10 seconds.
Show Sample Output
IMPORTANT: You need Windows PowerShell to run this command - in your Windows Command Prompt, type
powershell
Uses sajb to start a PowerShell background job that pings an IP host every 10 seconds.
Any changes in the host's Up/Down state is time-stamped and logged to a file.
Date/time stamps are logged in two formats: Unix and human-readable.
A while(1) loop repeats the test every 10 seconds by using the sleep command.
See the Sample Output for more detail.
I use this command to log Up/Down events of my Motorola SB6141 cable modem (192.168.100.1).
To end the logging, close the PowerShell window or use the "exit" command.
Show Sample Output
Requires jq (JSON parser) and curl (wget could do the same with some changes)
Worked well on ubuntu
Requires jq (JSON parser)
e.g.
OLDDIALOGRC=$DIALOGRC; export DIALOGRC=/dev/stdin; echo -e "screen_color = (CYAN,RED,ON)" | dialog --infobox "\nfoo bar" 5 11; export DIALOGRC=$OLDDIALOGRC
Alternative:
OLDDIALOGRC=$DIALOGRC; export DIALOGRC=/dev/stdin; printf "<configuration>\n" | dialog <options>; export DIALOGRC=$OLDDIALOGRC
This command would execute echo "Yes" if the file /etc/passwd exits. Else would execute echo "No". This is a great command for make decisions based on file existence. Basically ?/usr/bin/[' or '[' is a test command in Linux. Show Sample Output
Convert Underscore to CamelCase Show Sample Output
This command will take the output of curl and read it line by line, skipping a step in downloading the file then parsing it. You can then parse each line, or only print the lines that contain certain works using if statements, or whatever you can come up with. Or you can change IFS and use it to parse based on separators other than newline.
1. Sends an email to announce the start of the command 2. Raw data copy of block device over ssh to a new host 3. Sends an email to announce the end of the command Make sure the lvm device at the other side exists and has the same amount of logical units.
Adds a shortcut (bash alias) for a lightweight detachable 'multi-windowed' cli terminal session to bashrc. Uses 'abduco' (supersedes 'dtach') to implement a personal default detachable terminal session with a 'windowed' terminal UI provided by 'dvtm'. "-A" option allows the shortcut "wm" to be used to both instigate and re-attach to session "your_title_here". "-M" options stops 'dvtm' from changing your default mouse behavior.
Speed up Google Chrome like speedyfox does for MAC USER. This script will detect all SQLITE DATABASE on the Google directory
I just needed to store the LAN IP (for ipv4) in a variable for a specific task in a bash script. I figured I'd share. I sent it to a variable with VAR=$(stuff) and used it later on. I put the exit 0 in the if statement to make it so that it breaks if there are more than one IPv4 addresses assigned. I only wanted the first one. Edit: Bear in mind, my network mask is a double digit number so if you have a smaller nw mask you'd need to edit the sed statement. Show Sample Output
It's quite fun to invert text using "flip.pl" (ref: http://ubuntuforums.org/showthread.php?t=2078323 ). Slightly more challenging is to flip a whole "cowsay". :-) Show Sample Output
Block given ip for X seconds and then automatically unban.
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: