Skip to content

Instantly share code, notes, and snippets.

@dmorrison
dmorrison / garethr.ps1
Last active August 29, 2015 14:12 — forked from garethr/garethr.ps1
# A simple BoxStarter script for use with http://boxstarter.org/WebLauncher
# Updates a Windows machine and installs a range of developer tools
# Show more info for files in Explorer
Set-WindowsExplorerOptions -EnableShowFileExtensions -EnableShowFullPathInTitleBar
# Default to the desktop rather than application launcher
Set-StartScreenOptions -EnableBootToDesktop -EnableDesktopBackgroundOnStart -EnableShowStartOnActiveScreen -EnableShowAppsViewOnStartScreen -EnableSearchEverywhereInAppsView -EnableListDesktopAppsFirst
# Allow running PowerShell scripts
@dmorrison
dmorrison / 0_reuse_code.js
Created May 29, 2014 15:36
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
~/Development/Work/new_cookbooks/god on master with 2.1.1 → berks upload god
E, [2014-05-01T15:08:37.548630 #27880] ERROR -- : Ridley::Errors::HTTPBadRequest: {"error":["Invalid element in array value of 'files'."]}
E, [2014-05-01T15:08:37.548762 #27880] ERROR -- : /Users/Derek/Development/Work/new_cookbooks/god/vendor/bundle/gems/ridley-3.1.0/lib/ridley/middleware/chef_response.rb:24:in `on_complete'
/Users/Derek/Development/Work/new_cookbooks/god/vendor/bundle/gems/faraday-0.9.0/lib/faraday/response.rb:9:in `block in call'
/Users/Derek/Development/Work/new_cookbooks/god/vendor/bundle/gems/faraday-0.9.0/lib/faraday/response.rb:57:in `on_complete'
/Users/Derek/Development/Work/new_cookbooks/god/vendor/bundle/gems/faraday-0.9.0/lib/faraday/response.rb:8:in `call'
/Users/Derek/Development/Work/new_cookbooks/god/vendor/bundle/gems/faraday-0.9.0/lib/faraday/response.rb:8:in `call'
/Users/Derek/Development/Work/new_cookbooks/god/vendor/bundle/gems/faraday-0.9.0/lib/faraday/response.rb:8:in `call'
/Users/Derek/Deve
@dmorrison
dmorrison / swap-lumberjack-for-logstash-forwarder.sh
Last active January 1, 2016 20:59
Uninstall Lumberjack and install logstash-forwarder
b knife ssh '...' 'sudo service lumberjack stop'
b knife ssh '...' 'sudo apt-get remove --purge -y lumberjack'
b knife ssh '...' 'sudo rm /etc/lumberjack.conf'
b knife ssh '...' 'sudo chef-client'
@dmorrison
dmorrison / gist:6670807
Last active December 23, 2015 17:39
.NET file upload example (in C#)
using System.Net;
public static class FileUploader
{
public static void Main()
{
const string address = "(enter address to post to here)";
const string fileName = "C:\\Full\\Path\\To\\File.csv"
// Upload the file to the URI. UploadFile() implicitly
@dmorrison
dmorrison / gist:981131
Created May 19, 2011 16:07
Re-map user to login in SQL Server
use <db_name>
alter user <user_name>
with login = <user_name>
@dmorrison
dmorrison / gist:942148
Created April 26, 2011 12:06
Remove ASP.NET membership objects from SQL Server
-- Removes all objects (in the correct order) added to
-- SQL Server by the stock ASP.NET membership provider
drop table aspnet_PersonalizationAllUsers
drop table aspnet_PersonalizationPerUser
drop table aspnet_Profile
drop table aspnet_SchemaVersions
drop table aspnet_UsersInRoles
drop table aspnet_WebEvent_Events
drop table aspnet_Paths
drop table aspnet_Membership
@dmorrison
dmorrison / gist:940532
Created April 25, 2011 13:46
C# string to byte[] to base 64 string back to original string
var text = "foobar";
var bytes = Encoding.Unicode.GetBytes(text);
var base64String = Convert.ToBase64String(bytes);
var sameBytes = Convert.FromBase64String(base64String);
var sameText = Encoding.Unicode.GetString(bytes);
@dmorrison
dmorrison / gist:879301
Created March 21, 2011 11:01
Favicon linking syntax for a virtual directory
<link rel="icon" href="/appname/path/to/favicon.ico" type="image/vnd.microsoft.icon" />
<link rel="shortcut icon" href="/appname/path/to/favicon.ico" /> <!-- IE -->