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,860 other subscribers

Archive for January, 2018

Using hardware security tokens cross-platform is only slightly more complicat…

Posted by jpluimers on 2018/01/17

Thanks for the excellent comment explaining how to use hardware tokens as a comment to [WayBack] Using hardware security tokens cross-platform is only slightly more complicated than piloting a Space Shuttle. ##sarcasm – Jan Wildeboer – Google+

Jan Wildeboer:

+Jeroen Wiert Pluimers OK. Let’s look a bit at how this works. There are several competing standards/ways to use a security token. Typically you’ll decide between the two most used ones. As a CCID device AKA SmartCard with OpenSC or using gpg-agent. And that’s an either/or question. Some of the security tokens can only work with gpg-agent, some can do both (but not at the same time) and some are only useful as CCID style (e.g. the Nitrokey HSM).

OK. So now we look at platforms. CCID using OpenSC mostly works everywhere, but you might need to install some additional software depending on your OS. Older versions of MacOS X were notoriously bad, since (High) Sierra it has become better.

On Linux it again really depends. The gnome-keyring-agent that is active in a Gnome session really messes everything up, so better deactivate that. Which is not really trivial. But you have to have a socket for ssh-agent to pick up the key, so some stuff goes to your .bash.rc and you have to make some changes to Gnome config.

If you want to use a Yubikey for 2FA, note that it cannot do TOTP (Time based One Time Password) which Amazon wants for AWS auth. So you need another helper app on your computer.

Here’s some articles that explain it in detail:

The middle two links are actually part of the series [WayBack] Yubikey All The Things | EngineerBetter | More than Cloud Foundry specialists which has a third post [WayBack] Yubikeys for Static Secrets | EngineerBetter | More than Cloud Foundry specialists

–jeroen

Posted in *nix, *nix-tools, Communications Development, Development, Internet protocol suite, Power User, Security, SSH, TCP | Leave a Comment »

Convert space indented text to markdown minus indented

Posted by jpluimers on 2018/01/17

Since I will never be good at regex, this are a few search/replace patterns I used in Atom.io to convert a plain text document space indented like this:

Version 1.23.4.15
First level indented text
Is also a first level indented text
Too a first level indented text
- First level indented text too
  Second level indented text
  Is also a second level indented text
  Too a second level indented text
  - Second level indented text too
    - A third level indented text
    Third level indented text
    Is also a third level indented text
    Too a third level indented text
98.4.32.1

to a Markdown indented one like this:

Version 1.23.4.15
- First level indented text
- Is also a first level indented text
- Too a first level indented text
- First level indented text too
 - Second level indented text
 - Is also a second level indented text
 - Too a second level indented text
 - Second level indented text too
 - A third level indented text
 - Third level indented text
 - Is also a third level indented text
 - Too a third level indented text
Version 98.4.32.1

Prepend Version when needed: https://regex101.com/r/CUhUbr/1

  • Search:
    • ^(\d+\.\d+\.\d+\.\d+)
  • Replace:
    • Version $1

Add markdown first level indentations to lines that don’t have a markdown first level indentation yet, nor start with Version nor start with a space: https://regex101.com/r/CUhUbr/2

  • Search:
    • ^(?!(Version )|(- )|( )|(\d+\.\d+\.\d+\.\d+))(.*)
  • Replace:
    • - $5

Add markdown second level indentations to lines that don’t have a markdown second level indentation yet but do have a regular second level indentation: https://regex101.com/r/CUhUbr/3

  • Search:
    • ^  (?!(- )|( ))(.*)
  • Replace:
    •   - $3

Add markdown third level indentations to lines that don’t have a markdown third level indentation yet but do have a regular third level indentation: https://regex101.com/r/CUhUbr/4

  • Search:
    • ^    (?!(- )|( ))(.*)
  • Replace:
    •     - $3

jeroen

https://regex101.com/r/CUhUbr/1

https://regex101.com/r/CUhUbr/2

https://regex101.com/r/CUhUbr/3

https://regex101.com/r/CUhUbr/4

 

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

Links to various Visual C++ Redistributable Packages for Visual Studio downloads (arm/x64/x86 when available)

Posted by jpluimers on 2018/01/17

Link archive so I know how to get the 64-bit ARM, 32-bit Win32/x86 and 64-bit Win64/x64 downloads for the Visual C++ Redistributable files.

Note the various names of pages and files Microsoft uses.

–jeroen

Posted in C++, Development, Software Development, Visual Studio C++ | Leave a Comment »

Provisioning Windows 7 test VMs with know users/passwords

Posted by jpluimers on 2018/01/16

The proxmox side

In Proxmox, ensure you have a named backup of your machine that starts with vzdump-qemu like this:

vzdump-qemu-Win7Sp1UK.vma.lzo

That way, Proxmox knows that it can restore from it.

Don’t forget to assign a new MAC address to the network adapter so it’s unique on the network.

The Windows side

