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

Archive for 2020

Posted by jpluimers on 2020/05/14

Patch Windows now. Attackers can exploit CVE-2020-1048 with a single PowerShell command:
Add-PrinterPort -Name c:\windows\system32\ualapi.dll

Attackers can exploit CVE-2020-1048 with a single PowerShell command:
Add-PrinterPort -Name c:\windows\system32\ualapi.dll
On an unpatched system, this will install a persistent backdoor, that won’t go away even after you patch.
See https://windows-internals.com/printdemon-cve-2020-1048/ for more details.

https://twitter.com/aionescu/status/1260466215299973121

Posted in Uncategorized | Leave a Comment »

108 byte CSS Layout Debugger · GitHub

Posted by jpluimers on 2020/05/13

A cool [WayBack] 108 byte CSS Layout Debugger · GitHub (and sligtly different versions) that makes your page look like this:

[].forEach.call($$("*"),function(a){a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16)})

 

–jeroen

Posted in CSS, Development, JavaScript/ECMAScript, Scripting, Software Development, Web Development | Leave a Comment »

Men’s Java is not JavaScript Annoyed Programmer/Developer T-Shirt

Posted by jpluimers on 2020/05/13

Though the shirt is not available on Amazon [WayBack] any more, still – after 25 years – so many recruiters still get it wrong.

Not just recruiters, so: [WayBack] Why is JavaScript called JavaScript, since it has nothing to do with Java? – Stack Overflow, thanks to CMS [WayBack]:

From an interview made to its creator Brendan Eich:

InfoWorld: As I understand it, JavaScript started out as Mocha, then became LiveScript and then became JavaScript when Netscape and Sun got together. But it actually has nothing to do with Java or not much to do with it, correct?

Eich: That’s right. It was all within six months from May till December (1995) that it was Mocha and then LiveScript. And then in early December, Netscape and Sun did a license agreement and it became JavaScript. And the idea was to make it a complementary scripting language to go with Java, with the compiled language.

he continues on the relation of ECMAScript based languages:

JavaScript, was originally named Mocha, later it was renamed to LiveScript, and then to JavaScript.

The LiveScript to JavaScript name change came because Netscape and Sun did a license agreement.

The language was then submitted for standarization to the ECMA International Organization. By that time, Netscape didn’t allow the use of the “JavaScript” name, so the standarized language is named ECMAScript.

JavaScript isn’t actually an open name. Now it’s a trademark of Sun (now Oracle).

There still a lot of confusion, some people still think that JavaScript, JScript, and ECMAScript are three different languages.

ECMAScript is the “standards” name for the language.

JavaScript is technically a “dialect” of ECMAScript, the Mozilla Foundation can use “JavaScript” as the name of their implementations (currently present on the Rhino and SpiderMonkey engines).

In the early days, Microsoft decided also to do what Netscape was doing on their own browser, and they developed JScript, which is also an ECMAScript dialect, but was named in this way to avoid trademark issues.

–jeroen

via: [WayBack] Does it bug you when people say Java when they actually mean JavaScript? https://www.amazon.com/dp/B06Y3XK69B – Jeroen Wiert Pluimers – Google+

 

Posted in Development, History, Java, Java Platform, JavaScript/ECMAScript, Scripting, Software Development | Leave a Comment »

Updating Actions (Don’t Do This) – Dave’s Development Blog

Posted by jpluimers on 2020/05/13

I remember fixing a high CPU toggling the Enabled property in an OnUpdate even handler on a TCustomAction descendant quite some time ago, but wasn’t completely sure of the exact cause.

My fix was to only set it once every clock tick (about every 20 milliseconds).

The best fix would have been not to toggle at all: just calculate the right result, then only set the Enabled property once: [WayBack] Updating Actions (Don’t Do This) – Dave’s Development Blog

–jeroen

Posted in Delphi, Development, Software Development | 2 Comments »

25 Scrum Magnetische Karten Wiederbeschreibbar 7,5 x 7,5 cm. Beschreibbare Magnete für Agile, Kanban oder Lean Board. Haftnotizen leicht abnehmbar und wiederverwendbar (Mix 5 Farben): AmazonSmile: Bürobedarf & Schreibwaren

Posted by jpluimers on 2020/05/12

