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
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
// Suggestions from golang-nuts | |
// http://play.golang.org/p/Ctg3_AQisl |
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: vpnclient | |
# Required-Start: $all | |
# Required-Stop: $network $local_fs $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start VPN Client at boot time | |
# chkconfig: 345 44 56 | |
# description: Start VPN Client at boot time. |
#!/usr/local/env bash | |
# Update system | |
apt-get update && apt-get -y upgrade | |
# Get build tools | |
apt-get -y install build-essential wget curl | |
# Define softether version | |
RTM=$(curl http://www.softether-download.com/files/softether/ | grep -o 'v[^"]*e' | grep rtm | tail -1) | |
IFS='-' read -r -a RTMS <<< "${RTM}" |
// node: | |
var moment = require('moment'); | |
moment().add('days', 2).fromNow(); | |
// 'in 2 days' | |
moment().subtract('days', 2).fromNow(); | |
// '2 days ago' | |
moment('November 1977').fromNow() |
kubectl get namespace "terminating-namespace" -o json \ | |
| tr -d "\n" | sed "s/\"finalizers\": \[[^]]\+\]/\"finalizers\": []/" \ | |
| kubectl replace --raw /api/v1/namespaces/terminating-namespace/finalize -f - |