Thursday, September 19, 2019

Introduction to scoop

Scoop is a tiny command-line installer for Windows, which helps to organize user's apps in more convenient way. All of them are installed by default in home directory or in selected by the use directory, and of course this is not the only feature: - updating all of them with one command - continuously growing database of supported apps - fully portable between Windows version that support at least PowerShell 5 and .NET Framework 4.5 Those features mean the users finally have a tool similar to Linux package managers like dpkg/apt, yum/dnf, portage (btw very powerful), slackpkg, Homebrew for MacOS and Chocolatey/Ninite/OneGet for Windows. It works like this (assuming the user OS meets the requirements):
1. Open a PowerShell command prompt 
2. Write "scoop search nameofyourapp"
3. If it's found in the buckets (collections of apps in scoop) write "scoop install name-of-your-app"
4. After successful app installation (scoop warns if there are problems during installation procedure and suggests what to do to fix them) the user must open "Start Menu -> All Programs -> Scoop Apps" and click on the corresponding shortcut to start the freshly installed application
There are also limitations: - number of bucketed apps is still less than those in Chocolatey - sometimes changes in app version or small code errors in app manifests block the user from successfully installing or updating desired apps. Usually an update to scoop fixes that because the whole development is on GitHub where every scoop user can report the problems

Friday, June 21, 2019

GDPR compliance in a nutshell

Recently MongoDB added field encryption in version 4.2. This means if there's a request to delete all user data (stated in GDPR) administrator can delete the encryption key(s) which is used for access to the personal data. So no key - no data ... right ... but the data is still there and probably ready to be brute-force decrypted. Nice try, MongoDB

Saturday, March 2, 2019

A simple check for power outages

Sometimes users leave their computers on for longer intervals than usual only to see later that they have stopped or worse - dead because there were power surges. Reasons for that - one of them is the power outage. Many haven't a good protection like UPS or backup power sources and it's good to know exactly when this happened. Relatively it helps to estimate when to shutdown the hardware preventing it from losing data or become broken. One simple way is to check when this occured with the following PowerShell command (assuming the user is using Windows Vista and above):

Get-EventLog -LogName System -EntryType Error | Where-Object {$_.EventID -eq 6008} | Select -Property Message | ForEach-Object { if ($_.Message -match "([0-9]{1,2}:.*[0-9]{4})") { Write-Output "System shutdown at $($Matches[1])"}}

This parses whole Event Log on the machine with level Error in System Log where the event ID is unexpected system shutdown (eventID 6008) and outputs the results using regexp for extracting the date and time:

System shutdown at 2:05:00 PM on ‎3/‎1/‎2019
System shutdown at 1:32:30 PM on ‎2/‎27/‎2019
System shutdown at 9:28:38 AM on ‎1/‎25/‎2019
System shutdown at 2:45:59 PM on ‎1/‎21/‎2019
System shutdown at 4:15:13 PM on ‎1/‎10/‎2019
System shutdown at 9:57:27 AM on ‎1/‎10/‎2019
System shutdown at 3:16:15 PM on ‎12/‎27/‎2018
System shutdown at 6:33:47 PM on ‎12/‎23/‎2018
System shutdown at 6:29:35 PM on ‎12/‎23/‎2018
System shutdown at 6:26:43 PM on ‎12/‎23/‎2018
System shutdown at 5:53:58 PM on ‎12/‎23/‎2018
System shutdown at 5:34:58 PM on ‎12/‎23/‎2018
System shutdown at 10:40:03 AM on ‎12/‎23/‎2018
System shutdown at 10:19:27 AM on ‎11/‎24/‎2018
System shutdown at 3:47:47 PM on ‎11/‎17/‎2018
System shutdown at 3:07:32 PM on ‎10/‎14/‎2018