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
| #!/bin/bash | |
| # CHANGE THESE | |
| auth_email="[email protected]" | |
| auth_key="c2547eb745079dac9320b638f5e225cf483cc5cfdda41" # found in cloudflare account settings | |
| zone_name="example.com" | |
| record_name="www.example.com" | |
| # MAYBE CHANGE THESE | |
| ip=$(curl -s http://ipv4.icanhazip.com) |
| #!/bin/bash | |
| # | |
| # To include the line below into your .tmux.conf to see battery % or charging icon. | |
| # set -g status-right "#(/Users/colbyolson/src/scripts/battery.sh) #H %H:%M" | |
| ok_color="colour236" | |
| warn_percent="20" | |
| warn_color="colour208" | |
| status=$(pmset -g batt) |
| » city | |
| » country | |
| nginx city:"San Diego" country:US | |
| » geo | |
| Devices within a 50km radius of San Diego (32.8,-117): geo:32.8,-117,50 | |
| » hostname | |
| "Server: gws" hostname:google | |
| » net | |
| net:216.219.0.0/16 | |
| » os |
| mkdir source | |
| mkdir bin | |
| # clone source | |
| cd source | |
| git clone --branch android-4.3_r3 https://android.googlesource.com/platform/external/libselinux | |
| git clone --branch android-4.3_r3 https://android.googlesource.com/platform/system/core | |
| git clone --branch android-4.3_r3 https://android.googlesource.com/platform/external/zlib | |
| git clone --branch android-4.3_r3 https://android.googlesource.com/platform/system/extras |
Using Python to check if remote port is open and accessible.
Taken from http://snipplr.com/view/19639/test-if-an-ipport-is-open/
Usage:
| #include <Servo.h> | |
| Servo esc; | |
| int escPin = 9; | |
| int minPulseRate = 1000; | |
| int maxPulseRate = 2000; | |
| int throttleChangeDelay = 100; | |
| void setup() { |
| #!/usr/bin/env escript | |
| % -*- mode: erlang -*- | |
| main([BeamFile]) -> | |
| {ok,{_,[{abstract_code,{_,AC}}]}} = beam_lib:chunks(BeamFile,[abstract_code]), | |
| io:fwrite("~s~n", [erl_prettypr:format(erl_syntax:form_list(AC))]). |
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| import multiprocessing | |
| from textwrap import dedent | |
| from itertools import izip_longest | |
| def process_chunk(d): | |
| """Replace this with your own function | |
| that processes data one line at a |