Skip to content

Instantly share code, notes, and snippets.

View greising's full-sized avatar
🎧

Guillermo Greising greising

🎧
View GitHub Profile
<#
.SYNOPSIS
Migrates a Azure Virtual Machine to another subscription or data centre
.DESCRIPTION
Shutsdown the source VM
Exports the VM config to a temporary file
Loops through all Azure disks attached to the source VM
Schedules an async copy of the underlying VHD to the destination storage account
- optionally overwrites existing VHD in destination if it exists
@greising
greising / CFSBuddy.ps1
Last active August 29, 2015 14:20 — forked from dfinke/CFSBuddy.ps1
#Requires -Version 5.0.9814.0
if(!($PSVersionTable.PSVersion.Major -ge 5 -and $PSVersionTable.PSVersion.Build -ge 9814)) {
"Sorry you need PSVersion 5.0.9814.0 or newer"
$psversiontable
return
}
Add-Type -AssemblyName presentationframework
@greising
greising / maze.ps1
Last active August 29, 2015 14:20 — forked from dfinke/maze.ps1
param($Rows=8, $Columns=8)
Add-Type -AssemblyName System.Drawing
class Cell {
[int]$Row
[int]$Col
$links = @{}
@greising
greising / jasmind_consumer
Last active September 7, 2015 19:43 — forked from pguillem/jasmind_consumer
init.d script to launch consume_MT_messages.py as a system daemon (Should work in Debian/Ubuntu)
#!/bin/sh
### BEGIN INIT INFO
# Provides: rabbit consumer
# Required-Start: $network $local_fs
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Jasmin SMS Gateway Mysql Reporter Init Script
# Description: Jasmin SMS Gateway Mysql Reporter Init Script
### END INIT INFO
""" Simple mod from the original gist submitted by @zoufou
https://gist.github.com/zoufou/5701d71bf6e404d17cb4
Mod by: @pguillem
Purpose:
- Integrates PySQLPool lib to handle MySQL
- Visit https://pythonhosted.org/PySQLPool/tutorial.html
Requirements:
@greising
greising / xr
Last active September 11, 2015 16:52 — forked from kurahaupo/xr
Script using "xrandr" to configure multi-head display
#!/bin/bash
die() { echo "$*" >&2 ; exit 1 ; }
declare -a R=( normal right inverted left ) # rotation descriptions
declare -A S
declare -A DX
declare -a EX
@greising
greising / chresolvconf
Last active September 11, 2015 16:54 — forked from kurahaupo/chresolvconf
Manually change /etc/resolv.conf but protect it from meddling by NetworkManager et al
#!/bin/bash
# Update /etc/resolv.conf but keep it unwritable, even by root-owned processes.
# Useful to stop WiFi and/or DHCP from messing with it, and quite essential when
# there are multiple managers for different interface types.
#
# Because symlinks don't work, instead we bind-mount an appropriate file onto
# /etc/resolv.conf, chosen from those in ~/.resolvconf.d/.
#
# Since BIND is running locally, almost all the time that will work, so it's the
@greising
greising / install_script.bash
Last active September 11, 2015 16:56 — forked from kurahaupo/foo
There's no excuse for using #!/usr/bin/env ...
#!/usr/bin/env bash
#
# 1. No write permission on runnable programs
# 2. No partially-written files during installation; pivot into place once complete
# 3. No .sh etc suffices on runnable programs
# 4. Set the #! line at installation, to use a set path, not /usr/bin/env
#
verbose=0
@greising
greising / set_gnome-terminal_transparency.sh
Created November 7, 2015 08:21 — forked from nirbheek/set_gnome-terminal_transparency.sh
A tiny script to set the transparency for X windows. If AUTOMAGIC_MODE is "true", it tries to find all gnome-terminal windows and applies the transparency to all of them.
#!/bin/bash
# vim: set sts=4 sw=4 et tw=0 :
#
# License: BSD
AUTOMAGIC_MODE="true"
OPACITY_100="0xffffffff"
OPACITY_0="0x0"
: ${XWININFO:=$(type -P xwininfo)}