Thursday, 19 July 2018

Multifactor authentication


chrome://flags/#tls13-variant

Tuesday, 10 July 2018

Moving files in Sharepoint

To move files in Sharepoint, open Explorer and then type in the URL to the Sharepoint site.

Sunday, 1 July 2018

Freenas: Mount NFS as an alternative to SMB

As Windows 10 no longer supports SMB v1 as used by FreeNAS 0.7.2, it was necessary to find an alternative.

NFS works in Windows 10. You can describe the NFS client as described here.

I found I needed the nolock option to be able to view files.

mount -o nolock -o anon \\<Server>\<mount> x:

e.g. mount -o nolock -o anon \\<Server>\mnt\Data x:

It was also necessary to set two registry keys on each client to set the user ID and Group ID. Restart the NFS client with nfsadmin client start | stop.

This article also describes how you can change the user ID so the share is mounted as a different user.

If you mount NFS shares from an elevated command prompt (Run as administrator), the mount will not show up in the explorer running with normal user privileges. The solution is to unmount the share and remount it, either from explorer or from an ordinary command prompt. Admin privileges are not required for NFS mounts.

To find a user's UID or GID in Unix, use the id command. To find a specific user's UID, at the Unix prompt, enter:
 id -u username
Replace username with the appropriate user's username. To find a user's GID, at the Unix prompt, enter:
 id -g username
If you wish to find out all the groups a user belongs to, instead enter:
 id -G username
If you wish to see the UID and all groups associated with a user, enter id without any options, as follows:
 id username

Setting up on a machine for the first time
It is important to set the underlying Unix account that will be used by the anonymous account and nfs.

Without registry settings:

Test1: Folder created by FreeNas (root):  root/wheel - inaccessible by explorer
Test2: Folder created by SSH (root): root/wheel   - inaccessible by explorer
Test3: Folder created by X: drive before resgistry settings applied:  4294967294/wheel - accessible by explorer

By setting the registry settings:
AnonymousUid (DWORD32) : 1001 (decimal) - For <username>
AnonymousGid (DWORD32) : 0 (decimal)

and restarting nfsadmin client stop / start 
then:

Test4: Folder created by X: drive:  <username>/wheel - accessible by explorer


SSH to FreenNAS
ssh -oHostKeyAlgorithms=+ssh-dss <username>@freenas

Saturday, 23 June 2018

Galaxy Tab S tablet volume goes up and down: Farming Simulator 18

I was listening to BBC iPlayer (in Chrome) on my son's Galaxy Tab S and I noticed that the volume kept going up and down. All rather annoying. My other son's Tab S was doing the same. Other people have complained about this too.

So I did some debugging.

I put the Tab into developer mode, connected the USB and ran adb logcat > c:\temp\debug.txt from a command prompt.

Whenever the volume dropped I looked for patterns. I started to notice
requestAudioFocus() from android.media.AudioManager$8d530e6org.chromium.content.browser.AudioFocusDelegate$f901627 req=3flags=0x0

AudioManager dispatching onAudioFocusChange(-3)

and
AudioFocus  abandonAudioFocus() from android.media.AudioManager$8d530e6org.chromium.content.browser.AudioFocusDelegate$f901627

AudioManager dispatching onAudioFocusChange(1)

So I ran baretail with the syntax highlighting turned on and it confirmed the pattern was happening whenever the volume dropped.

Looking at the documentation it indicated that the audio was requesting to be reduced (and then subsequently returned to normal).

I ran adb shell ps > c:\temp\process to determine the process names that correlated to the PIDs in the log output.

Looking further in the logs I could see entries like

com.giantssoftware.fs18.google  14229 W AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 1, track 48000 Hz, output 44100 Hz

/system/bin/mediaserver  9422 W AudioPolicyIntefaceImpl: Skipped to add effects on session 332


Farming Simulator 18? What is this doing? It is installed, but not running in the foreground. It kept trying to do something with the audio.

It also kept trying to download some Javascript.
com.giantssoftware.fs18.google  com.giantssoftware.fs18.google  I chromium: [INFO:CONSOLE(1)] "05bd228f", source: https://vpaid.springserve.com/production/vpaid_a1597ab3.js (1)

So I uninstalled it. And the audio is back to normal!

The problem is known as "ducking". This article provides greater background.

It seems like Farming Simulator 18 was causing the problem. It was also installed on my other son's tablet.


Friday, 22 June 2018

Group Policy

Group Policy settings are stored at: C:\WINDOWS\system32\grouppolicy
Registry: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies

Let's Encrypt provides free certificates


https://letsencrypt.org/about/

Monday, 18 June 2018

Testing sql for concurrency bugs

There is a method for checking SQL or Stored Procedures against concurrency bugs. Using the SQL Server scheduler you can run two queries in parallel.

To do this:
Open two SQL Server query windows and then split them vertically.
Then in each window, run:

waitfor time '13:16:20.00'
exec uspMyStoredProcedure

You might need to run it several times as the scheduler is not accurate to microseconds, but if you have a long-running query it should show the bug relatively quickly.