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
| require "formula" | |
| class MobileShell < Formula | |
| desc "Remote terminal application" | |
| homepage "https://mosh.mit.edu/" | |
| url "https://mosh.mit.edu/mosh-1.2.5.tar.gz" | |
| sha256 "1af809e5d747c333a852fbf7acdbf4d354dc4bbc2839e3afe5cf798190074be3" | |
| bottle do | |
| sha256 "046b0c48cd1c573d57500e683122e3152a00556ad960938c6caa962b0c2ef460" => :el_capitan | 
| ;; To send events from Emacs to Fantastical using Control-C Control-F, | |
| ;; drop this script in your Emacs load path and add lines like these to | |
| ;; your .emacs: | |
| ;; | |
| ;; (autoload 'send-region-to-fantastical "fantastical-capture" "Send region to Fantastical" t) | |
| ;; (global-set-key (kbd "C-c C-f") 'send-region-to-fantastical) | |
| ;; | |
| ;; See http://jblevins.org/log/emacs-fantastical for details. | |
| (defun applescript-quote-string (argument) | 
| ModemManager-glib-1.1.0-6.git20130913.el7.x86_64 | |
| NetworkManager-0.9.9.1-13.git20140326.4dba720.el7.x86_64 | |
| NetworkManager-glib-0.9.9.1-13.git20140326.4dba720.el7.x86_64 | |
| NetworkManager-tui-0.9.9.1-13.git20140326.4dba720.el7.x86_64 | |
| acl-2.2.51-12.el7.x86_64 | |
| aic94xx-firmware-30-6.el7.noarch | |
| alsa-firmware-1.0.27-2.el7.noarch | |
| alsa-lib-1.0.27.2-3.el7.x86_64 | |
| alsa-tools-firmware-1.0.27-4.el7.x86_64 | |
| audit-2.3.3-4.el7.x86_64 | 
| // LZ4 streaming API example 2 (ring buffer) | |
| #define _CRT_SECURE_NO_WARNINGS // for MSVC | |
| #include "lz4.h" | |
| #include <stdio.h> | |
| #include <stdint.h> | |
| #include <stdlib.h> | |
| #include <string.h> | 
| # This script create a Centos Minimal Unattended ISO | |
| # This method is based on excellent article http://pyxlmap.net/technology/software/linux/custom-centos-iso | |
| # | |
| # This script has be tested with CentOS 6.5 | |
| # TODO: | |
| # * test package update to reduce the update task on the target system. The following command downloads all updates : | |
| # (cd $CENTOS_CUSTOM_PATH/Packages ; yumdownloader $(for i in *; { echo ${i%%-[0-9]*}; } ) ) | |
| # Some global settings : | 
| /* | |
| An example of mmap where data is modified in the file. This | |
| version currently compiles on Mac OSX. | |
| References: | |
| Advanced Programming in the UNIX® Environment, Third Edition | |
| By: W. Richard Stevens; Stephen A. Rago | |
| Publisher: Addison-Wesley Professional | 
| # Back-Propagation Neural Networks | |
| # another way: solve it as a Regression Problem | |
| # Written in Python. See http://www.python.org/ | |
| # Modified by JSun to solve the problem here: http://www.weibo.com/1497035431/ynPEvC78V | |
| # Neil Schemenauer <[email protected]> | |
| import math | |
| import random | |
| import string | 
| #mysql-backup | |
| mysqldump -h localhost –u root –p myrootpassword db_name > db_test.sql | |
| #for multiple database | |
| mysqldump -h localhost –u root –p myrootpassword db_name1 db_name2 > db_test.sql | |
| #for all table | |
| mysqldump -h localhost –u root –p myrootpassword -all-databases > db_test.sql | |
| #for specifiec table |