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 February, 2019

Some Postfix configuration guidelines

Posted by jpluimers on 2019/02/08

Not just for Postfix are the first two guidelines:

  • Change one thing at a time
  • Save known working configurations

For the latter, I’m using etckeeper pushing to an external git repository hoster.

For Postfix are the others from [WayBackPostfix Configuration Guidelines.

One tip that’s missing, but saved my life numerous of times:

In /etc/postfix/main.cfg do not use this line ever:

inet_interfaces = $myhostname

If the resolving (through DNS or hosts file) of $myhostname fails for any reason in the future, then Postfix will not start at all, but in stead emit a fatal error like this:

/usr/sbin/postconf: fatal: parameter inet_interfaces: no local interface found for 127.0.0.2

Specify exact interfaces in stead, like any of these:

inet_interfaces = all

inet_interfaces = localhost

inet_interfaces = 192.168.24.68

–jeroen

Posted in *nix, *nix-tools, etckeeper, Linux, postfix, Power User | Leave a Comment »

Navigation bar notifications for Google web products will go away on March 7, 2019. Via Manage your notifications – Google Account Help

Posted by jpluimers on 2019/02/08

After March 7, 2019, notifications for Google web products will no longer be accessible from the navigation bar.

[WayBackManage your notifications – Google Account Help has more details, but it does not look good.

More Google stuff is dying, almost every month now. For a list of dying products see: [WayBackdidgoogleshutdown.com

Given more is dying, and the increased lack of confidence many people have in Google, more people are abandoning Google. More on that in a future post.

For now: [WayBack] “Manage your Notifications”: After March 7, 2019, notifications for Google web products will no longer be accessible from the navigation bar. If you’d l… – Edward Morbius – Google+

“Manage your Notifications”: After March 7, 2019, notifications for Google web products will no longer be accessible from the navigation bar. If you’d like to receive similar notifications in the future, you can update the notification settings for your individual Google products.

As usual, it’s not clear whether or not this will affect the notifications widget on G+ itself. Google’s standards for clarity in exposition remain uncorrupted. Which is to say: entirely inadequate.

Otherwise, the article addresses Google Photos, Hangouts Chat, and Google+ (G Suite users).

Update: Further close reading suggests that Consumer Google+ will lose Notifications on March 7:

Note: Google+ notifications are available for G Suite users only.

https://support.google.com/accounts/answer/9231049

Via: [WayBack] “Manage your Notifications”: After March 7, 2019, … – Lars Fosdal – Google+

–jeroen

Posted in G+: GooglePlus, Google, Google Photos, GoogleHangouts, Power User, SocialMedia | Leave a Comment »

Why the New V8 is so Damn Fast – NodeSource

Posted by jpluimers on 2019/02/07

Wow, impressive work, and a very good explanation of some of the optimizations that take place and how you can check which ones work on your code: [WayBack] Why the New V8 is so Damn Fast – NodeSource:

The entire V8 compiler pipeline was overhauled and shipped with Node.js version 8. This post investigates what speed improvements we can expect as a result.

Via: [WayBack] Adrian Marius Popa – Google+

–jeroen

 

Posted in Development, JavaScript/ECMAScript, Node.js, Scripting, Software Development | Leave a Comment »

Why you should always do documentation before development | Opensource.com

Posted by jpluimers on 2019/02/07

Food for thought, especially on the UX side of software: [WayBack] Why you should always do documentation before development | Opensource.com.

Via:

–jeroen

Read the rest of this entry »

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

Delphi threadvar: TLS thread local storage

Posted by jpluimers on 2019/02/07

Managing TLS correctly with all kinds of dynamic storage seems to be a nightmare.

From what I think it’s safe to use a TStopWatch [WayBackSystem.Diagnostics.TStopwatch (introduced in Delphi XE2) as threadvar (which gets into TLS: Thread-local storage) because it’s a record type and as a bonus will be zero-initialised in something like this:

threadvar
 ThreadStopwatch: TStopwatch; // threadvars are zero-initialised, like TStopwatch.Reset was called. Ensure TStopwatch.InitStopwatchType called before using this.

... thread code:
var
  lThreadElapsedMilliseconds: string;
begin
...
  if not ThreadStopwatch.IsRunning then
    ThreadStopwatch.Start;
  try
    lThreadElapsedMilliseconds := ThreadStopwatch.ElapsedMilliseconds.ToString();
    // log duration of call-to-call somewhere
... logic
    lThreadElapsedMilliseconds := ThreadStopwatch.ElapsedMilliseconds.ToString();
    // log duration of logic somewhere
  finally
    ThreadStopwatch := TStopwatch.StartNew; // resets new count
  end;

As long as I perform this in the main thread somwehere to pre-initialise the class variable, then no thread should have the penalty for that:

TStopwatch.Create(); // ensures non-public TStopwatch.InitStopwatchType is called, enabling the threadvar ThreadStopwatch get the penalty for that

If I ever need to dig deeper into TLS with Delphi, then these are starters:

–jeroen

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

Some links on keystore, encryption and decryption on Android

Posted by jpluimers on 2019/02/06

For my link archive:

 

Basically:

  • storing encrypted data plus IV in preferences is OK
  • store the symmetric encryption key (for instance an AES one) in the keystore for the application
  • likely a salt is also needed, then store the salt with the IV and encrypted data

–jeroen

Presumptions:

  • The keystore of a specific application UUID is only accessible by only that application UUID when the device has been unlocked by the user
  • The keystore saves credentials in a secure way
  • It is OK to save both the encrypted data and associated IV

Approach (plain data is “hashed application PIN”, encrypted data is “encrypted hashed application PIN”:

  1. store a symmetric AES key in the application key store
  2. after entering application PIN:
    1. hash the application PIN
    2. use the hashed application PIN to to enter the application
    3. from the keystore, obtain the symmetric AES key
    4. create a cipher based on the AES key
    5. use the cipher to obtain an IV, and to encrypt the hashed application PIN
    6. store the encrypted hashed application PIN and IV both in the application preferences
  3. when needing to enter the application, present the user to either enter the application PIN again or proof that they can pass the device unlock sequence (using an unlock activity)
    1. if the user provided the application PIN, then:
      1. hash the application PIN
      2. try to enter the application with the hashed application PIN
    2. proved the device unlock, then:
      1. from the preferences, obtain the IV and encrypted hashed application PIN
      2. from the keystore, obtain the symmetric AES key
      3. create a cipher based on the AES key
      4. decrypt the encrypted hashed application PIN using the cipher and the IV into the hashed application PIN
      5. try to enter the application with the hashed application PIN

Posted in Android, Development, Mobile Development, Software Development | Leave a Comment »

The company as a social engine – The Isoblog.

Posted by jpluimers on 2019/02/06

Food for thought about work: [WayBackThe company as a social engine – The Isoblog.

–jeroen

via: [WayBack] The company as a social engine… – Kristian Köhntopp – Google+

Posted in LifeHacker | Leave a Comment »

Delphi Declarations and Statements: Hinting Directives

Posted by jpluimers on 2019/02/06

From [WayBackDeclarations and Statements: Hinting Directives you might remember this:

The ‘hint’ directives platformdeprecated, and library may be appended to any declaration. These directives will produce warnings at compile time. Hint directives can be applied to type declarations, variable declarations, class, interface and structure declarations, field declarations within classes or records, procedure, function and method declarations, and unit declarations.

However, it doesn’t as at least these fail:

type
{ [dcc32 Error] ClassConstUsageConsoleProject.dpr(14): E1030 Invalid compiler directive: 'DEPRECATED' }
  TMyProcedure = procedure() of object deprecated 'do not use TMyProcedure';
{ [dcc32 Error] E1030 Invalid compiler directive: 'DEPRECATED' }
  TMyReference = reference to procedure() deprecated 'do not use TMyReference';

These two helped me though:

This fails too:

type
{ [dcc32 Error] E2029 '=' expected but ';' found }
  TArrayChars = array of Char; deprecated;
{ [dcc32 Error] E2029 ';' expected but identifier 'deprecated' found }
  TArrayChars = array of Char deprecated;

But this is a workaround:

type
  TArrayCharsOld = array of Char;
  TArrayChars = TArrayCharsOld deprecated;

Which works for the procedure types as well:

type
  TMyProcedureOld = procedure() of object;
  TMyProcedure = TMyProcedureOld deprecated 'do not use TMyProcedure';
  TMyReferenceOld = reference to procedure();
  TMyReference = TMyReferenceOld deprecated 'do not use TMyReference';

Bug https://quality.embarcadero.com/browse/RSP-18316

–jeroen

Posted in Delphi, Development, Software Development | 1 Comment »

GitHub – GoogleChromeLabs/ndb: ndb is an improved debugging experience for Node.js, enabled by Chrome DevTools

Posted by jpluimers on 2019/02/05

This looks like ndp is a drop in wrapper for node allowing for in depth debugging: [WayBackGitHub – GoogleChromeLabs/ndb: ndb is an improved debugging experience for Node.js, enabled by Chrome DevTools

Via: [WayBack] ndb: An Improved Debugging Experience for Node – Adrian Marius Popa – Google+

–jeroen

Posted in Development, JavaScript/ECMAScript, Node.js, Scripting, Software Development | Leave a Comment »

6502 emulation: the ICE, or in-circuit-emulator…

Posted by jpluimers on 2019/02/05

On my list of hardware things to try:

[WayBack] a different take on 6502 emulation: the ICE, or in-circuit-emulator… – mos6502 – Google+

Basically it consists of three parts:

 

–jeroen

 

Posted in 6502, Development, Hardware Development, History, Z80 | Leave a Comment »