Skip to content

Instantly share code, notes, and snippets.

$jobj = [Newtonsoft.Json.Linq.JObject]::Parse($mystring)
---
- name: Do stuff to stuff
hosts: localhost
tasks:
- name: set fact
set_fact:
thing: otherstuff
- name: first run - no loop
include_role:
name: myrole
input {
http {
port => "8081"
codec => "json"
}
}
filter {
}
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Net;
public static void Run(string myEventHubMessage, TraceWriter log)
{
String data = myEventHubMessage;
log.Info($"C# Event Hub trigger function processed a message: {data}");
data = data.Replace("http://schemas.microsoft.com", "");
sudo apt-get update
sudo apt-get install git python-setuptools python-dev sshpass libffi-dev libssl-dev make libxml2-dev libxslt1-dev acl build-essential -y
sudo easy_install pip
sudo pip install paramiko PyYAML jinja2 httplib2 requests lxml cssselect xmltodict sphinx
sudo pip install pywinrm
sudo pip install requests==2.13.0
sudo pip install packaging
#In order to build docs:
sudo apt-get install asciidoc -y
#!/usr/bin/python
# -*- coding: utf-8 -*-
# <COPYRIGHT>
# <CODEGENMETA>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#!powershell
# <COPYRIGHT>
# <CODEGENMETA>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#Module PowerShellGet
#File PSModule.psm1
#Bug causes publish-module to fail if user has a profile with spaces in it ("C:\users\sam smith")
#Replace line 6817 with the following:
Microsoft.PowerShell.Management\Start-Process -FilePath "$script:NuGetExePath" `
-ArgumentList ('push "' + $NupkgPath + '"' + " -source $Destination -NonInteractive -ApiKey $NugetApiKey") `
-RedirectStandardError $tempErrorFile `
-RedirectStandardOutput $tempOutputFile `
-NoNewWindow `
-Wait
@trondhindenes
trondhindenes / errortest.ps1
Last active December 28, 2015 19:03
ErrorWeirdness
Function Inner
{
[CmdletBinding()]
Param ()
Try
{
throw "Inner exception"
}
Catch
@trondhindenes
trondhindenes / createpicturetable.vba
Created November 19, 2015 10:16
Create word table and auto-fill images
'Create the following Word Macro:
Sub InsertMultipleImages()
Dim fd As FileDialog
Dim oTable As Table
Dim sNoDoc As String
Dim vrtSelectedItem As Variant
Dim Counter As Integer
If Documents.Count = 0 Then
sNoDoc = MsgBox(" " & _
"No document open!" & vbCr & vbCr & _