qemu-img convert \
-f $INPUT_FORMAT \
-O $OUTPUT_FORMAT \
$INPUT_FILE $OUTPUT_FILE
For example qemu-img convert -f qcow2 -O vmdk esxi.qcow2 esxi.vmdk
#! /bin/bash | |
# Set the country code (in lower case) | |
cc=nz | |
# Create the ipset | |
ipset create allowed_country hash:net | |
# Load the country set | |
wget -qO- "https://iplists.firehol.org/files/geolite2_country/country_$cc.netset" | grep -v ^# | xargs -n1 ipset add allowed_country |
# Debian specific: Specifying a file name will cause the first | |
# line of that file to be used as the name. The Debian default | |
# is /etc/mailname. | |
#myorigin = /etc/mailname | |
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU) | |
biff = no | |
# appending .domain is the MUA's job. | |
append_dot_mydomain = no |
### Prints a CSV of the AS origin of SSH intrusion attempts | |
### Format: as_number,bgp_prefix,country_code,rir_name,date_allocated,num_occurrences | |
### d7d3db009fd67083faf1276a1b69ebfa097cc5400f202f95551aa94115d7ddcd | |
for ip in $(journalctl -u ssh -u sshd --since -${period:-'1day'}|awk '/Failed/{print $(NF-3)}'); | |
do dig $(tac -s.<<<"$ip.")origin.asn.cymru.com +short txt; done \ | |
| sort --numeric-sort \ | |
| uniq --count \ | |
| sort --numeric-sort \ | |
| sed 's/ | /,/g' \ | |
| tr -d \" \ |
get_remote_file() {
test -z "$1" -o -z "$2" && (echo "Usage: $0 remote_url content_sha256sum [output_filename]"; return $?);
local file=$(test -n "$3" && echo $3 || basename $1|tr -dc '[:alnum:]\.\-\_\:\/');
wget -O $file $1 && (sha256sum -c <(printf "%s\t%s" $2 $file) || mv $file $file.invalid);
return $?
}