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
server { | |
listen 80; | |
server_name ~^((?<sub>[^\.]+)\.)?(?<domain>[^\.]+)\.my$; | |
charset utf-8; | |
client_max_body_size 128m; | |
index index.php index.html index.htm; | |
error_log /var/www/log/nginx.error.log warn; | |
log_not_found on; | |
access_log off; |
A minimal HTTP server in python. It sends a JSON Hello World for GET requests, and echoes back JSON for POST requests.
python server.py 8009
Starting httpd on port 8009...
curl http://localhost:8009
{"received": "ok", "hello": "world"}
<?php | |
/* * ** | |
* | |
* This script converts an existing MySQL database to migrations in Laravel 4. | |
* | |
* 1. Place this file inside app/controllers/ | |
* | |
* 2. In this file, edit the index() method to customize this script to your needs. | |
* - inside $migrate->ignore(), you pass in an array of table |
alias nginx.start='sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.nginx.plist' | |
alias nginx.stop='sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.nginx.plist' | |
alias nginx.restart='nginx.stop && nginx.start' | |
alias php-fpm.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist" | |
alias php-fpm.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist" | |
alias php-fpm.restart='php-fpm.stop && php-fpm.start' | |
alias mysql.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist" | |
alias mysql.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist" | |
alias mysql.restart='mysql.stop && mysql.start' | |
alias nginx.logs.error='tail -250f /usr/local/etc/nginx/logs/error.log' |
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: teamspeak3 | |
# Required-Start: $local_fs $network | |
# Required-Stop: $local_fs $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Description: Teamspeak 3 Server | |
### END INIT INFO | |
filter { | |
# Capture all the generic syslog stuff and populate @timestamp | |
if [type] == "postfix" { | |
grok { | |
match => [ "message", "%{SYSLOGBASE} %{GREEDYDATA:_syslog_payload}" ] | |
singles => true | |
} | |
# Postfix pads single-digit numbers with spaces (WHYYYYY) | |
mutate { gsub => [ "timestamp", " ", " 0" ] } | |
date { match => [ "timestamp", "MMM dd HH:mm:ss"] } |
server { | |
listen 8080; | |
server_name elasticsearch; | |
client_max_body_size 50M; | |
error_log /var/log/nginx/elasticsearch-errors.log; | |
access_log /var/log/nginx/elasticsearch.log; | |
location / { |
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: memcached | |
# Required-Start: $syslog | |
# Required-Stop: $syslog | |
# Should-Start: $local_fs | |
# Should-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: memcached - Memory caching daemon |
<?php | |
/************************************************************************************* | |
* varnish.php | |
* ------ | |
* Author: Alexander Kuznetcov (alexander@kuznetcov.me) | |
* Copyright: (c) Alexander Kuznetcov (http://blog.tenya.me) | |
* Release Version: 1.0.0.0 | |
* Date Started: 2013/06/25 | |
* | |
* Varnish 3.x language file for GeSHi. |