This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Commands: mv and cp | |
# You can alias these to the standard `mv` and `cp` commands | |
# For safety, I call them something else. | |
# Requires: rsync | |
alias rscp='rsync -aP' | |
alias rsmv='rsync -aP --remove-source-files' | |
# Commands: dd | |
# You could make an alias out of this, but be careful when using it! | |
# $size is the size of the input file (e.g. 1024K, 4096M, etc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Returns the IP address of a running KVM guest VM | |
# Assumes a working KVM/libvirt environment | |
# | |
# Install: | |
# Add this bash function to your ~/.bashrc and `source ~/.bashrc`. | |
# Usage: | |
# $ virt-addr vm-name | |
# 192.0.2.16 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Shutdown the VM and rename storage (optional) | |
$ virsh shutdown old_vm | |
$ mv /path/to/old_vm.img /path/to/new_vm.img | |
# Edit virsh template with the new name and storage | |
$ virsh dumpxml old_vm > new_vm.xml | |
$ vim new_vm.xml | |
~~~ new_vm.xml | |
<name>new_vm</name> # <-- change this line | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -u username --silent "https://mail.google.com/mail/feed/atom" | awk 'BEGIN{FS="\n";RS="(</entry>\n)?<entry>"}NR!=1{print "\033[1;31m"$9"\033[0;32m ("$10")\033[0m:\t\033[1;33m"$2"\033[0m"}' | sed -e 's,<[^>]*>,,g' | column -t -s $'\t' |