Skip to content

Instantly share code, notes, and snippets.

All done and working (at least the initial EF migration) with PostgreSQL.
For anyone wanting to use it basic steps are:
Install PostgreSQL (http://www.postgresql.org/download/linux/)
Create a username and pass you would like to use in EF. Via terminal type:
sudo -u postgres psql
psql#> create user createdb createuser password ‘’;
psql#> \q
# Act like Vim
set-window-option -g mode-keys vi
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
# Look good
set-option -g default-terminal "screen-256color"
@thinktainer
thinktainer / find-field.sh
Created July 14, 2015 10:45
find field in es mappings
curl http://es-instance:9200/_mapping/ | python -mjson.tool | grep -ni -C 3 duration
Vagrant.configure(2) do |config|
config.vm.box = "box-cutter/debian81"
config.vm.network "private_network", ip: "10.0.1.2"
config.vm.network "forwarded_port", guest: 6379, host: 6379
config.ssh.forward_agent = true
config.vm.synced_folder "#{ENV['HOME']}/salt/roots", "/srv/salt"
config.vm.synced_folder "#{ENV['HOME']}/salt/pillar", "/srv/pillar"
@thinktainer
thinktainer / restore.sh
Created July 9, 2015 08:05
git Restore files tracking in index
git ls-files -v | awk '/^h/ {print $2}' | grep -v keep_ignoring | xargs git update-index --no-assume-unchanged
@thinktainer
thinktainer / build.fsx
Created June 3, 2015 14:18
Powershell from FAKE
Target "BlitzDb" <| fun _ ->
if isLocalBuild then
let logPs = sprintf "%A" >> trace
let runspaceConfig = RunspaceConfiguration.Create()
use runspace = RunspaceFactory.CreateRunspace(runspaceConfig)
runspace.Open()
use runspaceInvoke = new RunspaceInvoke(runspace)
runspaceInvoke.Invoke("Set-ExecutionPolicy -Scope Process -ExecutionPolicy Unrestricted") |> Seq.iter logPs
runspaceInvoke.Invoke("Push-Location -Path './db/deploy'")
let ps = runspace.CreatePipeline()
@thinktainer
thinktainer / linkcollection.md
Last active August 29, 2015 14:21
SignalR and WebAPI

Running SignalR and WebAPI from same startup class

When not hosting from httplistener the IAppBuilder.UseWebApi method goes missing. Here are the instructions to fix this. It boils down to install-package microsoft.aspnet.webapi.owin.

@thinktainer
thinktainer / errorcede.cs
Created April 17, 2015 10:21
get win error code from HRESULT
var errorCode = Marshal.GetHRForException(ex) & ((1 << 16) - 1);
@thinktainer
thinktainer / Vagrantfile
Created April 9, 2015 18:02
vagrant docker host
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Specify Vagrant version and Vagrant API version
Vagrant.require_version ">= 1.6.0"
VAGRANTFILE_API_VERSION = "2"
# Create and configure the VM(s)
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
F:\perfview\perfview.exe -ClrEvents="default-stack-GCHeapSurvivalAndMovement" -StopOnGCOverMSec:500 -DelayAfterTriggerSec:0 -CircularMB:3000 -CollectMultiple:3 -NoGUI -NoNGENRundown -AcceptEULA -ThreadTime -DumpHeap -Process="Bede.Wallet.ServiceHost" collect