Send mail to the author(s) E-mail

# Wednesday, 06 April 2016
( Git )

I’ve come across a situation where the only way to have git is to install it locally, then push to a safe backed up fileshare.

Setup a bare repo on the fileshare

git init –bare

Add a remote

git init
git add .
git commit –m “initial commit”
git remote add origin file://j:\git\test  -- add a remote called origin…  note file://h:\\git\\booktech notice escapes in gitbash
git push --set-upstream origin master

Clone test

git clone j:\git\test .

| | # 
# Tuesday, 29 March 2016

“Chocolatey is a package manager for Windows (like apt-get or yum but for Windows). It was designed to be a decentralized framework for quickly installing applications and tools that you need. It is built on the NuGet infrastructure currently using PowerShell as its focus for delivering packages from the distros to your door, err computer.”

  • Open Cmd prompt as admin
  • Paste in code
  • choco


choco install ccleaner

Very useful for new build!

| | # 
# Thursday, 24 March 2016

for %%a in ("*.mp4") do ffmpeg -i "%%a" "newfiles\%%~na.mp3"


Converts all mp4's in directory to newfiles\

Open ffmpeg in its own cmd shell

| | # 
# Friday, 19 February 2016
( Azure )

“The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.”

<httpErrors existingResponse="PassThrough"/>
| | # 
# Wednesday, 17 February 2016
( MVC5 )

From this answer I’m considering the Authors and Books example I am building:

/Authors                               - list of Authors (multiple)
/Authors/1                           - individual Author  (this is the only non default route in MVC)
/Authors/Create                 - create an Author
/Authors/Edit/1                   - edit an Author
/Authors/Delete/1              - delete an Author

/Authors/Search?lastName=mateer  - search for an Author lastName=mateer

/Authors/1/Dave-Mateer   - individual Author  (first name / last name)


Pluralising the table name.  Discussion here:
A descriptive auto-inc ID.

Stored Proc Parameters

CREATE PROCEDURE [dbo].SearchAuthorByLastName
    @LastName varchar(255)
    SELECT * FROM [Authors] WHERE LastName like '%' + @LastName + '%'

Use capital letters for SP parameters

| | # 
# Tuesday, 16 February 2016

Exploring workflows of

  • DB Project in VS2015
  • Appveyor
  • Deploying to Azure

with the end goal of having a well tested app, which has good automated deployment.


So, easy to easily redeploy a standard db

If I put a BookTech.mdf and .ldf in the IntegrationTests project then in Appveyor, before tests, run this PS:

$startPath = "$($env:appveyor_build_folder)\BookTechSite.IntegrationTests\bin\debug\"
$sqlInstance = "(local)\SQL2014"
$dbName = "BookTech"

# replace the db connection with the local instance
$config = join-path $startPath "BookTechSite.IntegrationTests.dll.config"
$doc = (gc $config) -as [xml]
$doc.SelectSingleNode('//connectionStrings/add[@name="BookTechConnectionString"]').connectionString = "Server=$sqlInstance; Database=$dbName; Trusted_connection=true"

# attach mdf to local instance
$mdfFile = join-path $startPath "BookTech.mdf"
$ldfFile = join-path $startPath "BookTech_log.ldf"
sqlcmd -S "$sqlInstance" -Q "Use [master]; CREATE DATABASE [$dbName] ON (FILENAME = '$mdfFile'),(FILENAME = '$ldfFile') for ATTACH"

this works, but clunky.


This is working well and great to have the database source controlled. – useful starting config file - Connection strings are encrypted – took to encrypt


version: 1.0.{build}

  # CI Appveyor connection string - if this Environment Variable is present, then the Repository code uses this connection string.
  AppveyorSQL2014ConnectionString: Server=(local)\SQL2014;Database=BookTech;User ID=sa;Password=Password12!
  # Live Azure db connection string - encrypted using tool in Appeyor UI
  #,1433;Database=booktech2;User ID=dave@booktechserver;Password=******;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;
  # update line 45 too!
  BookTechConnectionString-Web.config Connection String:
    secure:  LCcX3rMYSmcHDQ966zbpW/sUFD1xQe3J0mwAzYj7t/y1r25psjHhoU6lBVmlZyhQYPGumsxvPQ20IZRJohWCVMRYxiSmkvJWKHT9yO9HMKPr1HRLnjt6iYKExQD30KnQUAjc93DNWFtCax4lSXlP5rjUC3ssx7XJJTdQ4MwTI9LHhBH7CBQuWvTNqMTQ8ps+X3Hl4T1zXnUJY/0x0olFvxqDPuY1PlQt8hd69Jc9l2yA4vaG/QAKiGsKtmUnc4EV
  - {}
services: mssql2014

# deploy .dacpac package to local SQL Server instance for integration testing
  - '"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:dbDacFx="C:\projects\BookTech\BookTechDatabase\bin\Debug\BookTechDatabase.dacpac" -dest:dbDacFx="%AppveyorSQL2014ConnectionString%",dacpacAction=Deploy,CreateNewDatabase=True'
  - cmd: appveyor-retry nuget restore

  publish_wap: true
  verbosity: minimal

  - path: BookTechDatabase\bin\debug\BookTechDatabase.dacpac
    name: BookTech 
  # Deploy website to Azure
  - provider: WebDeploy
    website: booktech
    username: $booktech
      # Was put in via the UI and exported to yml - essentially the publish settings for the website from Azure
      secure: rkp03SX+duzOUKu/ZRymYUXI4b6OIXIrEzIIDm2605q8MBTBlrQwxGN8zxCCovEYj2lkv5qoMvy8TTAW+zASVA==
    remove_files: true
    # Deploy Database to Azure - firewall rules are setup on Azure side to allow inbound connections..
  - provider: SqlDatabase
    artifact: BookTech
    # Same as line 8
      secure:  LCcX3rMYSmcHDQ966zbpW/sUFD1xQe3J0mwAzYj7t/y1r25psjHhoU6lBVmlZyhQYPGumsxvPQ20IZRJohWCVMRYxiSmkvJWKHT9yO9HMKPr1HRLnjt6iYKExQD30KnQUAjc93DNWFtCax4lSXlP5rjUC3ssx7XJJTdQ4MwTI9LHhBH7CBQuWvTNqMTQ8ps+X3Hl4T1zXnUJY/0x0olFvxqDPuY1PlQt8hd69Jc9l2yA4vaG/QAKiGsKtmUnc4EV

| | #