dummzeuch

Some Linux tools for handling and filtering the passwd file

 Linux  Comments Off on Some Linux tools for handling and filtering the passwd file
Apr 222022
 

Linux (and other Unixes) store user information in a file called passwd and the associated passwords in another file called shadow, both located in /etc. Both files are text files and use a : as the field separator.

I currently have the need to sort and filter these files in various ways. This post is mostly so I can look it up later, but if it is useful for others, you’re welcome.

Sort the passwd file by the user id

The user id is stored in the 3rd field of the file and it is numeric:

sort --numeric --field-separator=: --key=3 passwd

Remove computer accounts from passwd and shadow

If the computer is used as the domain controller for a Samba NT4 domain, the files contain entries for all computers in the the domain. These user name for these entries ends in a dollar sign “$”. So we need a regular expression that excludes all these entries.

grep -v "^[^:]*\$:" passwd
grep -v "^[^:]*\$:" shadow

Remove system users from passwd

On a Linux system there are many system accounts that are used for special purposes, e.g. for the web server, email or backup. These accounts have a user id < 1000 (this might be some specialty of Ubuntu Linux). We only want lines where the user id has 4 digits. We also must be sure that these 4 digits are in the user id field, so we have to anchor the regex on the start of the line and skip the name and password (always "x") field.
egrep “[^:]:x:[0-9]{4}:” passwd

(On servers with very many users, there may be user ids with more than 4 digits, but that doesn’t currently concern me.)

 Posted by on 2022-04-22 at 18:28

GExpertsInst is not a valid reference

 Delphi, GExperts  Comments Off on GExpertsInst is not a valid reference
Apr 152022
 

Starting with GExperts 1.3.20 calling the standalone Experts Manager displayed the error message “GExpertsInst is not a valid reference”. After that the tool actually works fine.

This bug has now been fixed in the current source code. I don’t think this minor inconvenience justifies a new release.

 Posted by on 2022-04-15 at 11:52

some dxgettext improvements

 Delphi, dxgettext  Comments Off on some dxgettext improvements
Apr 102022
 

I fixed a bug in the dxgettext executable which made it add wrong ressource string names to the po files which in turn made the msgmergePOT tool select wrong translations. You will have to compile your own executable to get this bugfix. The source code is in the project’s svn repository on SourceForge.

Also I added scripts to generate partial German and French translations for Delphi 10, 10.1, 10.2, 10.3 and 10.4 and even added those partial translations for Delphi 10, 10.1, 10.2 and 10.4 (note that 10.3 is missing) to the repository. Warning: These translations may still be faulty.

 Posted by on 2022-04-10 at 18:31

GExperts 1.3.21 experimental twm 2022-04-09 released

 Delphi, GExperts  Comments Off on GExperts 1.3.21 experimental twm 2022-04-09 released
Apr 092022
 

You may remember that I was forced to reduce GExperts support for Delphi 6 a while ago, because the IDE no longer started on my computer. It turns out that it was a GExperts bug after all.

The fix was simple once I knew what the problem was. And I only found out because carrchri, one of the few GExperts for Delphi 6 users, debugged it and told me. Thanks a lot!

When I was able to use the Delphi 6 IDE again I also fixed incompatibilities in the DFMs that prevented some of the dialogs open in Delphi 6.

So here is a new release. Apart from these two Delphi 6 related bug fixes there are some improvements to the code formatter also submitted by users:

Achim Kalwa again also submitted some patches for fixing bugs.

On top of that various High DPI display problems with Delphi 11 as well as a long standing display problem for owner drawn string grids (e.g. in the Uses Clause Manager) have been fixed.

The new GExperts version still supports all Delphi versions back to Delphi 6 (with the notable exception of Delphi 8).

As always: Report and any bugs you find (or contribute bug fixes) and also file feature requests or maybe even contribute implementations for these features.

It might take a while but I am always looking at those tickets when I find the time.

Head over to the GExperts download page to get it.

Discussion about this post in the international Delphi Praxis forum.

 Posted by on 2022-04-09 at 15:14

Duplicate entries in the identifier list of the GExperts Uses Clause Manager

 Delphi, GExperts  Comments Off on Duplicate entries in the identifier list of the GExperts Uses Clause Manager
Mar 192022
 

A long time ago I added the Identifier tab to the Uses Clause Manager in GExperts. It looks like this:

In this screen shot, I filtered for TWinControl and the expert found several matching entries, the two top ones in the unit Controls.

While this looks like a bug at first (indeed I have received a bug report for it) it is in fact a feature. There are actually two declarations of TWinControl in the unit Controls. The first is in line 212, which is a forward declaration like this:

type
  TWinControl = class;

The other is in line 1243, which is the actual declaration of the class:

  TWinControl = class(TControl)
    // class declaration goes here
  end;