I wanted to provision this with two test accounts: one regular and one with administrator access.

The latter needs to be added to the Administrators group using [WayBacknet localgroup.

Both need passwords that (for now) never expire. This is where [WayBacknet user add fails: even if you set the correct flag, it won’t be reflected, so you need WMIC UserAccount for that.

These two posts helped me a lot with the below batch file fragment:

After restoring, run a batch file like this with an UAC token:

  call :addUser regularTestUser regularTestPassword
  net localgroup "Remote Desktop Users" "regularTestUser" /add
  call :addUser administratorTestUser administratorTestPassword
  :: https://superuser.com/questions/515175/create-admin-user-from-command-line
  net localgroup administrators administratorTestUser /add
  goto :eof
:addUser
  :: https://superuser.com/questions/515175/create-admin-user-from-command-line
  net user /expires:never /add %1 %2 /expires:never
  :: https://serverfault.com/questions/710964/accounts-suddenly-expiring-when-created-with-net-user-add-expiresnever
  WMIC UserAccount where "Name='%1'" set PasswordExpires=FALSE
  goto :eof

The Remote Desktop Users tip is from [WayBackEnable remote desktop from command line (CMD) but that post has “beautified” double quotes in them, so net localgroup by default complains it cannot find the group. The code above should have regular quotes.

Finally the computer needs a new name. Again WMIC to the rescue here as Windows 7 only comes with PowerShell 2.0 which cannot rename a computer.

Again with a UAC token, execute something like this:

WMIC ComputerSystem where Name="%COMPUTERNAME%" call Rename Name=INNOSETUPTEST
%windir%\System32\shutdown.exe -r

This last tip was via [WayBackwindows 7 – Renaming computers via command prompt – Super User.

–jeroen

Posted in Power User, Proxmox, Virtualization, Windows, Windows 7 | Leave a Comment »

Changing component class at run-time on demand for older Delphi versions need a bit more magic than you’d expect

Posted by jpluimers on 2018/01/16

Just in case I ever need to do heavy Delphi 2007 magic to change the component class of an object instance:

[WayBack] Quite unusual compiler behaviour (for older compilers) as seen here:http://stackoverflow.com/questions/41181767/patching-instance-class-requires-base-… – David Heffernan – Google+

References:

–jeroen

Source: Quite unusual compiler behaviour (for older compilers) as seen here: http://…

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

Potential wifi drop problem caused by Google devices – Google Product Forums

Posted by jpluimers on 2018/01/15

Sometimes the same problem here on an Asus RT-N66U: Potential wifi drop problem caused by Google devices – Google Product Forums [Archive.is].

Related:

Via [WayBack] Google Cast-apparaten veroorzaken wifi-drop-outs bij verschillende routers – Computer – Nieuws – Tweakers

–jeroen

 

Posted in Power User, WiFi | Leave a Comment »

Best SSDs: Holiday 2017

Posted by jpluimers on 2018/01/15

Not just a great overview for the season, but also a good overview on what the state of the art in various SSD products is: [WayBackBest SSDs: Holiday 2017.

Recommended reading when you are looking for SSDs

–jeroen

Posted in Hardware, Power User, SSD | Leave a Comment »

Intel Sightings in ESXi Bundled Microcode Patches for VMSA-2018-0004 (52345)

Posted by jpluimers on 2018/01/15

If you’ve installed this patch [WayBack] Intel Sightings in ESXi Bundled Microcode Patches for VMSA-2018-0004 (52345), then please read the article if your processor is affected by microcode updates in it.

To inspect which processor is in your machine, please see:

On my system, this was enough:

vim-cmd hostsvc/hostsummary | grep cpuModel
vim-cmd hostsvc/hosthardware | grep -w -A7 "cpuPkg\|cpuFeature" | grep "description\|eax\|ebx\|ecx\|edx\|vendor"

The above statements are based on:

I was lucky, but for now, ESXi has retracted it.

So please disregard my previous post VMware ESXi 6.5.0 Patch History.

–jeroen

Posted in ESXi6, ESXi6.5, Power User, Virtualization, VMware, VMware ESXi | Leave a Comment »

It’s Crash-Along Cymbals! Can you keep up with the bonkers finale of Tchaikovsky 4? – London Philharmonic Orchestra

Posted by jpluimers on 2018/01/15

This is so cool!

And yes: I can. Even with the big cymbals (:

–jeroen

 

There is another one with timpani:

And of course there is the live version (9 minutes!)

Posted in About, Adest Musica, Fun, Personal | Leave a Comment »

SexiLog – better insight in VMware vSphere/ESXi logs

Posted by jpluimers on 2018/01/15

On my watch list. Hopefully by now they have more recent Kibana support:

[WayBackAny plans for Kibana 5 support? · Issue #43 · sexibytes/sexilog · GitHub

–jeroen

via: Matthijs ter Woord

Posted in Power User, VMware, VMware ESXi | Leave a Comment »