Skip to content

Instantly share code, notes, and snippets.

View shanselman's full-sized avatar

Scott Hanselman shanselman

View GitHub Profile
REG ADD HKLM\SYSTEM\CurrentControlSet\Services\W3SVC /v SvcHostSplitDisable /t REG_DWORD /d 1 /f
REG ADD HKLM\SYSTEM\CurrentControlSet\Services\WAS /v SvcHostSplitDisable /t REG_DWORD /d 1 /f
app.get('/dumpme', function (req, res) {
var fs = require('fs'),
ws = fs.createWriteStream('debugdump/'+Date.now() + '.heapsnapshot'),
profiler = require('v8-profiler'),
snapshot = profiler.takeSnapshot(),
callback = ws.end.bind(ws);
snapshot.serialize(function(data) {
ws.write('' + data);
}, callback);//begin cpu profiling
@shanselman
shanselman / k8s-pi.md
Last active April 30, 2022 10:05 — forked from alexellis/k8s-pi.md
K8s on Raspbian

K8s on (vanilla) Raspbian Lite

Yes - you can create a Kubernetes cluster with Raspberry Pis with the default operating system Raspbian. Carry on using all the tools and packages you're used to with the officially-supported OS.

Pre-reqs:

  • You must use an RPi2 or 3 for Kubernetes
  • I'm assuming you're using wired ethernet (Wi-Fi also works)

Master node setup

@shanselman
shanselman / start480x800.1024.bat
Created December 6, 2012 22:21
Start WP8 SDK Emulator
@echo off
"C:\Program Files (x86)\Microsoft XDE\8.0\xde.exe" -createDiffDisk "C:\Users\Erik\AppData\Local\Microsoft\XDE\dd.480x800.1024.vhd" -vhd "C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Emulation\Images\Flash.480x800.vhd" -name "Emulator WVGA.erik" -memsize 1024
Imagine </em><a href="http://ad.doubleclick.net/clk;255267509;66891495;c?http://www.ontimenow.com/?utm_source=hanselman&utm_medium=text&utm_content=imagine&utm_campaign=2012-04"><em>agile project management software </em></a><em>that is brilliantly easy to use,
<phone:PhoneApplicationPage
x:Class="AkavacheWP8.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at FluentAutomation.REPL.REPL.consoleTextBox_KeyDown(Object sender, KeyEventArgs e) in c:\Projects\FluentAutomation.Repl\REPL.cs:line 303
at System.Windows.Forms.Control.OnKeyDown(KeyEventArgs e)
at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
at System.Windows.Forms.Control.WmKeyChar(Message& m)
@shanselman
shanselman / gist:3767880
Created September 22, 2012 21:24
SignalR talk ideas
SignalR makes the Realtime Web Fun
SignalR - Realtime Changes everything
SignalR - Powering the Realtime Web
-----
SignalR is a new open source library from David Fowler and Damien Edwards on the ASP.NET team. More and more applications include a realtime component like chats and stock tickers. We’ve recently see many new frameworks emerge like socket.io and node.js to solve problems of asynchrony and realtime on the web. You’ve heard of technologies like web sockets, forever frames, long polling and server-sent events. We’ll see how you can easily add SignalR and power realtime techniques to your existing ASP.NET application. What does SignalR build upon and will it scale? There will be lots of code and demos in this technical talk.
@shanselman
shanselman / removeNetCorePreviews.ps1
Created March 3, 2018 01:33
Remove .NET Core ASK Previews - Run as admin
$choices = New-Object Collections.ObjectModel.Collection[Management.Automation.Host.ChoiceDescription]
$choices.Add((New-Object Management.Automation.Host.ChoiceDescription -ArgumentList '&Yes'))
$choices.Add((New-Object Management.Automation.Host.ChoiceDescription -ArgumentList '&No'))
Get-WmiObject Win32_Product -filter "name LIKE '%Preview%' AND name LIKE '%SDK%'" | ForEach-Object {
$message = "ZOMG"
$question = "Uninstall " + $_.Name + "?"
$decision = $Host.UI.PromptForChoice($message, $question, $choices, 0)
if($decision -eq 0) {
$_.Uninstall()
General idea is/
* get an azure trial at azure.com. 10 free websites per region.
get the azure command line with npm
>npm install azure-cli --g
Now you can type "azure" and call rest services to do anything.
import your account creds: