Skip to content

Instantly share code, notes, and snippets.

Sander Saares sandersaares

View GitHub Profile
View gist:c2946dbd47732c7e09bf1ef4d117a30d
# -*- mode: ruby -*-
# vi: set ft=ruby :
vm_name = "asdf"
vswitch_name = "xxx"
data_disk_path = ""
new_password = "xxx"
mac_address = ""
cpu_cores = 2
ram_mb = 1536
@sandersaares
sandersaares / gist:2fd245b28d9170235430da6032fecf85
Created Aug 24, 2017
Prometheus historical data collector example
View gist:2fd245b28d9170235430da6032fecf85
using Axinom.Toolkit;
using NLog;
using Prometheus.Advanced;
using Prometheus.Advanced.DataContracts;
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
View Packer fails with ParseUint error
2017/07/20 13:11:01 [INFO] Packer version: 1.0.2
2017/07/20 13:11:01 Packer Target OS/Arch: windows amd64
2017/07/20 13:11:01 Built with Go Version: go1.8.3
2017/07/20 13:11:01 Using internal plugin for amazon-ebs
2017/07/20 13:11:01 Using internal plugin for azure-arm
2017/07/20 13:11:01 Using internal plugin for docker
2017/07/20 13:11:01 Using internal plugin for null
2017/07/20 13:11:01 Using internal plugin for triton
2017/07/20 13:11:01 Using internal plugin for alicloud-ecs
2017/07/20 13:11:01 Using internal plugin for amazon-chroot
@sandersaares
sandersaares / gist:e022a24e61ec02eac6930773d81238be
Created Jul 12, 2017
pmap of Mono app with large virtual memory but low acutal usage
View gist:e022a24e61ec02eac6930773d81238be
21: mono /App/xxx.exe
0000000000400000 3684K r-x-- mono-sgen
0000000000998000 4K r---- mono-sgen
0000000000999000 12K rw--- mono-sgen
000000000099c000 208K rw--- [ anon ]
00000000010db000 12004K rw--- [ anon ]
00000000402d0000 1356K rwx-- [ anon ]
0000000040e84000 64K rwx-- [ anon ]
00007fc1fc000000 1572K rw--- [ anon ]
00007fc1fc189000 63964K ----- [ anon ]
View gist:a7872745c6f4707b585d5cd12828574d
INFO global: Vagrant version: 1.9.6
INFO global: Ruby version: 2.3.4
INFO global: RubyGems version: 2.5.2
INFO global: VAGRANT_EXECUTABLE="C:\\HashiCorp\\Vagrant\\embedded\\gems\\gems\\vagrant-1.9.6\\bin\\vagrant"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="C:\\HashiCorp\\Vagrant\\embedded"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_LOG="debug"
INFO global: VAGRANT_OLD_ENV_="ExitCode=00000000"
INFO global: VAGRANT_OLD_ENV_ALLUSERSPROFILE="C:\\ProgramData"
@sandersaares
sandersaares / gist:f97798ca3dd647f4d28ad757b43280e1
Created Jun 14, 2017
Shell provisioner occasionally instantly fails with "The box is not able to report an address for WinRM to connect to yet."
View gist:f97798ca3dd647f4d28ad757b43280e1
==> default: Running cleanup tasks for 'trigger' provisioner...
==> default: Stopping the machine...
==> default: Deleting the machine...
INFO global: Vagrant version: 1.9.5
INFO global: Ruby version: 2.2.5
INFO global: RubyGems version: 2.4.5.1
INFO global: VAGRANT_EXECUTABLE="C:\\HashiCorp\\Vagrant\\embedded\\gems\\gems\\vagrant-1.9.5\\bin\\vagrant"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="C:\\HashiCorp\\Vagrant\\embedded"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INSTALLER_VERSION="2"
@sandersaares
sandersaares / gist:43e3b6136a5aa48395cafbc98b5cc245
Created May 23, 2017
Packer debug log for file provisioner failure
View gist:43e3b6136a5aa48395cafbc98b5cc245
2017/05/23 08:24:09 [INFO] Packer version: 1.0.0
2017/05/23 08:24:09 Packer Target OS/Arch: windows amd64
2017/05/23 08:24:09 Built with Go Version: go1.8
2017/05/23 08:24:09 Using internal plugin for googlecompute
2017/05/23 08:24:09 Using internal plugin for hyperv-iso
2017/05/23 08:24:09 Using internal plugin for vmware-vmx
2017/05/23 08:24:09 Using internal plugin for digitalocean
2017/05/23 08:24:09 Using internal plugin for docker
2017/05/23 08:24:09 Using internal plugin for cloudstack
2017/05/23 08:24:09 Using internal plugin for null
@sandersaares
sandersaares / RegisterComFor64Bit.cs
Last active Oct 16, 2015
Registering 32-bit COM objects for access from a 64-bit process
View RegisterComFor64Bit.cs
private static void RegisterComObjectsFor64BitProcesses()
{
var comObjectsToRegister = new List<string>
{
Constants.WmrmKeysComObjectKeyName,
Constants.WmrmHeaderComObjectKeyName,
Constants.WmrmProtectComObjectKeyName
};
foreach (var comObject in comObjectsToRegister)
@sandersaares
sandersaares / GrantDcomRights.cs
Created Oct 16, 2015
Grant access rights to DCOM objects as a MSBuild task
View GrantDcomRights.cs
namespace Axinom.Environment.MSBuild.Tasks
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.AccessControl;
using System.Security.Principal;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Microsoft.Win32;
@sandersaares
sandersaares / keybase.md
Created Sep 27, 2015
Keybase identity link
View keybase.md

Keybase proof

I hereby claim:

  • I am sandersaares on github.
  • I am sandersaares (https://keybase.io/sandersaares) on keybase.
  • I have a public key whose fingerprint is 659C 121B C862 7A7B 7D16 46C1 2C88 DD2F E037 3C10

To claim this, I am signing this object:

You can’t perform that action at this time.