Check These Out
A null operation with the name 'comment', allowing comments to be written to HISTFILE. Prepending '#' to a command will *not* write the command to the history file, although it will be available for the current session, thus '#' is not useful for keeping track of comments past the current session.
You can ask repeatedly for a non-blank password using this function:
function read_password() {
while [ ! -n "$USER_PASSWORD" ]; do
read -s -p"Password: " USER_PASSWORD
if [ ! -n "$USER_PASSWORD" ]; then
echo "ERROR: You must specify a valid password, please try again"
fi
echo
done
}
Also you can set a time out (in seconds) to write the password
read -t 10 -s -p"Password: " USER_PASSWORD_VARIABLE
if [ ! $? -eq 0 ]; then
echo "Time out!"
fi
You have an external USB drive or key.
Apply this command (using the file path of anything on your device) and it will simulate the unplug of this device.
If you just want the port, just type :
echo $(sudo lshw -businfo | grep -B 1 -m 1 $(df "/path/to/file" | tail -1 | awk '{print $1}' | cut -c 6-8) | head -n 1 | awk '{print $1}' | cut -c 5- | tr ":" "-")
Put this command in .bashrc and every time you open a new terminal a random quote will be downloaded and printed from onelinerz.net.
By altering the URL in the w3m statement you can change the output:
1 to 10 lines - http://www.onelinerz.net/random-one-liners/(number)/
20 newest lines - http://www.onelinerz.net/latest-one-liners/
Top 10 lines - http://www.onelinerz.net/top-100-funny-one-liners/
Top 10 lines are updated daily.
Comcast is an ISP in the United States that has started hijacking DNS requests as a "service" for its customers. For example, in Firefox, one used to be able to do a quick "I'm Feeling Lucky" Google search by typing a single word into the URL field, assuming the word is not an existing domain when surrounded by www.*.com. Comcast customers never receive the correct NX (non-existent domain) error from DNS. Instead, they are shown a page full of advertising. There is a way to "opt out" from their service, but that requires having the account password and the MAC address of your modem handy. For me, it was easier just to set static DNS servers. But the problem is, which ones to choose? That's what this command answers. It'll show you the three _non-hijacked_ Comcast DNS servers that are the shortest distance away.
Perhaps you don't have Comcast (lucky you!), but hopefully this command can serve as an example of using netselect to find the fastest server from a list. Note that, although this example doesn't show it, netselect will actually perform the uniq and DNS resolution for you.
Requires: netselect, curl, sort, uniq, grep
The loop is to compare cookies. You can remove it...
Maybe you wanna use curl...
$ curl www.commandlinefu.com/index.php -s0 -I | grep "Set-Cookie"
Don't need to pipe the output into rs if you just tell jot to use a null separator character.