The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,861 other subscribers

Archive for 2020

Object Pool versus Object Cache

Posted by jpluimers on 2020/10/20

I think an:

  • Object Pool is meant to set a maximum on the number of pooled objects because they are expensive in resource usage.
  • Object Cache is meant to store objects (but not cap it) that are expensive to create, but do not per se are expensive in resource usage.

For future reading:

–jeroen

 

Posted in Conference Topics, Conferences, Event | Leave a Comment »

Enable your device for development – UWP app developer | Microsoft Docs

Posted by jpluimers on 2020/10/20

From [WayBack] Enable your device for development – UWP app developer | Microsoft Docs:

Run these as administrator on the command prompt to:

Enable Sideloading

reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowAllTrustedApps" /d "1"

Enable Developer Mode

reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"

Needed for WinAppDriver to test applications from Selenium or Katalon

When you run WinAppDriver without it, you get this:

C:\Users>"C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe"
Failed to initialize: 0x80004005
Despite WinAppDriver running fine as non-administrative user, the reason was given that it requires administrative privileges: [WayBack] Why does WinAppDriver.exe require developer mode? · Issue #165 · Microsoft/WinAppDriver · GitHub.

SetCapabilities name parameters and values

Various searches for what to pass as parameters to SetCapabilities failed, but the list is right at the README, but without any mention SetCapabilities, so search engines miss it with for instance “SetCapabilities” “WinAppDriver” – Google Search that only returned these links:

Supported Capabilities

Below are the capabilities that can be used to create Windows Application Driver session.

Capabilities Descriptions Example
app Application identifier or executable full path Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge
appArguments Application launch arguments https://github.com/Microsoft/WinAppDriver
appTopLevelWindow Existing application top level window to attach to 0xB822E2
appWorkingDir Application working directory (Classic apps only) C:\Temp
platformName Target platform name Windows
platformVersion Target platform version 1.0

–jeroen

Posted in Conference Topics, Conferences, Development, Event, Katalon, Software Development, Testing | Leave a Comment »

Class methods in Record vs Class in Delphi 2010 – Stack Overflow

Posted by jpluimers on 2020/10/20

A still relevant part for [WayBack] Class methods in Record vs Class in Delphi 2010+ – Stack Overflow is the distinction between class methods on both:

  • on classes they can be either regular (no extra keyword), static or virtual.
  • on records they can only be static, as there is no inheritance on records
    • this also holds for any helpers that are not class helpers (and presumably if they are ever created: interface helpers)

While class methods inside classes can be used in the same way, they can in addition have another goal: they can be virtual. Called from a class variable this can lead to different implementations depending on the current content of that variable. This is not possible for records. As a consequence class methods in records are always static.

Thanks Uwe Raabe for this insight!

One odd thing on class methods in classes, is that when they need to be static when they are the read or write backing of a class property.

When a class method is static, any calls from it to virtual (or dynamic) methods will not be handled as such: there is no class VMT for it (as because they are static, they do not have a self parameter).

–jeroen

PS: I realised later that part of the above was already in E2398 Class methods in record types must be static (Delphi) – RAD Studio

Posted in Delphi, Development, Software Development | Leave a Comment »

Typografische Strafzettel – Nerdcore

Posted by jpluimers on 2020/10/19

Want: [WayBack] Typografische Strafzettel – Nerdcore

Hoefler&Co verkauft Typografische Strafzettel für Schlechtsetzer und Buchstabenkombinationsnullen. Die Schriftverbrechen gliedern sich auf dem Strafzettel in Vergehen der Auswahl (wie der unironische Einsatz „amüsanter“ Schriften oder die amateurishe Anwendung von Schriftauszeichnung ), der Komposition (zuviele Schriftgrößen, schlechtes Kerning), der Zeichensetzung (Ligaturen, korrekte Anführungen) und in Schwere Ästhetikverletzungen (elektronische Schrägschrift, Verzerrung). Großartige Idee, und sie haben nichtmal ComicSans mit Namen erwähnt. Toll! (via Jason Kottke, Bild des ganzen Strafzettels unten via /u/hova414) By special issue from the 100% totally real Typographic Violations Division, the Uniform Ticket Book is standard equipment for the modern design enforcer. Lists thirty-two common design infractions, each

