Skip to content

Instantly share code, notes, and snippets.

---
- name: Check /etc/elasticsearch/jvm.options exists
stat:
path: /etc/elasticsearch/jvm.options
become: true
register: elastic_jvm_options
- name: Check /etc/logstash/jvm.options exists
stat:
path: /etc/logstash/jvm.options
@sclarson
sclarson / StoppableJob.cs
Created March 31, 2011 15:59
Stoppable EPiServer Schedule Job Example
using System.Linq;
using EPiServer;
using EPiServer.BaseLibrary.Scheduling;
using EPiServer.Core;
using EPiServer.PlugIn;
namespace BlendInteractive.AppCode.Plugins
{
[ScheduledPlugIn(DisplayName = "Delete Unpublished Faculty and Staff")]
public class DeleteUnpublishedPeople : JobBase
@sclarson
sclarson / gist:0e0b70325312085766b8
Created September 24, 2015 04:22
Sample of .Net Rocks Geekout Episodes
Cryptocurrency Geek Out!:
http://www.dotnetrocks.com/?show=950
https://s3.amazonaws.com/dnr/dotnetrocks_0950_cryptocurrency.mp3
Geeking Out on Thorium:
http://www.dotnetrocks.com/?show=864
https://s3.amazonaws.com/dnr/dotnetrocks_0864_thorium.mp3
ShowLinks:
http://spectrum.ieee.org/static/special-report-water-vs-energy
http://singularityhub.com/2012/12/11/norway-begins-four-year-test-of-thorium-nuclear-reactor/
:: Init Script for cmd.exe
:: Sets some nice defaults
:: Created as part of cmder project
:: Find root dir
@if not defined CMDER_ROOT (
for /f %%i in ("%ConEmuDir%\..\..") do @set CMDER_ROOT=%%~fi
)
:: Change the prompt style
def flipCounter(stack):
result = 0
prev = '+'
first = True
for ch in stack:
if ch != prev and not first:
result += 1
prev = ch
first = False
@sclarson
sclarson / snapshot.sh
Created January 28, 2016 18:17
Snapshot some information on a linux server to establish a baseline in a really basic way
#!/bin/bash
EXT=`date +%H%M%S`
DAY=`date +%d`
mkdir -p ~/psaux
DIR="~/psaux/$DAY"
mkdir -p $DIR
free -m > $DIR/free.$EXT
ps aux > $DIR/ps.$EXT
top -n 1 -b > $DIR/top.$EXT
iostat -xm -p sda 3 3 > $DIR/iostat.$EXT
function ConvertToFormAndSubmit(databag, url, inputName) {
var index = 0;
var form = document.createElement('form');
form.setAttribute("method", "post");
form.setAttribute("action", url);
if (databag instanceof Array) {
for (index = 0; index < databag.length; index++) {
for (var prop in databag[index]) {
@sclarson
sclarson / httpCollect.js
Created December 21, 2013 15:48
nodeschoo.io's http collect
var http = require('http');
var total = 3;
var result = new Array();
function decrementAndPrint(element, data){
result[element] = data;
total -= 1;
if (total == 0){
console.log(result[0]);
console.log(result[1]);
var stuff = '';
var query = '';
$($('table')[0]).find('tr').each(function(){
tds = $(this).find('td');
stuff += 'public ' + $(tds[1]).text() + ' ' + $(tds[0]).text() + ' {get; private set;} \n';
query += ', ' + $(tds[0]).text();
});
@sclarson
sclarson / gist:6542902
Created September 12, 2013 19:50
Knuth Hash
private static UInt64 KnuthIt(string input)
{
UInt64 hashedValue = 3074457345618258791ul;
foreach (char t in input)
{
hashedValue += t;
hashedValue *= 3074457345618258799ul;
}
return hashedValue;
}