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

Noooooo!!!! – surprise for Cookie Day

Posted by jpluimers on 2016/12/04

Though from Mark Parisi, it’s not on offthemark.com (any more?), but still floats around:

Empty Trash, Delete Cookies, No!

It’s starring Cookie Monster and Oscar the Grouch. Who doesn’t love the two starring together.

Surely you’ll like Cookie Day – 4th Dec, 2016 | Days Of The Year

–jeroen

via

 

Posted in Fun | Leave a Comment »

Make a cheap TOR anonymizer — BYTESEC Labs Inc

Posted by jpluimers on 2016/12/02

I had a few friends ask if they could buy a cheap travel router that protects their internet activity as they travel around the globe. So my criteria:

  1. Cheap (< USD 20)
  2. Portable (pocket size)

Source: [WayBackMake a cheap TOR anonymizer — BYTESEC Labs Inc

via: [WayBack] hmmm – Joe C. Hecht – Google+

–jeroen

Posted in Network-and-equipment, Power User | Leave a Comment »

C13/C14 wiring diagram live/neutral/earth

Posted by jpluimers on 2016/12/02

Edit 20220215/20200713: The original wiring description in this article was wrong, thanks Jules Vape and John Cooper for pointing this out in the comments.

This is the correct wiring according to IEC 60320 – Wikipedia: C13/C14_coupler: File:IEC60320 C13.jpg – Wikipedia (rotated for clarity) and Source: File:IEC60320 C14.jpg – Wikimedia Commons.

  • Facing the C13 female side that has holes:
    Position Lead
    Left N Neutral
    Middle ⏚/PE Protective Earth/Ground
    Right L Live
  • Facing the C14 male side that has pins:
    Position Lead
    Left L Live
    Middle ⏚/PE Protective Earth/Ground
    Right N Neutral

The same information from [WayBack] IEC 60320 (IEC 320) Reference Chart – IEC 60320 Connectors & Plugs | StayOnline:

IEC-60320 Plugs and Connectors
Rating
Configuration
Female/Male
International North America Wires Poles
diagram
C13/C14
250 Volts
10 Amps
125/250 Volts
15 Amps
3 Wires 2 Poles

Wiring colours

If you wire it, the colours depend on where you live. I live in the Netherlands so this shortened table does apply:

IEC (most of Europe) AC power circuit wiring color codes.

Function Label Color, IEC Color, old IEC
Protective earth ⏚/PE Color wire green yellow.svg green/yellow Color wire green yellow.svg green/yellow
Neutral N Color wire light blue.svg blue Color wire light blue.svg blue
Line, single phase L Color wire brown.svg brown Color wire brown.svg brown or Color wire black.svg black

Longer tables and infographics are here:

–jeroen

Read the rest of this entry »

Posted in Development, Electronics Development, LifeHacker, Power User | 5 Comments »

0.5W 12V 56-Lumen 7×3528 SMD LED Car White Light Bulb (Pair) – Free Shipping – DealExtreme

Posted by jpluimers on 2016/12/02

Since they work nice as car lamps, they are quite robust for weather conditions, so they work well as garden lamps too. So we have 69 of them in our deck.

–jeroen

Source: DX 0.5W 12V 56-Lumen 7×3528 SMD LED Car White Light Bulb (Pair) – Free Shipping – DealExtreme

Posted in LifeHacker, Power User | Leave a Comment »

Adding staged updates to SourceTree | SourceTree Blog

Posted by jpluimers on 2016/12/01

My experience is that early upgrades are very unstable and they take an eternity to fix bugs, I need to find a way to push myself from the early stage to the late stage.

[WayBackAdding staged updates to SourceTree | SourceTree Blog

–jeroen

Read the rest of this entry »

Posted in Development, DVCS - Distributed Version Control, git, Mercurial/Hg, Source Code Management, SourceTree | Leave a Comment »

WinSCP can be embedded and scripted as can PSFTP but not FileZilla

Posted by jpluimers on 2016/12/01

In a quest to perform SFTP in Delphi next to FTP, I first researched what I was up against. A tiny voice in the back of my head said “SFTP is totally unlike FTP” and it was right: SFTP means SSH File Transfer Protocol, not Simple File Transfer Protocol nor FTP over SSH nor FTP over SSL aka FTPS – the latter is supported by Indy but the former isn’t.

I decided against SecureBlackBox (providing SFTPBlackbox) and IPWorks (SSH) as I tried both a while ago for S/MIME support and was disappointed about both the lack of features and documentation; in the end I went for wrapping OpenSSL for the “encrypt-then-sign” process and Indy for the SSMTP part. The merger of the SecureBlackBox and IPWorks made me even less happy.

The Chilkat alternative for SFTP isn’t too compelling either: ActiveX or DLL black-box without a lot of insight on how many people do use it.

So when I had to do SFTP and knew there are no free or open source SFTP components for Delphi available I opted for thinking outside the Delphi realm.

My basic idea was to embed either of these:

  1. Filezilla (as Filezilla on Windows is waaaay faster than WinSCP)
  2. WinSCP (a Windows SCP and SFTP client written in C++ Builder)
  3. PSFTP (the Putty SFTP client)

FileZilla

FileZilla internally uses FzSFtp.exe which is based on PSFTP code (but with some buffers making it faster than PSFTP or WinSCP).

According to the author, neither FzSFtp.exe nor FileZilla can be automated:

FileZilla cannot make any automated transfers at all. Neither FileZilla.exe nor fzsftp.exe (is for SFTP) can be used for any batch processing.

Source: run filezilla tzsftp from batch command line – FileZilla Forums

The WinSCP author commented in a similar fashion:

FileZilla does not have any command line arguments (nor any other way) that allow automatic transfer.

Source: windows – Command line option to download file in FileZilla – Stack Overflow

In addition, FileZilla is always a GUI program, so running it as a console app (which I’d prefer) would be impossible.

WinSCP

WinSCP can be automated in two ways:

  1. The WinSCP.exe command-line allows for a /console and /script switch enabling scripting mode that you can use for Scripting and Task Automation :: WinSCP
  2. A wrapper around WinSCP.exe is availble as WinSCP .NET Assembly and COM Library :: WinSCP which requires both .NET to be installed and (from Delphi) calling through COM which I don’t like much

Since I already had good Delphi wrapping code round starting/waiting-for running processes, I’d opt for using WinSCP.com scripting.

There used to be wrapping code around: Use with Delphi :: Support Forum :: WinSCP

PSFTP

These Using PSFTP to transfer files securely links should get me going:

Chapter 6: Using PSFTP to transfer files securely

Practical examples:

Source locations

For my own reference, the open source locations:

Some semi-random Delphi SSL related postss

During the search above I found the below links that will be useful to me one day:

–jeroen

Posted in .NET, Delphi, Development, Software Development, SSH, TCP | 5 Comments »

String resources and the $TypedAddress Compiler Directive require a PResStringRec typecast

Posted by jpluimers on 2016/12/01

Thanks Alexey for answering and Horácio for asking:

Use type-cast PResStringRec(@SArgumentNil_NilValue_Collection)

–jeroen

via: Hey guys, When I switch on $TypedAddress Compiler Directive, it is no longer…

Posted in Delphi, Delphi 10 Seattle, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development, Uncategorized | Leave a Comment »

Actual source for DisableAlignPropertyEditor

Posted by jpluimers on 2016/11/30

Since Uwe Schuster only published a screenshot, I NewOCR-ed it and created the accompanying .dproj file (only because it’s an easy way for the DLL to require the designide package so you can use the DesignIntf and ToolsAPI units.

Uwe only posted these:

Anyway, the sources are at gist.github.com/881d4eacbcec2a9e1e6b0181f900fd7a, but the main source is this:

library DisableAlignPropertyEditor;

{
  Originally only as jpg image by Uwe Schuster.

  https://web.archive.org/web/20161117154454/https://pbs.twimg.com/media/Cxaoi-DXEAAMF03.jpg:large
  https://web.archive.org/web/20161117154450/https:/twitter.com/UScLE/status/799011392703647744
  https://web.archive.org/web/20161117154501/https://plus.google.com/107811538224738992137/posts/hTXUwkCe1TV
}

uses
  System.SysUtils,
  System.TypInfo,
  DesignIntf,
  ToolsAPI;

var
  LastRegisterPropertyEditorProc: TRegisterPropertyEditorProc = nil;

procedure NewRegisterPropertyEditor(PropertyType: PTypeInfo; ComponentClass: TClass; const PropertyName: string; EditorClass: TPropertyEditorClass);
begin
  if Assigned(EditorClass) then
  begin
    if SameText('TAlignProperty', EditorClass.ClassName) then
      Exit;
  end;
  LastRegisterPropertyEditorProc(PropertyType, ComponentClass, PropertyName, EditorClass);
end;

procedure wizardTerminate;
begin
  RegisterPropertyEditorProc := LastRegisterPropertyEditorProc;
end;

function wizardInit(const BorlandIDEServices: IBorlandIDEServices; RegisterProc: TWizardRegisterProc; var Terminate: TWizardTerminateProc): Boolean; stdcall;
begin
  LastRegisterPropertyEditorProc := RegisterPropertyEditorProc;
  RegisterPropertyEditorProc := NewRegisterPropertyEditor;
  Terminate := wizardTerminate;
  Result := True;
end;

exports
  wizardInit name WizardEntryPoint;

begin
end.

–jeroen

Read the rest of this entry »

Posted in Delphi, Delphi 10.1 Berlin (BigBen), Development, Software Development | 2 Comments »

Unbundling Pokémon Go — Applidium

Posted by jpluimers on 2016/11/30

On the reverse engineering of an early Pokemon Go apk, the protocol it uses and some more interesting findings: Unbundling Pokémon Go — Applidium

–jeroen

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

Can some recommend a good tool to build MSI package? I use Inno Setup…

Posted by jpluimers on 2016/11/30

For my G+ Link archive:

Can some recommend a good tool to build MSI package?I use Inno Setup but only to build EXE file.Thanks,  – Chris Z. – Google+

Source: Can some recommend a good tool to build MSI package? I use Inno Setup but only…

Related:

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