I wish they were available outside in Europe, as it looks like it is is USA only with large foreign shipping costs at [WayBack] The Typographic Ticket Book – Hoefler&Co:

By special issue from the 100% totally real Typographic Violations Division, the Uniform Ticket Book is standard equipment for the modern design enforcer. Lists thirty-two common design infractions, each with an appropriate penalty, with plenty of room for improvisation. Authoritatively typeset in Helvetica to provoke

Via:

Picture via [WayBack] reddit: Just got this in a swag bag : graphic_design

–jeroen

Read the rest of this entry »

Posted in Font, Fun, Geeky, Power User | Leave a Comment »

macos – Bring OS X Error Message window to the front – Super User

Posted by jpluimers on 2020/10/19

Short answer based on WayBack macos – Bring OS X Error Message window to the front – Super User

The GUI way

  1. Press Command+Space to start Spotlight Search
  2. Search for /System/Library/CoreServices/Problem Reporter.app and wait for the result to show up
    (a search for just Problem Reporter.app will not reveal it!)
  3. Press Enter
  4. Now the System Reporter windows is in the front and has focus

The Terminal way

  1. Open a Terminal window or tab
  2. Run open -a /System/Library/CoreServices/Problem\ Reporter.app
  3. Now the “Problem Reporter” windows is in the front and has focus

–jeroen

 

Posted in Apple, Mac, Mac OS X / OS X / MacOS, macOS 10.13 High Sierra, Power User | Leave a Comment »

How to remove all old and outdated brew packages on MacOS – nixCraft

Posted by jpluimers on 2020/10/19

I was not aware that brew install,  brew cask install, brew update and brew upgrade would keep all the older versions on disk, so I was a bit amazed that OmniDiskSweeper and GrandPerspective found over 20 gigabytes of cruft in /usr/local/Cellar and a bit in /Library/Caches/Homebrew.

Based on [WayBack] How to remove all old and outdated brew packages on MacOS – nixCraft and [WayBack] homebrew – brew: how to delete outdated version of package – Ask Different (which have more info) I changed the order a bit:

alias brew-cleanup-update-ugprade='brew cleanup && brew update && brew upgrade'

You can use brew pin to keep specific versions (and brew unpin to release them so you get the most recent one).

The main reason people do not bump into brew cleanup is that it is not advertised as a command:

# brew --help
Example usage:
  brew search [TEXT|/REGEX/]
  brew info [FORMULA...]
  brew install FORMULA...
  brew update
  brew upgrade [FORMULA...]
  brew uninstall FORMULA...
  brew list [FORMULA...]

Troubleshooting:
  brew config
  brew doctor
  brew install --verbose --debug FORMULA

Contributing:
  brew create [URL [--no-fetch]]
  brew edit [FORMULA...]

Further help:
  brew commands
  brew help [COMMAND]
  man brew
  https://docs.brew.sh

But it is there and has help as well:

# brew cleanup --help
brew cleanup [--prune=days] [--dry-run] [-s] [formulae|casks]:
    Remove stale lock files and outdated downloads for formulae and casks,
    and remove old versions of installed formulae. If arguments are specified,
    only do this for the specified formulae and casks.

    If --prune=days is specified, remove all cache files older than days.

    If --dry-run or -n is passed, show what would be removed, but do not
    actually remove anything.

    If -s is passed, scrub the cache, including downloads for even the latest
    versions. Note downloads for any installed formula or cask will still not
    be deleted. If you want to delete those too: rm -rf "$(brew --cache)"

On pin and unpin:

