Sometimes curious about this, usually because I forgot to note what time I arrived at the office, and I keep forgetting how to check. So, here’s some commands I found on SuperUser which seem to do the trick:
> systeminfo | find /i "Boot Time"
System Boot Time: 15.10.2021, 08:37:29
> wmic os get lastbootuptime
> net statistics workstation | find /i "Statistics since"
Statistics since 15.10.2021 08:37:45
Also discovered this one, which will create a more thorough report, which can be interesting to look at:
> powercfg /sleepstudy /output report.html && start report.html
Testing your web projects with a screen reader is quite important and informative, but can also be quite annoying while jumping back and forth between developing and testing. Here are some shortcuts I keep forgetting to make NVDA a bit less annoying during development:
||Stops current reading
|Ins + S
||Switches between off-, sound-, and speech-mode (while stuff keeps being listed in log and braille view
|Ins + Q
Experienced getting fatal build errors on our build server during ESLint linting of our React project:
<--- Last few GCs --->
[10012:0000000001DA2080] 184320 ms: Mark-sweep 2035.1 (2051.8) -> 2034.3 (2051.8) MB, 2297.9 / 0.0 ms (average mu = 0.114, current mu = 0.001) allocation failure scavenge might not succeed
[10012:0000000001DA2080] 185393 ms: Mark-sweep 2035.3 (2051.8) -> 2033.6 (2051.8) MB, 1068.8 / 0.0 ms (average mu = 0.077, current mu = 0.003) allocation failure scavenge might not succeed
The MB values looked very suspicious in that they were on either side of 2048 MB (2 GB), so suspected our project had run into some sort of limit. And seems there is indeed a max limit of ~2 GB by default on the heap size.
To increase the node heap size limit, set the
--max-old-space-size to something more than 2048, e.g. like this on Windows:
setx NODE_OPTIONS "--max-old-space-size=4096" /m
To verify that it actually works (or check what it is by default), this command seems to do it:
node -e "console.log(require('v8').getHeapStatistics().total_available_size / 1024 / 1024)"
Note that the output for some reason always seem to be a bit more than what’s set as the limit. Not sure what that’s about, but anyways… ðŸ¤·â€â™‚ï¸
For debugging it’s often useful to do
console.log(someObjectOrArray). However, if the array is long or the object deep, a lot will be truncated. Apparently there’s a util one can use to get a bit more control over this though:
import util from 'util'
I have an Excel sheet where I not down the time I arrive at work and the time I leave. It tends to vary a bit, and on a regular basis I forget noting down the time I arrived. At my previous job I used a simple tool called TurnedOnTimesView for this, but because the laptops here are managed differently, it isn’t as reliable as it was. So, I figured I could try to enter the scary world of the Event Viewer.
In the Event Viewer you can create custom filtered views, and I first thought it would be as simple as looking for “Logon” events… but that filter gave me a mountain of logon events, most of which seemed to be various system events, and even IWA events from browsers logging on to company websites. Basically, there was a lot of noise.
Eventually though, digging out some old XPath skills, and identifying some key identifiers (EventID=4648 and ProcessName=lsass), I managed to come up with a query that actually seem to be quite accurate:
<Query Id="0" Path="Security">
(TimeCreated[timediff(@SystemTime) <= 604800000]) and
(Data[@Name='ProcessName'] = 'C:\Windows\System32\lsass.exe') and
(Data[@Name='TargetDomainName'] = 'YOUR DOMAIN') and
(Data[@Name='TargetUserName'] = 'YOUR USERNAME')
This, unless I have misunderstood something, should list all actual login events, by you, within the last week. I.e. not various services, HTTP stuff, etc., etc.