(Both line numbers are from Delphi 2007, they will vary in other Delphi versions.)

The expert lists them both and when the user clicks the “Open Unit” button (or presses Ctrl+O), it will then open that unit and place the cursor in the line of the declaration.

One word to the person who reported that bug: Please do not be offended that I blogged about it not being an actual bug but a feature. It is not meant to shame you. On the contrary, I am grateful that I receive good bug reports like this one. Please keep them coming!

If you’d like to discuss this blog post, you can do so in the corresponding post in the international DelphiPraxis forum.

 Posted by on 2022-03-19 at 15:31

libjpeg-turbo and Windows XP

 Windows, Windows XP  Comments Off on libjpeg-turbo and Windows XP
Feb 182022
 

Note to self: The last 32 bit version of the libjpeg-turbo DLL compiled with MS Visual Studio (libjpeg-turbo-x.y.z-vc.exe) that supports Windows XP is version 2.0.6. Later versions apparently need a newer Visual C++ runtime that does not work on Windows XP.

A colleague of mine just learned that the hard way.

We haven’t tested the versions compiled with gcc (libjpeg-turbo-x.y.z-gcc.exe).

 Posted by on 2022-02-18 at 15:47

dzObjectInspectorFix for Delphi 2007

 Delphi  Comments Off on dzObjectInspectorFix for Delphi 2007
Feb 122022
 

The Delphi 2007 IDE has an annoying bug that causes the width of the name column in the Object Inspector to shrink over time so that it is no longer possible to actually read the property names. I have no idea what causes this and it doesn’t happen in any of the more recent IDEs. It might well be an effect of one of the other plugins I have installed (GExperts, cnPack, IDE Explorer, DDevExtensions and the Ide Fixpack).

The dzObjectInspectorFix plugin fixes that annoyance by periodically checking the width of that column and setting it to the configured minimum (Default: 150 Pixels).

To install this plugin follow these steps:

  1. check out the source code from the SubVersion repository at http://svn.osdn.net/svnroot/dzobjectinspectorfix/trunk
  2. Load the package in to the Delphi 2007 IDE
  3. Compile it
  4. Install it (right click on the package and select “Install”)

There should now be a new entry “ObjectInspectorFix” in the Tools menu which allows you to configure the plugin.

Given that it was so easy to fix that but, I really wonder why I didn’t write that plugin 10 years ago.

Discussion about this post in the international DelphiPraxis forum.

 Posted by on 2022-02-12 at 16:04

GExperts 1.3.20 experimental twm 2022-01-30 released

 Delphi, GExperts  Comments Off on GExperts 1.3.20 experimental twm 2022-01-30 released
Jan 302022
 

COVID-19 is still going strong, even 2 years after it was first discovered. We’re on the Omicron variant now and nobody knows what new variants the near future may bring. I got my vaccination jabs in 2021-06-08 (AstraZeneca), 2021-07-17 (Biontech/Pfizer) and a booster 2021-12-09 (Moderna). As you can see, I survived all of them for at least a month 😉 Side effects were limited to some mild headache that lasted for about 24 hours.

On the bright side: I have been working from home basically through the whole pandemic and I like it (my wife does too). I even managed not to put on too much weight, but using an exercise bike for 30 to 45 minutes a day takes much more effort than simply cycling to work and back. And I miss flying to the south on vacation.

But I digress:

The new GExperts version still supports all Delphi versions back to Delphi 6 (with the notable exception of Delphi 8) and even the Delphi 11 version is no longer in Alpha state (but it’s still beta, there will be glitches!). Support for per monitor DPI awareness should now work (in Delphi 11, and definitely better than in the IDE itself).

There are even a few new features:

And of course a few bug fixes.

As always: Report and any bugs you find (or contribute bug fixes) and also file feature requests or maybe even contribute implementations for these features.

Head over to the GExperts download page to get it.

Discussion about this post in the international Delphi Praxis forum.

 Posted by on 2022-01-30 at 17:46

dzBdsLauncher 1.0.8 released

 Delphi, dzBdsLauncher  Comments Off on dzBdsLauncher 1.0.8 released
Jan 222022
 

I just released dzBdsLauncher 1.0.8. It now, in addition to the already existing checks, will also examine the full filename of a .groupproj file for hints on the Delphi version.

E.g. it will correctly determine the following file names to mean Delphi 2009:

  • UnitTestsGrp_BDS2009
  • UnitTestsGrp_D2009
  • UnitTestsGrp_Delphi2009
  • UnitTestsGrp_RS2009

It also examines the directories that contain the file, e.g.
d:\source\MyProject\packages\2009\MyProjek.groupproj .

 Posted by on 2022-01-22 at 13:04