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, 2017

Managing WIFI connections using the Mac OSX…

Posted by jpluimers on 2017/02/10

These links:

Made me add this to my ~/.bash_profile:

Read the rest of this entry »

Posted in Apple, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.6 Snow Leopard, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, OS X 10.10 Yosemite, OS X 10.9 Mavericks, Power User | Leave a Comment »

The 2017 web is bloated and slow, and I am guilty, too. – The Isoblog – website speed tests

Posted by jpluimers on 2017/02/10

[WayBackThe 2017 web is bloated and slow, and I am guilty, too. – The Isoblog.

My site on 2G: load time 60 seconds: [Archive.isWebPagetest Test Result – Dulles : wiert.me – 02/09/17 21:45:23

–jeroen

For Player-FM:

https://plus.google.com/+JeroenPluimers/posts/ASnejgv5M9r

 

 

Posted in Blogging, Power User, SocialMedia | Leave a Comment »

RDP Clipboard Fix – via Remko Weijnen’s Blog (Remko’s Blog)

Posted by jpluimers on 2017/02/09

RDP Clipboard Fix is the client-side fix for loosing your RDP clipboard (server side fix is killing the RDPClip process). Since his site is not archived but some of the links have 404’s, here is the full article with fixed WayBack links:

Did you ever loose Clipboard functionality (copy/paste) while working with several Terminal Server sessions? I think everyone that works a lot with Terminal Server has experienced this from time to time.

It’s caused by badly behaving applications. Dimitry Vostokov wrote a tool to fix this issue for Citrix (RepairCBDChain.exe), he explains the issue very well on his blog:

Windows has a mechanism to notify applications about clipboard changes. An application interested in such notifications has to register itself in the so called clipboard chain. Windows inserts it on top of that chain and that application is responsible to propagate changes down the chain:

rc1.JPG

If 3rd-party application forgets to forward notifications down then we have a broken clipboard chain and clipboard changes are not sent via ICA protocol:

Read more at Dimitry’s Blog: http://web.archive.org/web/20071019060125/http://citrite.org/blogs/dmitryv/2006/12/09/clipboard-issues-explained/

So how can we fix this for Terminal Server then?

MSTSC creates a hidden window with Window Class RdpClipRdrWindowClass, you can observe this with a Window Spy tool such as X-Spy

Clipboard Redirector Window

If we look at the Window Style we can see the Window is hidden (doesn’t contain WS_VISIBLE):

Window Style

So we just need to find all windows with this Windows Class and subscribe them to Clipboard Notifications.

The code is simple:

function EnumWindowsProc(hHwnd: HWND; Param:Integer): boolean; stdcall; 
var ClassName: String; 
begin 
  SetLength(ClassName, 255); 
  SetLength(ClassName, GetClassName(hHWnd, PChar(ClassName), 255));        
 
  if ClassName = 'RdpClipRdrWindowClass' then 
  begin 
    // This is uses to restore the clipboard functionality 
    SetClipboardViewer(hHWND); 
  end; 
  Result := True; 
end;

Using EnumWindows instead of FindWindow (as RepairCBDChain seems to do) has the advantage that it finds multiple windows (when you have multiple sessions) and not just the first.

You can download the compiled version below. If you like it why not leave a comment?

Screenshot RDPFixClip

RDP Clipboard Fix (12076) – RDPFixClip.zip

See here for more Terminal Server related articles:http://remkoweijnen.nl/blog/topics/terminalserver/

There’s an explanation of this issue at the Microsoft Terminal Services team blog too:
http://blogs.msdn.com/ts/archive/2006/11/16/why-does-my-shared-clipboard-not-work-part-1.aspx
http://blogs.msdn.com/ts/archive/2006/11/20/why-does-my-shared-clipboard-not-work-part-2.aspx

–jeroen

Source: RDP Clipboard Fix | Remko Weijnen’s Blog (Remko’s Blog)

Posted in Clipboard, Development, Power User, Software Development | 1 Comment »

Date format converter from Text or Unix/Mac/Filetime/Microsoft to virtually any readable form

Posted by jpluimers on 2017/02/09

Brilliant Date format converter from dates in Text (almost any format) or timestamp numbers in Unix, Mac, Filetime or Microsoft (which is the same as Delphi TDateTime) format to any of these formats:

Text Date:
Date in human-readable text
Wednesday, March 23, 2016 4:05:39pm
RFC 822:
RFC 822 formatted date
Wed, 23 Mar 2016 16:05:39 +0000
ISO 8601:
ISO 8601 formatted date
2016-03-23T16:05:39+00:00
UNIX Timestamp:
seconds since Jan 1 1970
1458749139
Mac Timestamp:
seconds since Jan 1 1904
3541593939
Microsoft Timestamp:
days since Dec 31 1899
42452.670590278
FILETIME:
100-nanoseconds since Jan 1 1601
131032227390000000
01D1851D:D7B58B80

Source: Date format converter

–jeroen

Posted in *nix, .NET, Apple, Delphi, Development, Mac, Mac OS X / OS X / MacOS, Power User, Software Development | 1 Comment »

Trying to recover from enhancement software that generates fake input incorrectly – The Old New Thing

Posted by jpluimers on 2017/02/08

Be sure to read the details in Trying to recover from enhancement software that generates fake input incorrectly – The Old New Thing [WayBack] (much more Old New Think stuff below):

The most insightful part for me was this diagram listing where various methods enter the message pipeline (I added the GetMessage/PeekMessage entry):

Read the rest of this entry »

Posted in Conference Topics, Conferences, Delphi-Tage.de, Development, Event, Software Development, The Old New Thing, Windows Development | Leave a Comment »

Determining the current shell in *n*x variants including ESXi

Posted by jpluimers on 2017/02/08

On most systems, I use bash as shell, but not all systems have it, for instance the shell.xs4all.nl server uses tcsh and ESXi 4+ uses a very limited ash shell from busybox (ESX 4 had bash though).

There is this huge script that covers many shell and operating system versions (even DOS, Windows) and interpreters (python, ruby, php, etc) what shell is this which I got through Stéphane Chazelas‘s answer in linux – determine shell in script during runtime – Unix & Linux Stack Exchange

I wanted a shorter thing that works in current Linux, BSD, OS X and ESXi versions.

Some very short scripts are less reliable, for instance echo $SHELL looks nice, but isn’t always set.

Similar for echo $0 which will fail for instance if it shows as sh but in fact is a different shell in disguise.

This works for bash, tcsh and busybox sh, is a bit more precise than getting $0. It’s based on HOWTO: Detect bash from shell script – Stack Overflow:

lsof -p $$ | awk '(NR==2) {print $1}'

But on ESXi it shows this because lsof doesn’t take any parameter there and just dumps all information:

----------+---------------------+---------------------+--------+------------------

It’s because lsof on ESXi always shows this header where Cartel and World aren’t exactly well documented:

Cartel | World name | Type | fd | Description
----------+---------------------+---------------------+--------+------------------

Empirically for non VM related processes, it looks like the Cartel is the PID and World name the command.

On Linux and BSD based systems, the header looks like this, so command and PID are reversed in ESXi:

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME

This command then works on both ESXi, OS X, Linux and BSD assuming you can word search for the PID and noting that PID/command will be reversed on ESXi as compared to OSX/Linux/BSD:

lsof -p $$ | grep -w $$ | awk '(NR==2) {print $1,$2}'

–jeroen

Posted in Apple, bash, BSD, Development, iMac, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.4 Tiger, Mac OS X 10.5 Leopard, Mac OS X 10.6 Snow Leopard, Mac OS X 10.7 Lion, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, OS X 10.10 Yosemite, OS X 10.11 El Capitan, OS X 10.8 Mountain Lion, OS X 10.9 Mavericks, Power User, Scripting, Software Development | Leave a Comment »

Delphi multithreading – AcquireExceptionObject/ReleaseExceptionObject to pass exception from one thread to another thread – via G+ and Stack Overflow

Posted by jpluimers on 2017/02/07

A long time ago, Thomas Mueller (dummzeuch) – Google+ reminded [WayBack] me of this which I required a short while ago:

You can use AcquireExceptionObject():

AcquireExceptionObject returns a pointer to the current exception object and prevents the exception object from being deallocated when the current exception handler exits.

Then you can send the pointer to another thread and if you raise it there it will be freed for you, otherwise you must call ReleaseExceptionObject() to free it.

After the answer by Remy Lebeau [WayBack] and Remko [WayBack] is a comment [WayBack] by mghie [WayBack] that mentions AsyncCalls.pas that now is available on GitHub [WayBack].

If you have a very old (version <= 5) Delphi or just want to look at how AcquireExceptionObject [WayBack] looks like just look at a similar implementation there [WayBack]. Note that instead of the ReleaseExceptionObject [WayBack] call, AsyncCalls re-raises the exception [WayBack].

–jeroen

 

Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 2007, Delphi 2009, Delphi 2010, Delphi 5, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | Leave a Comment »

Get a code signing certificate – Windows 10 hardware dev

Posted by jpluimers on 2017/02/07

Thanks Mathijs ter Woord for letting me know this: Get a code signing certificate – Windows 10 hardware dev

Posted in Development, Hardware Development | Leave a Comment »

Casting the audio of application on your Linux machine via Chrome to a ChromeCast

Posted by jpluimers on 2017/02/06

Hopefully by now mkchromecast [WayBack] works on more Linux versions (and maybe even Mac OS X is better supported [WayBack]), but back then it was only available for Ubuntu 16.10 and up:

Do you want to stream the audio from Rhythmbox, VLC or another Linux app to your TV through Chromecast? Well, we’ve found a nifty little Linux tool that lets you do just that.

Source: How to Send Your Linux Desktop Audio to a Chromecast – OMG! Ubuntu!

The tool is at github: Linux · muammar/mkchromecast Wiki  [WayBack]: mkchromecast – Cast macOS, or Linux Audio to your Google Cast Devices

–jeroen

via:

Posted in *nix, Chrome, Chromecast, Google, Linux, Power User, Ubuntu | Leave a Comment »

dubbelglas, dubbel glas, dubbele beglazing, isolatieglas

Posted by jpluimers on 2017/02/06

Veel informatie over dubbelglas, dubbel glas, dubbele beglazing, isolatieglas met typen, toepassingen, fabrikanten, etc.

En mocht er wat breken:

Voor een compleet overzicht van alle mogelijke glasbreuken download de Folder Glasbreuken als PDF. Thermische breuken Een thermische breuk ontstaat, wanneer de typische materiaalkarakteristieken van het glas in relatie tot de kwaliteit van de rand van het glas en de bestendigheid … Continue reading →

Source: Glasbreuken – van der Ham Glasgroothandel BV

De laatste heeft sowieso een hele verzameling nuttige Veel gestelde vragen – van der Ham Glasgroothandel BV

–jeroen

Posted in LifeHacker, Power User | Leave a Comment »