Friday, September 7, 2018

Migrating Windows Fileservers: Preserving NTFS and Domain Controller Permissions

A client was running a Windows 2008 fileserver. Share folders have been created and used for years, and permissions were set per group or per user over the many folders, linked to Active Directory domain controller.

For this particular case, the shares were on a dedicated drive that is a storage mapped volume. Reassigning the volume from the old server to a new one is quite easy, but the tricky part was preserving the share settings and the NTFS permissions along with the active directory domain controller security permissions.

After much digging around, the solution was a builtin command line that can backup the permissions, and exporting a registry key to backup the configurations of the shares and their paths. Make sure you test this on a test machine first before applying to production! This will save both local users and domain controller security permissions.

Pay attention to back slashes (\) as it makes a difference to the tool.

Step 0: Backup and Restore Shares and their Permissions


  • Run regedit with administrator permission: search for regedit then right click and choose "Run as Administrator"
  • Go to this location:  HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares
    Note: HKLM = HKey_Local_Machine
  • Right click the Shares registry key and export. The key that looks like a folder in the left pane, not the content inside on the right pane.
To restore the shares and their permissions, double click the saved exported file.

Step 1: Backup and Restore NTFS and Active Directory Security Permissions

  • Open the command prompt (cmd.exe) with administrator permission.
  • To backup: icacls "path to folder" /save ntfsperms.txt /t /c 2> errors.txt
    Example: icacls d:\data /save ntfsperms.txt /t /c 2> errors.txt
    /t for recursion to include subfolders of the main one.
    /c to continue even when errors occur, but they'll printed and written to the errors text file.

    Note: If you put multiple folders directly on the root of the drive, the command should look like this: icacls d:\* /save ntfsperms.txt /t /c 2> errors.txt
To restore: icacls d:\ /restore ntfsperms.txt

Yes, there's a difference in the way you restore the permissions and the path. Even if you had backed up d:\data, you restore to the root directory/folder d:\. That's how the tool works.

Keep in mind that the text file you'll save the permissions to will exist in the same place where it's showing the command prompt. If you run the cmd as Admin, you'll be in C:\Windows\System32 by default.

Thursday, August 30, 2018

Kuwait Game Jam 2018

Once again, Q8Geek is organizing Kuwait Game Jam, where people gather to create games over a weekend based on a theme decided on the first day.

Date: September 6 - September 8
Location: Niu - Business District One
Details: https://bit.ly/kgj_18


Kuwait Game Jam 2018 - Poster 1
https://www.instagram.com/p/Bm-u0QzBtnm/?taken-by=q8geek

Kuwait Game Jam 2018 - Poster 2
https://www.instagram.com/p/BnD2cpCncmT/?taken-by=q8geek

Saturday, August 25, 2018

High CPU Utilization on Live Streams

While watching a live stream of Dota2, I noticed my CPU utilization on Firefox (Fx) is going 50%-60% after a minute of watching the stream. I did some comparison against Chrome and Brave and both were using less than 3%.

The live stream website of Steam TV uses Akamai's HTTP Live Streaming, which according to Akamai, uses H264 video codec and AAC audio codec. Specifically:
Video: H.264 Baseline Profile Level 3.0, Main Profile Level 3.1, High Profile Level 4.1, and MPEG-4 Simple Profile
Audio: HE-AAC or AAC-LC up to 48 kHz
In all cases below, there's only one private/incognito tab open, each browser was launched without the other loading the same site, and left to stream for 2 minutes minimum.

I did the same comparison against YouTube & Vimeo, and all browsers had very low CPU utilization.

Computer Specs

CPU: i7-6700k
GPU: nVidia GTX 1080
OS: Windows 10 Pro - Build 17134

Firefox Browser

firefox cpu and gpu utilization
CPU utilization: 60.9%
GPU utilization: 5.4%
Memory utilization: 788 MB
Browser version: 61.0.2

Note: There's only one tab open, but you see 6 processes launched. This is probably using multiple processes for video or other content the site has loaded.

I have disabled Ghostery addon intentionally to make sure the spike in CPU wasn't caused due to blocked scripts, ads or anything else.

Firefox GPU options: I checked the "Performance" under General options and when unchecking the Optimum check mark, it does show that it uses hardware acceleration when available.

GPU Options


H264 Options


Brave Browser

brave cpu and gpu utilization
CPU utilization: 1.9%
GPU utilization: 12.3%
Memory utilization: 634 MB
Browser version: 0.23.79

Browser left to its default settings.

Chrome Browser

chrome cpu and gpu utilization
CPU utilization: 1.4%
GPU utilization: 3.7%
Memory utilization: 271 MB
Browser version: 68.0.3440.106

Browser left to its default settings.

Oddly enough, it's using the least GPU, but still manages to keep CPU utilization low.

Summary

I still don't know what's the cause. Be mindful of what you use and your resources, as more CPU utilization can quickly eat your device's battery (laptop).

Update 1: Aug 26th, 2018 - 19:17. Added system info and browsers' version.