This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.
Step 1 - Enable NBD on the Host
modprobe nbd max_part=8
#include <stdio.h> | |
/******************** | |
* Enterprise array handler | |
* (c) 2018 Polprog | |
* | |
********************/ | |
//TODO: Rewrite in C++ as a class | |
void * getArrayElement(void * arr, char element, char elementSize){ |
This was created as a helper script for backing up my directory with VMs | |
It's not the prettiest one, but it's very simple and flexible. Works for me! | |
Be careful with the remove-old option, you may want to back up some of the older back ups to another place, | |
since it removers EVERY BACKUP OLDER than a week. | |
You definitely want the backup root to be a separate partition or, even better, separate disk. | |
It can be put into cron, if you do so I'd suggest a wrapper script like this: |
#!/bin/bash | |
################################## | |
# Small SSH tunnel helper script | |
# polprog 2017 | |
# http://polprog.net | |
################################## | |
SOCKET="vnctun" |
#!/bin/bash | |
#Analyze fail2ban logs and make a top 10 list of abusers! | |
if [[ $1 == "today" ]]; then | |
echo "Top abusers today:" | |
grep "Ban " /var/log/fail2ban.log | grep `date +%Y-%m-%d` | awk '{print $NF}' | sort | awk '{print $1,"("$1")"}' | logresolve | uniq -c | sort -n | |
else | |
echo "Top abusers:" |
#Do not run this !!! | |
#IO operations | |
alias less='cat' | |
alias sed='awk' | |
#administration | |
alias apt-get='aptitude' | |
#file editing |