Skip to content

Instantly share code, notes, and snippets.

View Silvenga's full-sized avatar

Mark Lopez Silvenga

View GitHub Profile
@Silvenga
Silvenga / add-minion.sh
Created March 21, 2016 02:55
Remotely Authorize and Provision a Salt Minion
#!/bin/bash
# apt-get install sshpass
# http://docs.saltstack.com/en/latest/topics/tutorials/preseed_key.html
BOOTSTRAP=/srv/minion-bootstrap.sh
LOG_LOCATION=/tmp/minion-bootstrap.log
TMP=/tmp/salt
if [[ -z "$1" ]] || [[ -z "$2" ]] ; then
Windows Registry Editor Version 5.00
[
-HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate
]
@Silvenga
Silvenga / convert.cs
Created May 31, 2016 21:47
Convert from GUID to UUID
var guid = Guid.Parse("10a5be07-e2ba-46fa-bb18-273f77dc39f0");
var b = guid.ToByteArray();
var mirror = guid.ToByteArray();
b[0] = mirror[3];
b[1] = mirror[2];
b[2] = mirror[1];
b[3] = mirror[0];
@Silvenga
Silvenga / Disable Malicious Software Removal Tool From Installing.reg
Created November 2, 2017 23:35
Disable Malicious Software Removal Tool From Installing
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MRT]
"DontOfferThroughWUAU"=dword:00000001
$apps = @(
"A278AB0D.MarchofEmpires",
"9E2F88E3.Twitter",
"Facebook.Facebook",
"king.com.CandyCrushSodaSaga",
"Microsoft.MicrosoftSolitaireCollection",
"Microsoft.SkypeApp",
"Microsoft.MinecraftUWP",
"Microsoft.MicrosoftOfficeHub",
"Microsoft.BingWeather",
{
"expected_update_period_in_days": "14",
"url": "https://billing.dacentec.com/hostbill/index.php?/cart/dedicated-servers/",
"type": "html",
"mode": "on_change",
"extract": {
"Title": {
"css": "tbody > tr th:nth-child(1)",
"value": "normalize-space(.)"
},
{% set network = "master" %}
{% set id = grains['id'] %}
{% set interface = "Master" %}
{% set interfaceConfig = pillar['vAddress'] + " 255.255.0.0" %}
{% set tincBase = "C:\\Program Files (x86)\\tinc\\" %}
{% set configBase = tincBase + network + "\\" %}
{% set hostsPath = configBase + "hosts\\" %}
{% set port = "655" %}
Install Pre-Reqs:
pkg.installed:
- pkgs:
- apt-transport-https
- ca-certificates
- curl
- software-properties-common
Install Docker Apt Repo:
pkgrepo.managed:
@Silvenga
Silvenga / global.d.ts
Created December 24, 2017 00:07
dnscontrol Typescript Definitions
// https://stackexchange.github.io/dnscontrol/js
type Ttl = string | number;
// Top Level Functions
declare function REV(address: string): string;
declare function NewRegistrar(name: string, type: string, meta?: any): string;
declare function NewDnsProvider(name: string, type: string, meta?: any): string;
declare function DEFAULTS(...modifiers: any[]): void;
declare function D(name: string, registrar: string, ...meta: any[]): void;
// Version 1
// https://stackexchange.github.io/dnscontrol/js
type Ttl = string | number;
// Top Level Functions
declare function REV(address: string): string;
declare function NewRegistrar(name: string, type: string, meta?: any): string;
declare function NewDnsProvider(name: string, type: string, meta?: any): string;
declare function DEFAULTS(...modifiers: any[]): void;