Skip to content

Instantly share code, notes, and snippets.

View khenidak's full-sized avatar
💭
"If we're going to be damned, let's be damned for what we really are."

Khaled Henidak (Kal) khenidak

💭
"If we're going to be damned, let's be damned for what we really are."
View GitHub Profile
@khenidak
khenidak / nested-dev-env-azure.md
Created June 11, 2018 01:01
Create nested dev environment on Azure

Create a nested development envrionment on Azure VM. I use this for kernel specific sandboxes/dev. Admittedly, This is following my own quirky dev env. So apprach this with care.

What will you have:

  1. Separate virtual network for your sandbox
  2. QEMU (kvm enabled) vms running using this network
  3. Additional data disk aufs mounted for home directory (to move that disk to new vms if needed)

Steps

@khenidak
khenidak / createAzureStorageSharedKey.js
Created January 7, 2016 18:02
Create Azure Storage REST API SharedKey
var crypto = require('crypto');
var algo = 'SHA256';
var hashencoding = 'base64';
// the below is not checked for casing
var arStandardHeaders = ['content-encoding', 'content-language', 'content-length', 'content-md5', 'content-type',
'date', 'If-Modified-Since', 'If-Match', 'If-None-Match', 'If-unmodified-Since', 'range'];
@khenidak
khenidak / Clicker.cs
Created October 10, 2015 02:51
Clicker is high performance lock-free in memory histogram (moving calculation) like implementation
// for more details please refer to: http://henidak.com/2015/10/on-train-rides-and-histograms/
/*
Typical Use
- Create a class (or use Click class) that sub-classes Click (if you need more than *.value)
- The implementation favors speed over memory (it will copy the tree everytime you do a calc using the Do method).
// this keeps the clicks for 1 min, then remove anything older
private Clicker<MyClickType> m_MinuteClicker = new Clicker>MyClickType>(TimeSpan.FromMinutes(1));
// this keeps the clicks for 1 hour, then remove anything older
@khenidak
khenidak / ServiceFabricCompositeListener
Last active December 11, 2017 01:50
Composite Listener allows you to create multiple ICommunicationListener(s) per Service Fabric Replica (each can run its own communication stack)
/*
** this code is undergoing major updates (and fixes), please stay tuned.
for more details check: http://henidak.com/2015/10/azure-service-fabric-multiple-communication-listeners-per-service/
*/
public enum ICommunicationListenerStatus
{
Closed,
Opening,
Opened,