Skip to content

Instantly share code, notes, and snippets.

View cicorias's full-sized avatar

Shawn Cicoria cicorias

View GitHub Profile
@cicorias
cicorias / sp-w-cert-azps-1-0.ps1
Created November 17, 2015 12:44 — forked from devigned/sp-w-cert-azps-1-0.ps1
Create a service principal to auth with a certificate in Azure PowerShell 1.0
# Login to Azure PowerShell
Login-AzureRmAccount
# Create the self signed cert
$currentDate = Get-Date
$endDate = $currentDate.AddYears(1)
$notAfter = $endDate.AddYears(1)
$pwd = "P@ssW0rd1"
$thumb = (New-SelfSignedCertificate -CertStoreLocation cert:\localmachine\my -DnsName com.foo.bar -KeyExportPolicy Exportable -Provider "Microsoft Enhanced RSA and AES Cryptographic Provider" -NotAfter $notAfter).Thumbprint
$pwd = ConvertTo-SecureString -String $pwd -Force -AsPlainText
@cicorias
cicorias / gulpfile.js
Created December 2, 2015 05:05 — forked from glenasmith/gulpfile.js
Zip up your webjob files into a deployable artifact
gulp.task('webjob', function() {
var webjob = "feedFetcher.zip";
del(webjob)
return gulp.src(['parsers/*.js', 'package.json', 'feedFetcher.js'], {base: "."})
.pipe(zip(webjob))
.pipe(gulp.dest('.'));
});
Function
Convert-WindowsImage
{
<#
.NOTES
Copyright (c) Microsoft Corporation. All rights reserved.
Use of this sample source code is subject to the terms of the Microsoft
license agreement under which you licensed this sample source code. If
@cicorias
cicorias / gishell.cmd
Created December 16, 2015 16:48
A GitHub Desktop shell launcher..
%APPDATA%\..\Local\GitHub\GitHub.appref-ms --open-shell
@cicorias
cicorias / dump-devenv.cmd
Created January 26, 2016 23:26
dumping devenv.exe for hang or regular using sysinternals procdump
@echo off
SETLOCAL
SET PATH=%~dp0\sysinternalssuite;%PATH% > NUL
choice /C HR /T 5 /d R /M "HangDump [H] CD or [R] Regular"
IF ERRORLEVEL 2 GOTO REG
IF ERRORLEVEL 1 GOTO HANG
:REG
ECHO Will dump current process
sysinternalssuite\procdump.exe -ma devenv.exe e:\temp\devenv.dmp
@cicorias
cicorias / fix-homebrew-npm.md
Created January 29, 2016 15:08 — forked from DanHerbert/fix-homebrew-npm.md
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

Fixing npm On Mac OS X for Homebrew Users

If you just want to fix the issue quickly, scroll down to the "solution" section below.

Explanation of the issue

If you're a Homebrew user and you installed node via Homebrew, there is a major philosophical issue with the way Homebrew and NPM work together. If you install node with Homebrew and then try to do npm update npm -g, you may see an error like this:

$ npm update npm -g
Open Terminal
Type: sudo vi /etc/default/grub
Find the line starting with GRUB_CMDLINE_LINUX_DEFAULT, and add
video=hyperv_fb:[the resolution you want].
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=hyperv_fb:1920x1080"
Write the changes and quit vi.
Run: sudo update-grub
Reboot the virtual machin
@cicorias
cicorias / docker setup.sh
Last active February 11, 2016 03:58
basic steps to setup docker on Ubuntu 15.10 Willy
apt-get install apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo echo deb https://apt.dockerproject.org/repo ubuntu-wily main >> /etc/apt/sources.list.d/docker.list
sudo apt-get update
sudo apt-get purge lxc-docker
sudo apt-cache policy docker-engine
sudo apt-get install docker-engine
sudo service docker start
sudo usermod -aG docker cicorias
@cicorias
cicorias / gencert.sh
Created February 18, 2016 15:25
working Certificate Generation Commands
openssl genrsa -out key.pem
openssl req -new -key key.pem -out csr.pem
openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem
rm csr.pem
@cicorias
cicorias / agent.js
Created February 18, 2016 21:27 — forked from TooTallNate/agent.js
Node.js `http.Agent` class implementations...
/**
* Module dependencies.
*/
var net = require('net');
var inherits = require('util').inherits;
var EventEmitter = require('events').EventEmitter;
/**