Check These Out
To monitor .vmdk files during snapshot deletion (commit) on ESX only (ESXi doesn't have the watch command):
1. Navigate to the VM directory containing .vmdk files.
# watch "ls -tough --full-time *.vmdk"
where:
-t sorts by modification time
-o do not list group information (to narrow the output)
-u sorts by access time
-g only here for the purpose to easily remember the created mnemonic word 'tough'
-h prints sizes in human readable format (e.g., 1K 234M 2G)
--full-time sets the time style to full-iso and does not list user information (to narrow the output)
optionally useful parameters to the watch command:
-d highlight changes between updates
-n seconds to wait between updates (default is 2)
-t turn off printing the header
Are there any creative pieces of music that can be created using beep and the shell? I'd love to hear it!
To create directory, use:
$ tempdir=$(/bin/mktemp -d)
If you want to turn a Git repo into the origin that folks can push to, you should make it a bare repository. See: http://stackoverflow.com/questions/2199897/git-convert-normal-to-bare-repository
add this alias in .bashrc to fast check the ip address of your modem router
alias myip="curl -s http://myip.dk | grep '' | sed -e 's/]*>//g'"
This command copies all filenames in the current dir and subdirs that end in .mp3 regardless of case (also matches .MP3 .mP3 and .Mp3)
It copies all the files to the "mp3" folder in your home directory.
If you want to see the files that are beeing copied, replace "cp {}" with "cp -v {}"
$ sleep 1h ; sudo command
or
$ sudo sleep 1h ; sudo command
won't work, because by the time the delay is up, sudo will want your password again.
If you add the -d flag each difference in the command's output will be highlighted.
I also monitor individual drives by adding them to df. Makes for a nice thin status line that I can shove to the bottom of the monitor.
You might want to secure your AWS operations requiring to use a MFA token. But then to use API or tools, you need to pass credentials generated with a MFA token.
This commands asks you for the MFA code and retrieves these credentials using AWS Cli. To print the exports, you can use:
`awk '{ print "export AWS_ACCESS_KEY_ID=\"" $1 "\"\n" "export AWS_SECRET_ACCESS_KEY=\"" $2 "\"\n" "export AWS_SESSION_TOKEN=\"" $3 "\"" }'`
You must adapt the command line to include:
* $MFA_IDis ARN of the virtual MFA or serial number of the physical one
* TTL for the credentials
From http://lists.debian.org/debian-devel/2001/01/msg00971.html .