# brew pin --help
Usage: brew pin formulae

Pin the specified formulae, preventing them from being upgraded when
issuing the brew upgrade formulae command. See also unpin.

    -d, --debug                      Display any debugging information.
    -h, --help                       Show this message.
# brew unpin --help
Usage: brew unpin formulae

Unpin formulae, allowing them to be upgraded by brew upgrade formulae.
See also pin.

    -v, --verbose                    Make some output more verbose.
    -d, --debug                      Display any debugging information.
    -h, --help                       Show this message.

–jeroen

Posted in Apple, Mac, Mac OS X / OS X / MacOS, Power User | Leave a Comment »

Facebook ist in Bezug auf Kundenzufriedenheit und Vertrauen in Umfragen zieml…

Posted by jpluimers on 2020/10/16

Nice thread as it talks a bit about how keep your own stuff secure with companies doing MitM, or have VPN infrastrcuture.

[WayBack] Facebook ist in Bezug auf Kundenzufriedenheit und Vertrauen in Umfragen zieml…

Most larger TLS based web-sites now have HSTS so detect MitM.

Having a proxy locally helps checking the certificates.

Corporate laptops usually has device management. If they use MitM, their root certificates are usually put back automatically. But not all software uses the same root certificate store (:

In the past, I have used [WayBack] cntlm, or VPN (routing only corporate traffic over VPN).

There are corporate VPN variants, which take over the complete routing table or even run arbitrary scripts as root on your box on connect in order to do “endpoint validation”. And then there is OpenVPN, which routes the traffic that the company shall see to the company and lets you use normal connectivity for the rest.

You want openvpn, in all cases.

Another trick I have used is to VPN/SSH out of a corporate box and route some of the traffic over it.

Finally, for some larger corporate VPN software, there is an open source replacement that has better configuration options: OpenConnect supports AnyConnect, Juniper and GlobalProtect.

Related: picture on the right via [WayBack] Torsten Kleinz – Google+

–jeroen

Posted in Cntlm, Encryption, HTTPS/TLS security, Power User, Security, Windows, Windows-Http-Proxy | Leave a Comment »

Non-rectangle select in Windows command line – Super User

Posted by jpluimers on 2020/10/16

Just discovered this has been possible since Windows 10 by holding the shift key while dragging with the mouse. After like 20 years of waiting, why did nobody warn me (:

Is there any way I can disable the stupid rectangle selection mode thing in the Windows command line? I want to select line by line like normal. Currently it’s a giant pain when I need to copy things

So this is a thing from the past: [WayBack] Non-rectangle select in Windows command line – Super User

And this was already possible (but then you had to drag the full width): [WayBack] windows – Select text across lines in cmd.exe? – Super User

–jeroen

Posted in Development, Power User, Windows, Windows 10 | Leave a Comment »

Guru Meditation: XID: 202605646

Posted by jpluimers on 2020/10/16

I love the historic humour of some systems.

Like this 503 Service Unavailable on Archive.is:

Error 503 Service Unavailable

Service Unavailable

Guru Meditation:

XID: 202605646


Varnish cache server

It goes all the way back the the mid 1980s Commodore Amiga era where the Guru Medication was way ahead of the blue screen of death.

In this case, it the Varnish way of telling that something got broken and you should inspect the logs: [WayBack] Troubleshooting Varnish — Varnish version trunk documentation: Guru Meditation.

The cool thing is that the page I was archiving actually got saved.

–jeroen

Posted in Fun | Leave a Comment »

Some postfix notes

Posted by jpluimers on 2020/10/15

Postfix has documentation on primary MX and secondary MX, but not on tertiary MX.

If the primary MX is down, you have a series of secondary MX and tertiary MX that configured the same way, MX DNS priority for primary, the series of secondary MX and tertiary MX have increasing numbers, and the primary MX goes down, then senders can get “too many hops” as secondary and tertiary MX are looping.

I had a hard time finding a good and easy solution as these queries do not return many meaningful results:

Here are some links that helped getting this solved:

  • [WayBack] Postfix Frequently Asked Questions: What does “Error: too many hops” mean?

    Short answer: this message means that mail is probably looping. If you see this after you turned on Postfix content filtering, then you have made a mistake that causes mail to be filtered repeatedly. This is cured by appropriate use of content_filter=header_checks=, and body_checks=.

    Long answer: the message has too many Received: message headers. A received header is added whenever Postfix (or any MTA) receives a message. A large number of Received: message headers is an indication that mail is looping around.

    Side comment: email uses the opposite of the technique that is used to avoid IP forwarding loops. With IP, the sender sets a TTL (time to live) field in the IP header. The field is decremented by each router. When the TTL reaches zero the packet is discarded and an ICMP error message is returned to the sender.

  • [WayBack] Error: too many hops (in reply to end of DATA command) · Issue #713 · mail-in-a-box/mailinabox · GitHub

    In case you or anyone else was/is wondering about the mydestination = localhost thing, the reason it has to be set to just localhost is because MIAB uses Postfix’s “virtual domain hosting” (http://www.postfix.org/VIRTUAL_README.html) support. Per the documentation for mydestination at http://www.postfix.org/postconf.5.html#mydestination:

    Do not specify the names of virtual domains – those domains are specified elsewhere. See VIRTUAL_README for more information.

    (in the context of MIAB every domain is a virtual domain).

In my case a series of these:

Received: from mwgp.xs4all.nl (mwgp.xs4all.nl [80.101.239.92])
    by fiber24315337242.heldenvannu.net (Postfix) with ESMTP id 26395200FE
    for <jeroen@pluimers.com>; Fri, 29 Jun 2018 11:01:02 +0200 (CEST)
Received: from fiber24315337242.heldenvannu.net (unknown [37.153.243.246])
    by mwgp.xs4all.nl (Postfix) with ESMTP id 077A5E937
    for <jeroen@pluimers.com>; Fri, 29 Jun 2018 11:01:02 +0200 (CEST)

Specifying the transport will likely help me solve this problem:

This all came down to editing /etc/postfix/transport adding lines for each relayed domain like this one:

example.org    smtp:[mx-a-record.example.org]

Lines like it direct to use the smtp transport and use a specific host (normally, the relay transport is being used).

After this:

# postmap /etc/postfix/transport
# rcpostfix reload

I choose not to configure [WayBack] Postfix Configuration Parameters: relay_recipient_maps, but might if I had an automated way of replicating lists of valid (and invalid) users.

Another option was confirmed at [WayBack] Software-update: Postfix 3.4.0 / 3.3.3 / 3.2.8 / 3.1.11 / 3.0.15 – Computer – Downloads – Tweakers by [WayBack] menocchio. Thanks!

Dat is volgens mij eenvoudig op te lossen met relay_transport of transport_maps. Zie ook: Postfix transport table format.

Daarmee dwing je de secondary servers de mail altijd af te willen leveren bij de primary server (en dus niet bij een andere secondary). En als de primary niet online is, dan wacht ie netjes tot dat wel het geval is :-)

Bijvoorbeeld:
relay_transport = smtp:[primarymx.domain.tld]

Likely relevant: [WayBack] The Book of Postfix

Maybe relevant in the future:

Found on my hunt for the above:

Try not to make typo’s: [WayBack] postfix appears not finding MX records or host names from DNS

Interesting thought, but not sure how smart SPAM bots are now: [Archive.is] Spam relaying through secondary MX… – Google Groups

To archive this:

  1. Rename from
  2. To
  3. Then save in Archive.is

–jeroen

Posted in *nix, Communications Development, Development, DevOps, DNS, etckeeper, Infrastructure, Internet, Internet protocol suite, Linux, Power User, SMTP | Leave a Comment »