Skip to content

Instantly share code, notes, and snippets.

View daniellee's full-sized avatar

Daniel Lee daniellee

View GitHub Profile
@daniellee
daniellee / azure-log-analytics-sample-dashboard.json
Created April 24, 2020 06:48
Sample dashboard for Azure Log Analytics
{
"__inputs": [
{
"name": "DS_AZURE_MONITOR",
"label": "Azure Monitor",
"description": "",
"type": "datasource",
"pluginId": "grafana-azure-monitor-datasource",
"pluginName": "Azure Monitor"
}
@daniellee
daniellee / loki-overview.md
Last active December 6, 2018 23:09
Loki Overview

Overview

What is Loki?

Loki is a horizontally-scalable, highly-available, multi-tenant, log aggregation system inspired by Prometheus. It is designed to be very cost effective, as it does not index the contents of the logs, but rather a set of labels for each log stream. Plain text logging with labels.

Why Loki?

Almost all existing log aggregation solutions involve using full-text search systems to index logs (usually structured logs); at first glance this has some obvious advantages, with a rich and powerful feature set allowing for complex queries.

@daniellee
daniellee / finance-sample.json
Created November 14, 2017 14:51
Sample dashboard for the Grafana Finance data source
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@daniellee
daniellee / Boxstarter.ps1
Last active August 29, 2015 14:15
Dev machine
Update-ExecutionPolicy Unrestricted
Enable-MicrosoftUpdate
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
Enable-RemoteDesktop
Set-StartScreenOptions -EnableBootToDesktop
#IIS setup and url rewrite module
choco install -source windowsfeatures IIS-WebServerRole IIS-WebServer IIS-ApplicationDevelopment IIS-ManagementScriptingTools IIS-ASPNET IIS-ASPNET45 IIS-ASP IIS-WebSockets IIS-ApplicationInit IIS-HttpTracing IIS-DefaultDocument IIS-CommonHttpFeatures IIS-ISAPIFilter IIS-ISAPIExtensions IIS-NetFxExtensibility IIS-NetFxExtensibility45 IIS-RequestFiltering IIS-Security IIS-WindowsAuthentication IIS-HttpCompressionDynamic
choco install UrlRewrite
@daniellee
daniellee / gist:5520400
Created May 5, 2013 10:16
FluentMigrator Release Notes for 1.1.0

Release Notes

Nuget package: http://nuget.org/packages/FluentMigrator/

1.1.0

Released: Sunday, May 05, 2013

In the 1.1.0 release, the major focus has been the refactoring of the MigrationRunner to allow two transaction modes. Up to this release, there has been one mode, Transaction-Per-Session. This means that if two migrations or more migrations are run together during the same task (e.g. migrate up or down) then this occurs in the same transaction and if one of the migrations fails then all the migrations are rolled back. We are introducing a new mode called Transaction-Per-Migration. This mode means that each migration is run in its own transaction and allows selected migrations to be run with no transaction. This allows migrations to be able to do tasks like creating full-text indexes which cannot be run in a transaction.

Features:

@daniellee
daniellee / gist:5446026
Created April 23, 2013 18:18
Part of my .gitconfig
[merge]
tool = p4merge
keepBackup = false
[mergetool "p4merge"]
cmd = p4merge.exe /\"$BASE/\" /\"$LOCAL/\" /\"$REMOTE/\" /\"$MERGED/\"
trustExitCode = false
keepBackup = false
[diff]
tool = p4merge
guitool = p4merge
@daniellee
daniellee / gist:5298964
Created April 3, 2013 06:48
Benchmark of switch vs dictionary
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
namespace SwitchVsDictionaryBenchMark
{
class Program
{
private static readonly Dictionary<string, Action> dictWithStrings = new Dictionary<string, Action>(3);
{"id":"4f2b8b4d4f2cb9d16d3684c9","name":"Welcome Board","desc":"A test description","closed":false,"idOrganization":"4f2b94c0c1c87fcb65422344","pinned":true,"url":"https://trello.com/board/welcome-board/4f2b8b4d4f2cb9d16d3684c9","prefs":{"selfJoin":false,"invitations":"members","comments":"members","voting":"members","permissionLevel":"private"},"invitations":[{"id":"4f79b0a3015f74477a77726a","idMemberInviter":"4f2b8b464f2cb9d16d368326","dateExpires":"2012-05-02T13:58:59.566Z","idMemberInvited":"4f79b065798c8dee3d2bb252"}],"memberships":[{"id":"4f2b8b4d4f2cb9d16d3684c8","idMember":"4e6a7fad05d98b02ba00845c","memberType":"normal"},{"id":"4f2b8b4d4f2cb9d16d3684d3","idMember":"4f2b8b464f2cb9d16d368326","memberType":"admin"},{"id":"4f359bd2655ca8cf3f047637","idMember":"4ece5a165237e5db06624a2a","memberType":"normal"}],"labelNames":{"yellow":"","red":"","purple":"","orange":"","green":"label name","blue":""},"invited":false,"myPrefs":{"showListGuide":false,"showSidebarActivity":true,"showSidebarBoardActions":true,
@daniellee
daniellee / LdapObject
Created April 11, 2012 14:40
LdapObject
public interface ILdapObject
{
string ObjectName { get; set; }
string Context { get; set; }
}
public abstract class LdapObject<T>: ILdapObject where T: ILdapObject, new()
{
public string ObjectName { get; set; }
public string Context { get; set; }