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

Thread by @b0rk: “nmap i haven’t used nmap much except to scan my home network for fun so if i missed something really important i’d love to know! […]”

Posted by jpluimers on 2021/02/05

[WayBack] Thread by @b0rk: “nmap i haven’t used nmap much except to scan my home network for fun so if i missed something really important i’d love to know! […]”


i haven’t used nmap much except to scan my home network for fun so if i missed something really important i’d love to know!

also i need to find space in there somewhere for “if you don’t run nmap as root it can’t send icmp (ping) packets, it’s better to run nmap as root”

also be careful when nmapping in a network you don’t administer! it’s a popular hacking tool so using nmap is often discouraged / banned. i made all of the examples in this comic “nmap scanme.nmap.org” and “nmap your home network” for a reason :)

There are are quite a few interesting comments on the thread:

And it taught me about scanme.nmap.org: [WayBack] Go ahead and ScanMe!

Hello, and welcome to Scanme.Nmap.Org, a service provided by the Nmap Security Scanner Project and Insecure.Org.

We set up this machine to help folks learn about Nmap and also to test and make sure that their Nmap installation (or Internet connection) is working properly. You are authorized to scan this machine with Nmap or other port scanners. Try not to hammer on the server too hard. A few scans in a day is fine, but dont scan 100 times a day or use this site to test your ssh brute-force password cracking tool.

Thanks
Fyodor

–jeroen

Read the rest of this entry »

Posted in *nix, *nix-tools, nmap, Power User | Leave a Comment »

Twitter @Nick_Craver: “I’ve talked with so, so many new devs over the years and far too many are afraid to try because they’re afraid to fail. So do me a favor, share your failures […]”

Posted by jpluimers on 2021/02/04

Every now and then it is good to read back this [WayBack] thread by @Nick_Craver: “

I’ve talked with so, so many new devs over the years and far too many are afraid to try because they’re afraid to fafavor, share your failures.

So do me a favor, share your failures. Not just the successes. It’s not just about learning from them. Sometimes it’s just about people knowing they happen.

Reminder: you see the successes people are proud of and want to shout from the rooftops for all to see. Far, far fewer people share all the failures leading up to those successes. Yet those missteps are almost always far more numerous.

Hi, I’m a dev. I’ve caused more production outages that I can count. I’ve deleted a production database by accident. I’ve missed hundreds of bugs in code reviews. I try my best. I try to not repeat mistakes. It still happens sometimes. I still think my impact has been a net good.

[…]”

The thing about mistakes is that they do happen, and we need to learn from them. Almost always, it is useless to blame, but do your best to prevent them from happening again by doing blameless post-mortem.

We do however need to become better engineers, so this thread is relevant as well, because the impact of some is not been a net good:

[Cached] WayBack: thread by @www_ora_tion_ca: “This is wildly disingenuous, I speak as a flight instructor and major IT incident investigator. Modern software authors have the professional discipline of a cute puppy in comparison to aviation practitioners. […]”. quoting [WayBack] Alex Stamos on Twitter: “I agree with Chris. This is the kind of thinking that leads to “Why can’t we just have building codes for software? It worked to protect against earthquakes and fire!” Earthquakes and fire aren’t conscious adversaries. Try writing a standards document on how to win at chess.”

My biggest faults:

Read the rest of this entry »

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

delphi – Faster DirectoryExists function? – Stack Overflow

Posted by jpluimers on 2021/02/04

From a while back: [WayBack] delphi – Faster DirectoryExists function? – Stack Overflow:

Q

I use

DirectoryExists (const PathName : String);

to check if a directory is reachable from a computer or not. But if the directory does not exist and the path name is a network path, i.e.

\\computer1\Data

the method takes a very long time to return.

There must be a faster way to determine that a network folder is not reachable. Or can I configure some timeout parameter that DirectoryExists uses internally (I looked at the source code but it just delegates to GetFileAttributes which is defined in kernel32)?

Any ideas?

A

There is no faster way:

any function accessing anything on a remote share will timeout when that share is not available.

If the cause of your timeouts is automatic disconnecting of shares, then these link may help you:

If the application can continue without the completion of the check, then you can put the check in a separate thread, and upon completion of the check, you can update your status in the UI.

Be aware that when you try a multi-threading way, that you have to disprove your code is free of race-conditions and memory leaks. Time-outs in combination with exceptions usually make that a hard task.

Related:

–jeroen

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

Chris Foster: Windows Development in a KVM Virtual Machine

Posted by jpluimers on 2021/02/04

For my link archive: [WayBack] Chris Foster: Windows Development in a KVM Virtual Machine covering among others much (mostly based [WayBack] libvirt: The virtualization API) stuff:

Similar posts:

–jeroen

Posted in Development, KVM Kernel-based Virtual Machine, Power User, Proxmox, Software Development, Virtualization, Windows | Leave a Comment »

A choco install list

Posted by jpluimers on 2021/02/03

Sometimes I forget the choco install mnemonics for various tools, so here is a small list below.

Of course you have to start with an administrative command prompt, and have a basic Chocolatey Installation in place.

If you want to clean cruft:

choco install --yes choco-cleaner

Basic install:

choco install --yes 7zip
choco install --yes everything
choco install --yes notepadplusplus
choco install --yes beyondcompare
choco install --yes git.install --params "/GitAndUnixToolsOnPath /NoGitLfs /SChannel /NoAutoCrlf /WindowsTerminal"
choco install --yes hg
choco install --yes sourcetree
choco install --yes sysinternals

For VMs (pic one):

choco install --yes vmware-tools
choco install --yes virtio-drivers

For browsing (not sure yet about Chrome as that one has a non-admin installer as well):

choco install --yes firefox

For file transfer (though be aware that some versions of Filezilla contained adware):

choco install --yes filezilla
choco install --yes winscp

For coding:

choco install --yes vscode
choco install --yes atom

For SQL server:

choco install --yes sql-server-management-studio

For web development / power user:

choco install --yes fiddler

For SOAP and REST:

choco install --yes soapui

If you don’t like manually downloading SequoiaView at gist.github.com/jpluimers/b0df9c2dba49010454ca6df406bc5f3d (e8efd031d667de8a1808d6ea73548d77949e7864.zip):

choco install --yes windirstat

For drawing, image manipulation (paint.net last, as it needs a UI action):

choco install --yes gimp
choco install --yes imagemagick
choco install --yes paint.net

For ISO image mounting in pre Windows 10:

choco install --yes wincdemu

For hard disk management:

choco install --yes hdtune
choco install --yes seatools
choco install --yes speedfan

For Fujitsu ScanSnap scanners (not sure yet this includes PDF support):

choco install --yes scansnapmanager

–jeroen

Posted in 7zip, atom editor, Beyond Compare, Chocolatey, Compression, Database Development, Development, DVCS - Distributed Version Control, Everything by VoidTools, Fiddler, Firefox, Fujitsu ScanSnap, git, Hardware, Mercurial/Hg, Power User, Scanners, SOAP/WebServices, Software Development, Source Code Management, SQL Server, SSMS SQL Server Management Studio, SysInternals, Text Editors, Versioning, Virtualization, VMware, VMware ESXi, vscode Visual Studio Code, Web Browsers, Web Development, Windows | Leave a Comment »

How many dependencies does your development eco system have?

Posted by jpluimers on 2021/02/03

About 5 years after the disaster around npm and left-pad, I wonder

  1. how many dependencies on packages or libraries your software has,
  2. how many of them have a good or excellent test suite,
  3. how many of these you are in full control of determining the exact version used and the location it is uses from.

The disaster was well phrased in [WayBack] NPM & left-pad: Have We Forgotten How To Program? – David Haney – Blogging my experiences as a developer and engineering manager. of which these topics:

  • Functions are not packages
  • Third party problems
  • Strive for few dependencies

and these quotes:

  • React, Babel, and a bunch of other high-profile packages on NPM broke. The reason they broke is rather astounding:A simple NPM package called left-pad that was a dependency of their code.
  • some of the things that I observed:
    • There’s a package called isArray that has 880,000 downloads a day, and 18 million downloads in February of 2016. It has 72 dependent NPM packages. Here’s its entire 1 line of code:return toString.call(arr) == '[object Array]';
    • There’s a package called is-positive-integer (GitHub) that is 4 lines long and as of yesterday required 3 dependencies to use. The author has since refactored it to require 0 dependencies, but I have to wonder why it wasn’t that way in the first place.
    • A fresh install of the Babel package includes 41,000 files
    • blank jspm/npm-based app template now starts with 28,000+ files
  • frameworks create a “core” library of basic functionality. Such a library is vetted by the creators of the language and pretty much guaranteed to be correct and bug-free.
  • if you cannot write a left-pad, is-positive-integer, or isArray function in 5 minutes flat (including the time you spend Googling), then you don’t actually know how to code. Any of these would make a great code screening interview question to determine whether or not a candidate can code.
  • Take on a dependency for any complex functionality that would take a lot of time, money, and/or debugging to write yourself. Things like a database access layer (ORM) or caching client should be dependencies because they’re complicated and the risk of the dependency is well worth the savings and efficiency.
  • ask the React team how well their week has been going, and whether they wish they had written those 11 lines for left-padding a string themselves.

