Skip to content

Instantly share code, notes, and snippets.

@blachniet
blachniet / Install-Consul.ps1
Last active August 12, 2017 20:01
Install Consul in a consistent way on Windows machines
<#
.SYNOPSIS
Installs Consul and creates a Windows service to run the agent.
.DESCRIPTION
Installs Consul and creates a Windows service to run the agent.
Requirements:
- You must execute script with administrator priveleges
- A service named 'Consul' MUST NOT exist
@blachniet
blachniet / PowerShellRemoteMemory.ps1
Created July 5, 2016 11:55
Increase the maximum memory allocation allowed in remote powershell sessions.
Set-Item WSMan:\localhost\Plugin\Microsoft.PowerShell\Quotas\MaxMemoryPerShellMB 10240
Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 10240
Restart-Service winrm
[alias]
diffy = difftool --dir-diff -y
co = checkout
s = status --short
b = branch
lo = log --oneline --decorate --graph
git config --global alias.co checkout
git config --global alias.s 'status --short'
git config --global alias.diffy 'difftool --dir-diff -y'
git config --global alias.b branch
@blachniet
blachniet / Install.bash
Created March 27, 2015 12:48
Install pip packages in an offline environment
# 1. On a internet-connected device, download the package and its dependencies to a directory
mkdir pip-es-curator
pip install --ignore-installed -d ./pip-es-curator elasticsearch-curator
# 2. Move the directory containing the packages to the offline device
# 3. On the offline device, install the package from the transferred directory
pip install --no-index --find-links ./pip-es-curator elasticsearch-curator
@blachniet
blachniet / SerilogMultipleTopLevelLoggers.cs
Created July 19, 2014 01:33
Creates 2 top-level loggers, loggerA and loggerB using different configurations.
using System;
using Serilog;
public class Program
{
public static void Main()
{
var loggerA = new LoggerConfiguration().WriteTo.Console().CreateLogger();
loggerA.Information("Logging to top-level loggerA");
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.html">
@blachniet
blachniet / VagratNotes.md
Created April 28, 2014 00:16
Vagrant Notes

Vagrant Notes

Troubleshooting

Fails to Mount Shared Folder

Run the following command on the guest:

sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions