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

How to connect S+DA0003 using SFP between MikroTikCRS226 and MikroTikCCR1009

Posted by jpluimers on 2017/10/30

Mikrotik and SFP versus SFTP+ is always confusing especially as the text on their equipment and their documentation doesn’t show well which situations work.

Equipment text is further on, this is their text searchable documentation:

As usually, a long search in the forums reveals the background information:

[WayBackSFP in SFP+ slot – MikroTik RouterOS: 10Gb SFP+ sockets are usually backward compatible with SFP, but this is not guaranteed.

There are two tricks involved to get an SFP connection between these devices working:

Read the rest of this entry »

Posted in Internet, MikroTik, Power User, routers | Leave a Comment »

ModMyPi | Cluster HAT Kit Inc. 4 x Raspberry Pi Zero

Posted by jpluimers on 2017/10/30

Interesting stuff; I wonder if there is a case for it as well:

The Cluster HAT interfaces a (Controller) Raspberry Pi A+/B+/2/3 with 4 Raspberry Pi Zeros Configured to use USB Gadget mode, it is an ideal tool for teaching, testing or simulating small scale clusters.

This Kit Includes 1 x Cluster HAT V2, 4 x Raspberry Pi Zero’s, 4 x 16GB Micro SD Cards.

Please Note. A Raspberry Pi B+/2/3, with SD Card & Power Supply are also required for set up. These items are NOT Included in the Kit but can be purchased separately.

Source: [WayBackModMyPi | Cluster HAT Kit Inc. 4 x Raspberry Pi Zero

Via Matthijs ter Woord.

–jeroen

Posted in Development, Hardware Development, Hardware Interfacing, Raspberry Pi | 2 Comments »

Need to give this some thought: multi-LAN on Mikrotik

Posted by jpluimers on 2017/10/27

Maybe for my LoT (LAN of Things): having multiple (even many) local LANs some each with their section of LoT equipment nicely separated and partially being able to talk to some of the other LANs or part of the outside world.

Some links that might help me getting this set up:

The basic plan:

  1. Configure each port or grouped (with ethernet master-port or maybe bridged) of ports having their own address pool and DHCP server so each of them are in a separate private network
  2. Routes between the networks so they can be accessed
  3. NAT mangling so the networks can reach the other networks or outside world without exposing their private network addresses
  4. Firewall rules to permit/limit which networks can see each other or the outside world

WinBox displays routes in various colors [WayBack]:

  • Black – active
  • Blue – inactive
    • interface not up or disconnected
    • other route with higher precedence already covers this route
  • Red – invalid
    • interface does not exist
    • interface is disabled
    • IP address not on that interface any more

Sometimes they show as blue while still being legitimate. Not sure why yet.

–jeroen

Posted in Development, MikroTik, RouterOS, routers, Scripting, Software Development | Leave a Comment »

OS X Mountain Lion and up: Zoom content on the screen

Posted by jpluimers on 2017/10/27

"Preferences

Accessibiity -> Zoom -> enable checkbox” class=”size-medium” /> Preferences -> Accessibiity -> Zoom -> enable checkbox

I didn’t know this was built-in since Mountain Lion and up, but it is, is startable from the keyboard and it’s tremendously convenient when presenting: [WayBack]: OS X Mountain Lion: Zoom content on the screen.

TL;DR:

  1. System Prefrecences
  2. Accesibility
  3. Zoom
  4. Checkbox

–jeroen

Posted in Apple, iMac, Keyboards and Keyboard Shortcuts, Mac, Mac OS X / OS X / MacOS, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, macOS 10.12 Sierra, OS X 10.10 Yosemite, OS X 10.11 El Capitan, OS X 10.8 Mountain Lion, OS X 10.9 Mavericks, Power User | Leave a Comment »

Internet of default passwords … – did it improve at all?

Posted by jpluimers on 2017/10/26

Just over a year after this got posted, I wonder what the current state of affairs is. Did it get a lot worse or just a little (as when writing this in November 2016 my guess is that it won’t get any better soon):

To repeat +Thomas Mueller ‘s words:

Internet of default passwords …
Sounds bad until you realize that it’s even worse. There are millions of devices out there that can be or have already been compromised and can get their owners into deep shit, without their owners even doing anything wrong. And keeping your virus scanner up to date won’t help at all (it doesn’t really protect your PC either, but that’s a different story).

Just watch the first 10 minutes of the video, but be warned, it might ruin your day.

Via +Joe C. Hecht:

I found this to be a superior product – If you are into security, this episode was worth a listen. I hear they are into talking about home servers too. I like that.

A new TechSNAP is OUT: http://bit.ly/tsnap288

The Internet of Things is the Internet of Terrible, we’ll round up the week’s stories & submit the TechSNAP solution to you the audience. Plus the security cost of Android fragmentation, great questions & a packed round up!

Source:

Read the rest of this entry »

Posted in IoT Internet of Things, Network-and-equipment, Opinions, Power User | Leave a Comment »

The Format function introduced in Delphi 1 was based on the FormatStr function in Turbo Vision available in Turbo Pascal 6 or higher

Posted by jpluimers on 2017/10/26

I did find my Borland Pascal 7.0.1 ISO which showed that https://github.com/romiras/turbo-pascal-archive/blob/master/Files/Dos%20Navigator/FORMAT.ASM is identical to ./BP/RTL/TV/FORMAT.ASM which is used from ./BP/RTL/TV/DRIVERS.PAS to provide this:

{ String formatting routines }

{$L FORMAT.OBJ}

procedure FormatStr(var Result: String; const Format: String; var Params);external {FORMAT};

There are various examples like in ./BP/EXAMPLES/DOS/TVDEMO/ASCIITAB.PAS at line 143:

FormatStr(TempStr, ' Char: %c Decimal: %0# Hex: %0#x ', ASCIIChar);

So it was in the Drivers unit, but also easy to incorporate in your own unit by linking the .OBJ file and providing the external declaration in any unit.

The Drivers unit is very independent of the rest of Turbo Vision: it uses the Objects unit (which most projects use as the System unit at ~500 lines of code provided very little functionality by itself).

For the diskette based install, the .TPU files were on the standard disks and the sources for both RTL and Turbo Vision on separate disks, but anyone would install them as they provided a lot of insight. The CD-ROM has them all on the same medium (both as installers and unpacked in the BP directory).

I just checked Turbo Pascal 6.0 (that I did have a VM for) which has them in the same way.

Source: [WayBackWe’re discussing with the collegues: anybody knows when Format function was introduced in Delphi? – Klaus Edelmann – Google+

–jeroen

Posted in Borland Pascal, Delphi, Development, History, Pascal, Software Development, Turbo Pascal | Leave a Comment »

roelandjansen/pcmos386v501: PC-MOS/386 v5.01 final release including cdrom driver sources.

Posted by jpluimers on 2017/10/25

History: Borland C++ source code for the PC-MOS/386 5.01 version at roelandjansen/pcmos386v501: PC-MOS/386 v5.01 final release including cdrom driver sources.

Related:

–jeroen

Via: [WayBack/Archive.is] PC-MOS/386 is na dertig jaar opensourcesoftware – Computer – .Geeks – Tweakers

Posted in Borland C++, C, C++, Development, History, Software Development | Leave a Comment »

cURL – POST an XML file as a stream

Posted by jpluimers on 2017/10/25

I hope I’m not alone on this but I find the cURL documentation hard to follow and short on examples.

My goal was to mimic some HTTP XML posting traffic a server gets from IoT devices. Google Chrome Postman (or Postman REST Client) reproduction is very easy and will send.

TL;DR

  1. ensure you have an empty --header "Content-Type:" header: this ensures that cURL doesn’t add one and does not mess on how the content is being transferred.
  2. use the --data or --data-binary command with an @ to post a file as body.
  3. if you want --write-out then be sure you have a recent cURL version.

This is how the IoT or Postman will send.

  • Post headers like these:

Host:127.0.0.1:8080
Content-Length: 245
Connection:Keep-Alive

  • Content like this:


<?xml version="1.0"?>
<Root Attribute="value">
<Branch>
<Leaf>content</Leaf>
</Branch>
<Branch Attribute="value">
<Bough Attribute="value">
<Twig Attribute="value">
<Leaf Attribute="value"/>
</Twig>
</Bough>
</Branch>
</Root>

The data is being streamed to the HTTP server even with the very limited set of headers.

I’ve been unable to come up with exact cURL statement that exactly matches the headers and way the content is being transferred.

This is what I tried (in all examples, %1 is the IPv4 address of the HTTP 1.1 server):

  • POST with the all the headers and the --data command:

curl --request POST --header "Host: %1:8080" --header "Content-Length: 245" --header "Connection: Keep-Alive" --data @httpPostSample.xml http://%1:8080/target

This will hang the connection: somehow cURL will never notify the upload is done and the HTTP server keeps waiting. When you put --verbose or --trace-ascii - on the command-line you will see something like this before hanging: * upload completely sent off: 245 out of 245 bytes.

Note the trick to emit the ASCII trace to stdout using --trace-ascii with the minus sign: thanks to [WayBack] Daniel Stenberg for answering [WayBackHow can I see the request headers made by curl when sending a request to the server? – Stack Overflow.

You can do the same with --trace which dumps all characters (not only ASCII) including their HEX representation

  • POST with the all but the Content-Length headers and the --data command:

curl --request POST --header "Host: %1:8080" --header "Connection: Keep-Alive" --data @httpPostSample.xml http://%1:8080/target

This will automatically add a Content-Length: 245 header and complete the transfer. But it will also add a Content-Type: application/x-www-form-urlencoded header causing the content not being posted as a body.

  • POST with a --form file= command:

curl --request POST --header "Host: %1:8080" --header "Connection: Keep-Alive" --form file=@httpPostSample.xml http://%1:8080/target

This will automatically ad a Content-Length: xxx header (way longer than 245) because it converts the request into a Content-Type: multipart/form-data; boundary=------------------------e1c0d47bac806954 one (the hex at the end differs) which is totally unlike what Postman does.

It is also unlike to what the HTTP server accepts.

curl --request POST --header "Host: %1:8080" --header "Connection: Keep-Alive" --data-binary @httpPostSample.xml http://%1:8080/target

curl –request POST –header “Host: %1:8080” –header “Connection: Keep-Alive” –data-binary @httpPostSample.xml http://%1:8080/target

It turns out that --data-ascii is exactly the same as --data and that --data-binary just skips some new-line conversion when compared to --data or --data-ascii. Contrary to the --data-raw documentation that suggest it is equivalent to --data-binary it seems --data-raw behaves exactly like --data and --data-ascii. Odd.

So these are all stuck with the Content-Type: application/x-www-form-urlencoded and I thought I was running out of options.

Then I found [WayBacksoundmonster had posted an answer at [WayBackhttp – What is the cURL command-line syntax to do a POST request? – Super User mentioning to add a Content-Type header.

So I changed the request to include the --header "Content-Type: text/xml; charset=UTF-8"  header:

  • curl --request POST --header "Content-Type: text/xml; charset=UTF-8" --header "Host: %1:8080" --header "Connection: Keep-Alive" --data @httpPostSample.xml http://%1:8080/target

This works. But: the Content-Type header is not present in the original request.

Finally it occurred to me: What if cURL would not insert a Content-Type header if I add an empty Content-Type header?.

That works!

  • curl --request POST --header "Content-Type:" --header "Host: %1:8080" --header "Connection: Keep-Alive" --data @httpPostSample.xml http://%1:8080/target

It posts exactly the same content as the IoT devices and Postman do.

Phew!

 

I tried to combine this with the --write-out (a.k.a. -w) option, but for older versions of cURL (I could reproduce with 7.34) that forces cURL back in to Content-Type: application/x-www-form-urlencoded mode so watch your cURL version!

Later I will put more research in chuncked transfer. Links that might help me:

–jeroen

Some of the references:

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

MAC address ranges safe for testing purposes (Locally Administered Address)

Posted by jpluimers on 2017/10/25

Similar to IP ranges for private networks that are safe for testing

  • 10.0.0.0/8 (255.0.0.0)
  • 172.16.0.0/12 (255.240.0.0)
  • 192.168.0.0/16 (255.255.0.0)
  • fd00::/8

there are also locally administered MAC address ranges safe for testing

  • x2:xx:xx:xx:xx:xx
  • x6:xx:xx:xx:xx:xx
  • xA:xx:xx:xx:xx:xx
  • xE:xx:xx:xx:xx:xx

Thanks to [WayBack] Sam and [WayBackPeter for answering.

–jeroen

References:

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

EKON 21 – The Conference for Delphi & More

Posted by jpluimers on 2017/10/24

I barely made it to EKON21 mainly because of extensive family members care-taking, so could not attend everything and archived the site for

The Conference for Delphi & More | 23 – 25 October 2017, Cologne | presented by Entwickler Akademie and Entwickler Magazin

[WayBackEKON 21 – The Conference for Delphi & More:

It seems one older conference is archived.

–jeroen

Posted in Conferences, Delphi, Development, EKON, Event, Software Development | Leave a Comment »