Skip to content

Instantly share code, notes, and snippets.

View davidst's full-sized avatar

David Stanescu davidst

  • Fourthline
  • Amsterdam
View GitHub Profile
Install-WindowsUpdate -AcceptEula -SuppressReboots
# Windows configuration
# Disable-InternetExplorerESC
# Disable-GameBarTips
# Disable-UAC
# Enable-RemoteDesktop
# Set-WindowsExplorerOptions -DisableShowHiddenFilesFoldersDrives -DisableShowProtectedOSFiles -DisableOpenFileExplorerToQuickAccess -EnableShowFileExtensions -EnableShowFullPathInTitleBar -EnableExpandToOpenFolder -EnableShowRibbon
# Set-TaskbarOptions -Size Large -Lock -Dock Bottom -Combine Full
# Update-ExecutionPolicy Unrestricted
# Windows configuration
Disable-InternetExplorerESC
Disable-UAC
Enable-RemoteDesktop
Set-WindowsExplorerOptions -DisableShowHiddenFilesFoldersDrives -DisableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar
Update-ExecutionPolicy Unrestricted
choco feature enable -n=allowGlobalConfirmation
# Install programs
@davidst
davidst / mongodb_collection_sizes.js
Last active June 26, 2017 16:01
List mongodb collections in descending order of size. Helpful for finding largest collections. First number is "size," second is "storageSize."
var mongo = db.getMongo();
function bytesToSize(bytes) {
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
if (bytes == 0) return '0 Byte';
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[i];
}
function getCollectionStatsFor(dbName, sort) {
Install-WindowsUpdate -AcceptEula -SuppressReboots
# Windows configuration
Disable-InternetExplorerESC
Disable-GameBarTips
Disable-UAC
Enable-RemoteDesktop
Set-WindowsExplorerOptions -DisableShowHiddenFilesFoldersDrives -DisableShowProtectedOSFiles -DisableOpenFileExplorerToQuickAccess -EnableShowFileExtensions -EnableShowFullPathInTitleBar -EnableExpandToOpenFolder -EnableShowRibbon
Set-TaskbarOptions -Size Large -Lock -Dock Bottom -Combine Full
Update-ExecutionPolicy Unrestricted
Install-WindowsUpdate -AcceptEula -SuppressReboots
# Windows configuration
Disable-InternetExplorerESC
Disable-UAC
Enable-RemoteDesktop
Set-WindowsExplorerOptions -DisableShowHiddenFilesFoldersDrives -DisableShowProtectedOSFiles -DisableOpenFileExplorerToQuickAccess -EnableShowFileExtensions -EnableShowFullPathInTitleBar -EnableExpandToOpenFolder -EnableShowRibbon
Set-TaskbarOptions -Size Large -Lock -Dock Bottom -Combine Full
Update-ExecutionPolicy Unrestricted