First get the virtual disk (vhdx) from the Hyper-V platform.
Use a Linux machine with libvirt installed.
Do not forget to install the UEFI firmware:
sudo apt install ovmf
# | |
# git pull all from origin | |
# | |
function gpuA { | |
local VERBOSE=${VERBOSE:-0} | |
while (( $# > 0 )); do | |
[[ $1 == --*=* ]] && set -- "${1%%=*}" "${1#*=}" "${@:2}" | |
case $1 in | |
--quiet) |
# | |
# git push all and tags to origin or other repo | |
# | |
# This assumes git config push.default matching | |
function gpA { | |
local VERBOSE=${VERBOSE:-0} | |
while (( $# > 0 )); do | |
[[ $1 == --*=* ]] && set -- "${1%%=*}" "${1#*=}" "${@:2}" | |
case $1 in |
#!/usr/bin/env bash | |
function aws-auth() { | |
token_code=$1 | |
unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN AWS_SESSION_TOKEN_EXPIRATION | |
aws_identity=$(aws sts get-caller-identity --output json) | |
aws_account=$(echo "$aws_identity" | jq -r .Account) | |
aws_user=$(echo "$aws_identity" | jq -r .Arn | cut -d/ -f2) | |
aws_arn="arn:aws:iam::${aws_account}:mfa/${aws_user}" | |
creds=$(aws sts get-session-token --serial-number "$aws_arn" --token-code $token_code --duration-seconds 129600 --output json) |
function New-AWSSession { | |
<# | |
.SYNOPSIS | |
Authenticates with AWS using MFA | |
.DESCRIPTION | |
Authenticates the current IAM user with AWS via the assigned MFA device | |
.PARAMETER MFA | |
The MFA Code to authenticate with | |
.PARAMETER Profile | |
The AWS Profile to authenticate or "Default" if absent |
package main | |
import ( | |
"context" | |
"time" | |
"github.com/gildas/go-errors" | |
"github.com/gildas/go-logger" | |
) |
# set history | |
set -g history-limit 50000 | |
# Messages will be displayed for 4 seconds | |
set -g display-time 4000 | |
set -g default-terminal screen-256color | |
# Disable auto-renaming of windows | |
set -g allow-rename off |
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"reflect" | |
) | |
/******************** The TypeRegistry helper ******************/ | |
/**** from github/gildas/go-core ****/ |
#!/usr/bin/env bash | |
function main() { | |
local APPEND=0 | |
while (( "$#" )); do | |
# Replace --parm=arg with --parm arg | |
[[ $1 == --*=* ]] && set -- "${1%%=*}" "${1#*=}" "${@:2}" | |
case $1 in | |
-a|--append) |
#!/usr/bin/env bash | |
shopt -s extglob | |
set -o errtrace | |
#set -o errexit | |
set +o noclobber | |
# Defaults {{{ | |
NOOP= | |
VERBOSE=${VERBOSE:0} |