php -d xdebug.profiler_enable=1

So to enable profiling on the command line run your script in PHP like this:

php -d xdebug.profiler_enable=1 /path/to/script.php

You need to have configured xdebug in php.ini, I do it with a file in /etc/php/7.2/cli/conf.d/xdebug.ini that looks like this:

;xdebug.profiler_enable = 0
xdebug.profiler_output_dir = "/tmp/xdebug"
xdebug.profiler_output_name = "cachegrind.out.%p"

Note: you can enable profiling for all scripts with xdebug.profiler_enable = 1

Registering a systemd Service

So today I read How To Set Up VNC Server on Debian 8 which had a section on creating and registering the requisite scripts:

/usr/local/bin/myvncserver (make sure it’s executable with +x):

#!/bin/bash
PATH="$PATH:/usr/bin/"
DISPLAY="1"
DEPTH="16"
GEOMETRY="1024x768"
OPTIONS="-depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}"
case "$1" in
start)
/usr/bin/vncserver ${OPTIONS}
;;
stop)
/usr/bin/vncserver -kill :${DISPLAY}
;;
restart)
$0 stop
$0 start
;;
esac
exit 0

/lib/systemd/system/myvncserver.service:

[Unit]
Description=VNC Server example

[Service]
Type=forking
ExecStart=/usr/local/bin/myvncserver start
ExecStop=/usr/local/bin/myvncserver stop
ExecReload=/usr/local/bin/myvncserver restart
User=vnc

[Install]
WantedBy=multi-user.target

Then to register and start:

systemctl daemon-reload
systemctl enable myvncserver.service
systemctl start myvncserver.service

Enabling Windows SDK 7.1 in Visual Studio 2008

I was having a problem where Visual Studio was saying that “windows.h” could not be found after having installed the Windows SDK v7.1. I found this article which said to update the path in “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\CurrentInstallFolder” in the registry. So I did that, and now everything is working.