Skip to content

Instantly share code, notes, and snippets.

View stephlocke's full-sized avatar

Steph Locke stephlocke

View GitHub Profile
@stephlocke
stephlocke / IntoTheBreach.R
Created June 3, 2016 11:58
starting with HIBPwned
if(!require(HIBPwned)) install.packages("HIBPwned")
if(!require(wordcloud)) install.packages("wordcloud")
library(HIBPwned)
library(wordcloud)
breaches<-breached_sites()
wordcloud(breaches$Name, breaches$PwnCount,colors=c("#00AAE3", "#00538E", "#002852" ))
@stephlocke
stephlocke / example.ps1
Last active October 7, 2016 21:31
How to get container details from a storage account stored in an azure resource group
Import-Module AzureRM.Storage
$rgname="group"
$StorageAccountName="storage"
$container="container"
# getting Azure storage account key
$fullkeys = Get-AzureRMStorageAccountKey -StorageAccountName $StorageAccountName -ResourceGroupName $rgname
# the script will be using primary key
@stephlocke
stephlocke / s3toblob.ps1
Last active June 25, 2016 16:24
Workflow for getting new files from s3 into blob storage
workflow s3toqueue
{
param (
[Parameter(Mandatory=$false)]
[Int]$processNfiles = 10,
[Parameter(Mandatory=$false)]
[String]$SubscriptionName="subname",
[Parameter(Mandatory=$false)]
@stephlocke
stephlocke / .Rprofile
Last active July 20, 2018 07:04
HIBPwned .Rprofile examplel
.First<-function(){
cat(paste0("My data has been breached ",
length(HIBPwned::account_breaches("stephanie.g.locke@gmail.com")$name),
" times (that we know of)"))
}
@stephlocke
stephlocke / README.md
Last active February 6, 2017 16:19
Installation file for installing the Azure File Storage Docker plugin on Ubuntu 16.04+. Takes an argument to allow you to provide a prepopulated config file.

This is an installation script for the Azure File Storage Docker Plugin and is intended to work on Ubuntu 15+

Usage

You need a config file based on the default, that you can pass to this script. This helps you keep the config contents secret.

wget https://gist.githubusercontent.com/stephlocke/a02d7b8be42604e5b6bbd19d689ab28f/raw/fb1accb5baa435d8356d3b72adb9fa8dcc9f8818/install-azurefile-dockerplugin.sh
chmod +x install-azurefile-dockerplugin.sh
sudo ./install-azurefile-dockerplugin.sh azurefile-dockervolumedriver
@stephlocke
stephlocke / Functions.cs
Created August 22, 2016 14:56
Running Azure Functions in a WebJob
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;
namespace blah
{
public class Functions
{
public static void dummyFunction([TimerTrigger("00:00:30")], TraceWriter log){
log.Info("Hey, I worked");
@stephlocke
stephlocke / substitute_value.cs
Created August 23, 2016 10:42
Working with redis in c#
using StackExchange.Redis;
using System.Text;
private static Lazy<ConnectionMultiplexer> lazyConnection = new Lazy<ConnectionMultiplexer>(() =>
{
string redisCacheName = System.Environment.GetEnvironmentVariable("rediscachename", EnvironmentVariableTarget.Process).ToString();;
string redisCachePassword = System.Environment.GetEnvironmentVariable("rediscachepassword", EnvironmentVariableTarget.Process).ToString();;
return ConnectionMultiplexer.Connect(redisCacheName + ",abortConnect=false,ssl=true,password=" + redisCachePassword);
});
@stephlocke
stephlocke / mora.R
Last active April 6, 2024 01:37
Additive or multiplicative time series?
if(!require("ggseas")) install.packages("ggseas")
if(!require("forecast")) install.packages("forecast")
if(!require("data.table")) install.packages("data.table")
if(!require("knitr")) install.packages("knitr")
library(ggseas)
library(forecast)
library(data.table)
# Get data
@stephlocke
stephlocke / final.R
Last active March 28, 2017 08:53
Get Monty Python scripts
##---- Setup ----------------------
library(rvest)
library(purrr)
library(tidyverse)
library(tidytext)
library(stringr)
root<-"http://www.montypython.net/"
getScriptsLocs <- function(root) {
@stephlocke
stephlocke / SQLBitsCC.md
Last active December 30, 2016 12:59
SQLBits Community Corner activities

SQLBits Community activities

SQLBits Community Night

Overview

  • Wednesday night
  • 1 room
  • Pre-con speakers each doing a 5 minute talk
  • Pizza & refreshments

Proposed talk topics