Send mail to the author(s) E-mail

# Friday, September 02, 2016
( Azure | Git )

Git reset --hard asdf

Git clean –xfd


to make sure the azure web app is clear:


or better (Advanced Tools from just below Console above)..debug console CMD


| | # 
# Tuesday, August 16, 2016
( Web )

static void Main(string[] args)

    for (int i = 0; i < 100; i++)
        using (var client = new HttpClient())
            var responseString = client.GetStringAsync("http://localhost:7149/").Result;

        // post
        using (var client = new HttpClient())
            var values = new Dictionary<string, string> { { "message", $"hello{i}" } };

            var content = new FormUrlEncodedContent(values);

            var response = client.PostAsync("http://localhost:7149/home/contact", content).Result;
            var responseString = response.Content.ReadAsStringAsync().Result;


Passing credentials:


Get dictionary to pass to a form from Chrome Dev Tools (F12)

| | # 
# Tuesday, June 21, 2016
# Tuesday, May 24, 2016

Settings, Network, Data Usage


To reset, delete all files from:



If you see this, wait for about 1 minute and try again.

| | # 

Goal (Win10):

  • Screensaver shortcut – Ctrl Alt L
  • Force login after screensaver
  • Screen power off after 15 min

Here is what we are trying to do:

1. Install Screensaver 
right click on the .scr and install

Shortcut to screen saver settings:  Screen saver


2.Cache Videos

Useful if you are not on a fast link (my videos stopped and started a lot – 7MB/s link). The 6GB of total cached videos stored here:


This will download what you need (C# Console App).   - this is the json file which describes the files to download (from Aerial source)

static void Main() { for (int i = 1; i <= 10; i++) { for (int j = 1; j <= 4; j++) { var filename = "b" + i + "-" + j + ".mov"; var url = "" + filename; Console.WriteLine("downloading " + filename); using (var client = new WebClient()) { client.DownloadFile(url, filename); } } } Console.ReadLine(); }

Or   with a progress bar



If you ever get errors, clean out the entire cache and start again.  There is a bug (now fixed, but not in the tag4 release) which copied unfinished movie downloads into the cache directory.

3. Start Screensaver from keyboard shortcut


Create a lock.bat file


@START lockDesktop.exe
@%windir%\system32\rundll32.exe user32.dll,LockWorkStation

Create LockDesktop.exe

Use VisualStudio to create a console application

using System; using System.Runtime.InteropServices; namespace ConsoleApplication1 { public static class LockDesktop { [DllImport("user32.dll", EntryPoint = "GetDesktopWindow")] private static extern IntPtr GetDesktopWindow(); [DllImport("user32.dll")] private static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, int lParam); private const int SC_SCREENSAVE = 0xF140; private const int WM_SYSCOMMAND = 0x0112; public static void SetScreenSaverRunning() { SendMessage(GetDesktopWindow(), WM_SYSCOMMAND, SC_SCREENSAVE, 0); } public static void Main() { SetScreenSaverRunning(); } } }

4. Keyboard Shortcut


Right click on lock.bat in e:\aerial.  Create shortcut on desktop, then assign shortcut key.  I like Ctrl Alt L (which is similar to the Win L lock)

It should work!!!

5. Console Lock Display off timeout

I found that the screen would power down after 1 minute, however I wanted the screensaver on for 15minutes before screens went off:



Change Hide to Show.

Attributes DWORD

1 = Hide "Console lock display off timeout"

2 = Show "Console lock display off timeout"


So now you should be able to go to screensaver with:  Ctrl Alt L, and it should play for 15minutes, and go to login screen when move the mouse again.

| | # 
# Wednesday, April 27, 2016

Inspired by:

which was itself inspired by a Jimmy Bogard article

If you get the MSDTC error

Here is the start of an example just using rollback transactions

[TestClass] public class TransactionTests { [TestMethod] public void Insert_User_and_test_transaction_rolls_back() { var user = new User { CreatedDate = DateTime.Now, DisplayName = "Todd Smith4", Email = "", Active = true }; var sql = "INSERT INTO dbo.Users (CreatedDate, DisplayName, Email, Active) VALUES (@CreatedDate, @DisplayName, @Email, @Active)"; db.Execute(sql, user); var retrievedUser = db.Query<User>("select * from users where Email = @email", new { email = user.Email }).FirstOrDefault(); Assert.AreEqual(user.DisplayName, retrievedUser.DisplayName); Assert.AreEqual(user.Active, retrievedUser.Active); Assert.AreEqual(user.CreatedDate.ToString(), retrievedUser.CreatedDate.ToString()); }


private TransactionScope scope; private DbConnection db; private DapperUserRepositoryTestContext c; private bool rollBackTransaction = true; // before each test [TestInitialize] public void SetUp() { // direct access to the db db = new SqlConnection( ConfigurationManager.ConnectionStrings["DapperMangoTestingConnectionString"].ConnectionString); if (rollBackTransaction) scope = new TransactionScope(); // going through the repo c = new DapperUserRepositoryTestContext(); } // after each test [TestCleanup] public void TearDown() { if (rollBackTransaction) scope.Dispose(); db.Dispose(); }
| | # 
# Wednesday, April 06, 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 .

| | #