Works very well: [Archive.is25 Scrum Magnetische Karten Wiederbeschreibbar 7,5 x 7,5 cm. Beschreibbare Magnete für Agile, Kanban oder Lean Board. Haftnotizen leicht abnehmbar und wiederverwendbar (Mix 5 Farben): AmazonSmile: Bürobedarf & Schreibwaren.

They are 7.5x75cm, but the picture below show they also available as 10x15cm and 2.5×2.5cm cards, plus pre-printed scrum/kanban cards, and even magnetic boards for various purposes.

Not all of the sellers allow for VAT invoice, so better check each:

Read the rest of this entry »

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

Insomnia REST Client

Posted by jpluimers on 2020/05/12

[WayBack] Insomnia REST Client  A powerful REST API Client with cookie management, environment variables, code generation, and authentication for Mac, Window, and Linux.

Source code at [WayBack] GitHub – getinsomnia/insomnia: The most intuitive cross-platform REST API Client 😴.

Via: [WayBack] Paw is nice – The Isoblog.

–jeroen

 

 

Posted in Communications Development, Development, HTTP, Internet protocol suite, JavaScript/ECMAScript, JSON, REST, Scripting, Software Development, TCP, Web Development | Leave a Comment »

Bash Notes for Professionals book

Posted by jpluimers on 2020/05/12

For my reading list: Bash Notes for Professionals book

Download: [WayBack]  BashNotesForProfessionals.pdf

Via: [WayBack] Bash Notes for Professionals – a book compiled from Stack Overflow Documentation released under Creative Commons BY-SA  – ThisIsWhyICode – Google+

–jeroen

Posted in *nix, *nix-tools, bash, bash, Development, Power User, Scripting, Software Development | Leave a Comment »

Web accessibility is hard, so please let your sites not become worse over time

Posted by jpluimers on 2020/05/11

Despite clear guidelines (European level since 2016, W3C level since 2018), web accessibility is still hard, both for web site developers and their users.

Two years ago, bumped into a Dutch government web site that had become worse over time: they disabled keyboard paste for numeric fields, only would paste 1 digit at a time, and managed to have the delete button delete the current digit (like what the backspace does and should do) instead of the next.

Please do not do that!

Here are the guidelines: [WayBack] Web Content Accessibility Guidelines (WCAG) 2.1

This is the (Dutch) story:

 [WayBack] Thread by @jpluimers: “Beste @Waternet, waarom kan ik niet meer het hele opnamenummer in 1 keer plakken? Cijfertje voor cijfertje uit de gescippen plakken is nogal veel werk. Vroeger ging dit wel goed. plakken werkt niet met het toetsenbord: alleen m […]”

[WayBack] Jeroen Pluimers on Twitter: “Beste @Waternet, waarom kan ik niet meer het hele opnamenummer in 1 keer plakken? Cijfertje voor cijfertje uit de gescande brief knippen plakken is nogal veel werk. Vroeger ging dit wel goed.… “

[WayBack] Jeroen Pluimers on Twitter: “plakken werkt niet met het toetsenbord: alleen maar met de muis, dus onhandig voor mensen met een beperking. Als je in het veld staat werken alleen de numerieke toetsen en pijltjes van je toetsenbord, en de delete knop haalt het verkeerde karakter weg. Wie verzint die ongein?”

[WayBack] Jeroen Pluimers Twitterissä: “Bij postcode werkt plakken weer wel (en de rest van het toetsenbord ook helemaal), maar bij meterstand weer niet. Hoe maak je je site onhandig voor mensen met een beperking les 1: het is helemaal gelukt. Jammer! Lees eens … en … “

[WayBackJeroen Pluimers Twitterissä: “Bij email adres werkt plakken weer wel (gelukkig, het zijn maar 40 karakters), maar er mist een cruciale stap: meternummer. Die controle is voor adressen met meerdere meters ontzettend belangrijk. Vroeger werd dat wel gecontroleerd. Het invoerproces is dus een achteruitgang.”

[WayBackJeroen Pluimers on Twitter: “Laatste probleem is een waarschuwing *achteraf* dat jullie geen email bevestiging kunnen sturen. Super onhandig, omdat je op dat moment de stand ook niet meer kunt afdrukken. Er is veel werk voor jullie aan de winkel. Hou me gaarne op de hoogte van de vorderingen. CC @matijn”

[WayBackJeroen Pluimers on Twitter: “Bij dit soort problemen denk ik altijd aan @matijn en anderen waar toegankelijkheid van onschatbaar belang is. Zo zonde dat organisaties het voor elkaar krijgen om dit te verslechteren in plaats van de verbeteren, ondanks de Europese richtlijnen uit 2016 “

–jeroen

Read the rest of this entry »

Posted in Development, Internet, Software Development, Usability, User Experience (ux), Web Development | Leave a Comment »

OpenSuSE: keeping an ssh connection alive (convenient for keeping port forwardings up)

Posted by jpluimers on 2020/05/11

Below the steps for ensuring port forwardings are up from an OpenSuSE system to an ssh server using autossh on the client system.

Autossh

Many have written about the benefits of autossh, so I can’t do better than that. A good abbreviated quote is from [WayBack] Autossh for persistent database connectivity – Compose Articles:

Autossh wraps SSH in an application which was designed to monitor the state of the connection. It will also restart SSH if it exits. The idea of the monitoring is that If it sees the packets aren’t going through, it would also restart SSH. …

the developers of OpenSSH added some options – ServerAliveInterval and ServerAliveCountMax – which activate built in connection checking in OpenSSH. Together the options set checking at a set interval and exiting SSH if the count maximum is exceeded. And when SSH exits, autossh will restart it so it serves as much improved replacement as there’s no extra ports needed.

Summary

The scenario is that a client user named autoSshClientUser automatically logs on to a server as user autosshServerUser using autossh from the client system.

The sequence is to first test this manually from the client system using a regular ssh command, then manually with the autossh command from the client system, then automate the starting (and keep alive) of the autossh instance from the client system.

Start configuring the server side first:

  1. Create a user specific for logon (below it is autosshServerUser).
  2. Limit the user to only allow only port forwarding: [WayBacksecurity – How to create a restricted SSH user for port forwarding? – Ask Ubuntu

Then finish confiruging the client side:

  1. Install autossh: zypper install autossh
  2. Ensure autoSshClientUser has an ssh key that does not require a password
  3. Transfer the public key to autosshServerUser on the remote system
  4. Test with an autossh command that suits your situation best
  5. Ensure autoSshClientUser runs a job at or shortly after system boot (after the network is up) that will start autossh with the correct parameters

If the autoSshClientUser is root, then you could use a service to start autossh, but be sure that service depends on a functioning network connection.

If the autoSshClientUser is not root, then usually a user based cron job works best.

Naming idea:

  • Assume the client system is Train and the server is Station
  • The server user could be autosshTrainAtStation
  • The client user could be autosshTrainToStation

Server side

  1. [Archive.is] Installing on other OSes (Debian / Ubuntu;  Debian / Ubuntu; CentOS / Fedora / RHEL; ArchLinux; FreeBSD; OSX)
  2. As root, add he user using [Archive.is]useradd:

    # useradd --create-home --shell /bin/false autosshServerUser

  3. As root use su to become autosshServerUser, then create an ssh key without a password (you need to specify the logon shell) using [WayBackssh-keygen.
    This generates bot a secure rsa and

    # su --shell /bin/bash autosshServerUser
    > cd ~
    > whoami
    autosshServerUser
    > rm -f ~/.ssh/id_rsa ~/.ssh/id_rsa.pub
    > ssh-keygen -t rsa -b 4096 -o -a 100 -f ~/.ssh/id_rsa -N ''
    Generating public/private rsa key pair.
    Your identification has been saved in /home/autosshServerUser/.ssh/id_rsa.
    Your public key has been saved in /home/autosshServerUser/.ssh/id_rsa.pub.
    The key fingerprint is:
    SHA256:... autossh24@linux
    The key's randomart image is:
    +---[RSA 2048]----+
    ...
    +----[SHA256]-----+
    > rm -f ~/.ssh/id_ed25519 ~/.ssh/id_ed25519.pub
    > ssh-keygen -t ed25519 -o -a 100 -f ~/.ssh/id_ed25519 -N ''
    Generating public/private ed25519 key pair.
    Your identification has been saved in /home/autossh24/.ssh/id_ed25519.
    Your public key has been saved in /home/autossh24/.ssh/id_ed25519.pub.
    The key fingerprint is:
    SHA256:... autossh24@linux
    The key's randomart image is:
    +--[ED25519 256]--+
    ...
    +----[SHA256]-----+
    

Client side

I need to check the below links on killing autossh (including the underlying ssh based connection), as you need to use the kill or pkill parameters signals -3 (SIGQUIT), not -9 (SIGKILL) as explained in [WayBack] ssh – How to stop/kill an autossh tunnel? – Super User (thanks mariusmatutiae and dviljoen).

Monitoring the state of the ssh connection needs some parameters (like ClientAliveInterval and ClientAliveCountMax). A good start on that is [WayBack] networking – autossh does not kill ssh when link down – Server Fault.

Setting up a service so root automatically logs on a remote system:

With non-root, it might actually be possible to do this  as a service too given there is a user= parameter in service files:

Though as non-root, most people seem to use cron [WayBack] ssh – Problems with Autossh: running from cron vs terminal – Super User

Please do not use /etc/init.d/after.local as mentioned often (for instance in [WayBack] TUMBLEWEED run a script a boot): this mechanism has been deprecated and won’t work on more recent systems (like 2012 and younger: [WayBack] openSUSE Forums – systemd and using the after.local script in openSUSE 12.1). The same holds for /etc/init.d/boot.local: don’t use, even though many people indicate it works, for instance [WayBack] Run a command at boot.

An interesting approach is at [WayBack] Autossh Startup Script for Multiple Tunnels | Surnia Ulula, though I will stick with what’s below.

Read:

Downloads:

References

Most of the above comes from these links:

–jeroen

Continuation of:

Read the rest of this entry »

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

Exploits Database by Offensive Security

Posted by jpluimers on 2020/05/11

Interesting to monitor (it has a nice RSS feed!) so you can ensure your systems get patched sooner rather than later:

The Exploit Database – Exploits, Shellcode, 0days, Remote Exploits, Local Exploits, Web Apps, Vulnerability Reports, Security Articles, Tutorials and more.

–jeroen

Posted in Power User, Security | Leave a Comment »