Via: [WayBack] “There’s a package called isArray that has 880,000 downloads a day, and 18 million downloads in February of 2016. It has 72 dependent NPM packages. Here… – Elke Stangl (elkement) – Google+

Related:

–jeroen

Posted in Design Patterns, Development, Software Development, Systems Architecture | Leave a Comment »

jeroenp / wiert.me / Native / Delphi / Apps / Console / DfmTools — Bitbucket

Posted by jpluimers on 2021/02/03

Reminder to self: write some more about the IsBinaryDfmFile and ConvertDfmToText tools in [WayBackjeroenp / wiert.me / Native / Delphi / Apps / Console / DfmTools — Bitbucket

–jeroen

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

HTML Div Table – Online Tools

Posted by jpluimers on 2021/02/02

[WayBack] HTML Div Table – Online Tools:

Free online tools to make Div Table composing a piece of cake! HTML table generator and converter with interactive source editor and much more!

I hope this still exists, as the first time it helped me convert HTML table based tables to div based tables.

They had these tools back then:

  • [WayBack] HTML Div Table Generator

    Generate HTML Div table grids for websites in just a few easy steps. Set the options then select the desired size. Adjust the options in the interactive editors

  • [WayBack] HTML Table to Div Converter

    Transform traditional HTML Tables to Div Tables. Copy and convert any visual table document to Div tables with a simple click of a button

  • [WayBack] HTML Table Styler 📅 CSS Generator

    Free online interactive HTML Table and structured div grid styler and code generator. Select a style from the gallery and adjust the settings to get the HTML and CSS codes.

–jeroen

Posted in Development, HTML, Software Development, Web Development | Leave a Comment »

LockWindowUpdate function (Windows) and some OldNewThing thoughts

Posted by jpluimers on 2021/02/02

If you ever think about using [WayBack] LockWindowUpdate function (Windows), then read these first:

TL;DR:

Do not use LockWindowUpdate as the limitation is system wide: Only one Window in the system can be used for LockWindowUpdate.

Use WM_SETREDRAW if you can as LockWindowUpdate “should only to be called to disable drawing in the window beneath the cursor during a drag and drop operation”: there is only one locked window at a time: There can be only one drag/drop operation active at a time, since there is only one mouse.

Instead of LockWindowUpdate(hwnd)
Use SendMessage(hwnd, WM_SETREDRAW, FALSE, 0) or
SetWindowRedraw(hwnd, FALSE)
Instead of LockWindowUpdate(NULL)
Use SendMessage(hwnd, WM_SETREDRAW, TRUE, 0) or
SetWindowRedraw(hwnd, TRUE)

Prototype

BOOL LockWindowUpdate(
  _In_ HWND hWndLock
);

Oh, and it’s not called LockWindowUpdate everywhere: [WayBackSetting a Visual Studio breakpoint on a Win32 API function in user32.dll – The Entrian Solutions Blog.

–jeroen

Posted in Development, Software Development, The Old New Thing, Windows Development | Leave a Comment »

Delphi: fixing “W1030 invalid compiler directive true”

Posted by jpluimers on 2021/02/02

I had a “W1030 invalid compiler directive true” in a project that got ported from Delphi XE3 to a much more modern Delphi version.

Luckily I found [WayBack] Porting to XE5 and the “W1030 Invalid compiler directive: ‘true’” warning | The curse of Dennis D. Spreen.

The cause was this on one of the PropertyGroup elements:

        <DCC_DebugInformation>true</DCC_DebugInformation>

This correspondents to the Project Options ->  Delphi Compiler -> Compiling -> Debugging setting to be true which is not supported any more.

It is similar to When the Delphi XE5 commandline compiler fails with error F1026: File not found: ‘False.dpr’

Related: [WayBack] Embarcadero Discussion Forums: XE10 compiler war: [dcc32 Warning] W1030 Invalid compiler directive:’true’

–jeroen

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