Search

Categories

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Send mail to the author(s) E-mail

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

http://www.howtogeek.com/224170/how-to-monitor-your-network-usage-in-windows-10/

Settings, Network, Data Usage

image

To reset, delete all files from:

C:\Windows\System32\sru

image

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:  https://youtu.be/AjYMfLqRplI

1. Install Screensaver

https://github.com/cDima/Aerial 
e:\aerial
right click on the .scr and install

image
Shortcut to screen saver settings:  Screen saver

image 

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:

C:\Users\Dave\AppData\Local\Aerial

This will download what you need (C# Console App).

http://a1.phobos.apple.com/us/r1000/000/Features/atv/AutumnResources/videos/entries.json   - 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 = "http://a1.v2.phobos.apple.com.edgesuite.net/us/r1000/000/Features/atv/AutumnResources/videos/" + filename; Console.WriteLine("downloading " + filename); using (var client = new WebClient()) { client.DownloadFile(url, filename); } } } Console.ReadLine(); }

Or https://bitbucket.org/davemateer/screensaverdownloader/src   with a progress bar

image

 

image
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

image

Create a lock.bat file

image

@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

image

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

http://www.eightforums.com/tutorials/8267-power-options-add-console-lock-display-off-timeout.html

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

image

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\7516b95f-f776-4464-8c53-06167f40cc99\8EC4B3A5-6868-48c2-BE75-4F3044BE88A7

Change Hide to Show.

Attributes DWORD

1 = Hide "Console lock display off timeout"

2 = Show "Console lock display off timeout"

clip_image001

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:
http://farm-fresh-code.blogspot.co.uk/2014/02/lightweight-integration-testing-with.html

which was itself inspired by a Jimmy Bogard article
https://lostechies.com/jimmybogard/2012/10/18/isolating-database-data-in-integration-tests/

If you get the MSDTC error
http://toddmeinershagen.blogspot.co.uk/2014/05/data-integration-tests-and-transactions_25.html

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 = "todd4@asdf.com", 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()); }

asdf

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

j:\git\test
git init –bare

Add a remote

c:\dev\test
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

c:\dev\test2
git clone j:\git\test .

| | #