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

When you believe that you have a keylogger or some sort trojan | Official Apple Support Communities

Posted by jpluimers on 2017/10/16

We thought one of our Macs was compromised, but it wasn’t: it had too many web browsers open so it was crawling like a snake.

The below terminal commands and EtreCheck [Source: etresoft/EtreCheck: Source code for EtreCheck] helped to find out what was running:

kextstat -kl | awk '!/com\.apple/{printf "%s %s\n", $6, $7}'  

sudo launchctl list | sed 1d | awk '!/0x|com\.(apple|openssh|vix)|edu\.mit|org\.(amavis|apache|cups|isc|ntp|postfix|x)/{print $3}'  

launchctl list | sed 1d | awk '!/0x|com\.apple|edu\.mit|org\.(x|openbsd)/{print $3}'  
 
ls -1A /e*/mach* {,/}L*/{Ad,Compon,Ex,Fram,In,Keyb,La,Mail/Bu,P*P,Priv,Qu,Scripti,Servi,Spo,Sta}* L*/Fonts 2> /dev/null  

osascript -e 'tell application "System Events" to get name of every login item' 2> /dev/null  

Source: [WayBackI believe that I have a keylogger or some sort … | Official Apple Support Communities

–jeroen

Posted in Apple, Mac, MacBook, MacBook-Air, Power User | Leave a Comment »

Ritjeweg: Greenwheels, ConnectCar, Car2Go, MyWheels of toch SnappCar?

Posted by jpluimers on 2017/10/13

Ontdek én vergelijk locaties en prijzen van o.a. Greenwheels, ConnectCar, Car2Go, MyWheels of SnappCar. Vergelijken was nog nooit zo makkelijk!

Handige kaart om te zien welke auto’s er bij jou in de buurt verhuurd worden.

Source: Greenwheels, ConnectCar, Car2Go, MyWheels of toch SnappCar?

–jeroen

Posted in LifeHacker, Power User | Leave a Comment »

Mac OS X – Hardware Monitor Help: remove com.bresink.driver.BRESINKx86Monitoring

Posted by jpluimers on 2017/10/13

Just in case you have this driver installed:

$ kextstat -kl | awk '!/com\.apple/{printf "%s %s\n", $6, $7}'
com.bresink.driver.BRESINKx86Monitoring (9.0)

[WayBackHardware Monitor Help shows how to remove it:

  1. Ensure you are logged in as user with administrative rights.
  2. Use the Finder to open the folder Library at the topmost level of your system volume, and inside it, the folder StartupItems. If the driver is still installed, you will see the folder BRESINKx86Monitoring at this location.
  3. Drag the folder BRESINKx86Monitoring to the Trash. OS X may ask for your administrator password.

–jeroen

Posted in Apple, Mac, Mac OS X / OS X / MacOS, MacBook, MacBook Retina, MacBook-Air, macOS 10.12 Sierra, OS X 10.10 Yosemite, OS X 10.11 El Capitan, OS X 10.9 Mavericks, Power User | Leave a Comment »

Encoding horror: Wayback Machine “Sorry.This snapshot cannot be displayed due to an internal error.”

Posted by jpluimers on 2017/10/13

Sorry.This snapshot cannot be displayed due to an internal error.

When the Wayback Machine tries to display the archived https://plus.google.com/+KristianKöhntopp/posts/2yw9QFgCdtx which is about Unicode encoding horror.

The real horror? This used to work in the past.

Luckily it’s archived on https://archive.fo/b36gn

–jeroen

Later: credit where credit is due, as they fixed it:

[WayBack] WayBack didn’t respond to me, but instead fixed the archival of +Kristian Köhntopp’s G+ posts:… – Jeroen Wiert Pluimers – Google+

https://web.archive.org/web/*/https://plus.google.com/+KristianK%C3%B6hntopp/posts/*

Posted in Development, Encoding, Internet, InternetArchive, Power User, Software Development, WayBack machine | Leave a Comment »

Napflix | Siesta Video Platform.

Posted by jpluimers on 2017/10/13

We all know the feeling of insomnia. Your body wants to sleep but your mind is still awake and active. So how can we steady up our mind. Napflix is a video platform where you can find the most silent and sleepy content selection to relax your brain and easily fall asleep. Taking siesta wherever and whenever you like.

Source: Napflix | Siesta Video Platform.

Some I like:

Some that are sooooo funny:

 

Posted in LifeHacker, Power User | Leave a Comment »

The cloud has no walls: cache-based jamming agreement to communicate over the CPU cache even without rights

Posted by jpluimers on 2017/10/12

Oh boy: [WayBack] Alles kaputt: In der Cloud gibt es keine Wände.  – Kristian Köhntopp – Google+:

Two Amazon EC2 instances communicating over the CPU cache without the need of a network in-between them.

Open sourced foundations: IAIK/CJAG: CJAG is an open-source implementation of our cache-based jamming agreement.

In our BlackHat Asia 2017 Talk we show that the cache covert channel we built is so fast and reliable that we can do much more than tunneling SSH over it: We show that we can even stream a music video in decent quality through the cache – on the Amazon EC2 cloud.

See the BlackHat Asia Briefings Information here: https://www.blackhat.com/asia-17/brie…

See a video of the Live Demo here: https://www.youtube.com/watch?v=yPZmi…

Find our NDSS 2017 paper here: https://gruss.cc/files/hello.pdf

–jeroen

Read the rest of this entry »

Posted in Development, Hardware Development, Security, Software Development | Leave a Comment »

ThreadBarrier/ThreadBarrier.pas at master · lordcrc/ThreadBarrier

Posted by jpluimers on 2017/10/12

I mentioned Asbjørn Heid on wiert.me before. While prepping for the Deadlock Empire workshop at EKON20, I needed a Delphi equivalent for the .NET [Way: Barrier Class (System.Threading)

The game uses that in level deadlockempire.github.io/#H4-Barrier [WayBack].

Edwin van der Kraan found the ThreadBarrier/ThreadBarrier.pas at master · lordcrc/ThreadBarrier implementation via [WayBack] Is there a way to create memory barriers in Delphi? Something like .NET’s System.Threading.Barrier class, java.util.concurrent.CyclicBarrier… – Horácio Filho – Google+

It’s from Asbjoørn who is known as lordcrc on GitHub. Cool stuff!

So yes, there is a Delphi version of If you thought you could do multi-threading, then play “The Deadlock Empire” games. You can find it at https://deadlockempire.4delphi.com/ There are two deadlockempire implementations there:

The workshop was great fun!

This is about a web game focussing on the concurrency issues in multi-threading environments. By the conference there will be a Delphi version of it. At the workshop we will play each round interactively: all attendees play the round followed by a short discussion. This is about collective learning, so the speakers will probably learn… Read More

Source: [Archive.isIf you thought you could do multi-threading, then play “The Deadlock Empire” games – Entwickler Konferenz

–jeroen

Posted in .NET, C#, Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | 1 Comment »

HTML indentation: 2 spaces

Posted by jpluimers on 2017/10/12

Using too many editors in too many environments, tabbed files usually kills my productivity.

Not just because the structure of the indented code, also because most editors are stupid enough to also use tabs beyond the indentation, for instance for carefully aligned initialisation statements.

Changing the tab-size effectively waves good bye to those.

It’s weird (Wiert loves that word) that HTML peeps even argue about tabs versus spaces:

Most people still use HTML for pixel perfect rendering and spaces help getting character perfect rendering of the source code.

I was glad to bump into [WayBackJefferson Lima answering this on Stack Overflow:

The Google HTML/CSS Style Guide and the W3School HTML(5) Style Guide recommend 2 spaces.

This article also brings an analysis of the effect of tabs vs spaces in the resulting file size.

Source: [WayBack] html5 – html indenting standard, tab or two spaces? – Stack Overflow

So: use 2 spacec for HTML indent.

It doesn’t really matter in transmitted size (minified compressed transfer difference is ~0% and the usual image bloat is way larger than the HTML anyway – just try www.webbloatscore.com and watch).

References:

  • Indent by 2 spaces at a time.
  • Don’t use tabs or mix tabs and spaces for indentation.

Source: [WayBackGoogle HTML/CSS Style Guide

  • Do not add blank lines without a reason.
  • For readability, add blank lines to separate large or logical code blocks.
  • For readability, add two spaces of indentation. Do not use the tab key.
  • Do not use unnecessary blank lines and indentation. It is not necessary to indent every element.

Source: [WayBackHTML5 Style Guide

Tabs Spaces Saving
Raw file size 1403 bytes 1703 bytes 300 bytes/18%
Raw file GZipped   327 bytes   332 bytes      5 bytes/1.5%
Raw file minified 1199 bytes 1199 bytes      0 bytes/0%
Minified & GZipped   312 bytes   312 bytes      0 bytes/0%

When minified, it doesn’t matter if tabs or spaces are used, since they are all stripped away.

Source: [WayBackEffect of tabs vs. spaces in HTML files

–jeroen

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

Is there a standard function to check for null, undefined, or blank variables in JavaScript? – Stack Overflow

Posted by jpluimers on 2017/10/11

Yes there is; it’s the answer below. Note I needed to exclude false by adding a check value === false to the code below as that was a valid value for me.

You can just check if the variable has a truthy value or not. That means

if( value ) {
}

will evaluate to true if value is not:

  • null
  • undefined
  • NaN
  • empty string (“”)
  • 0
  • false

The above list represents all possible falsy values in ECMA-/Javascript. Find it in the specification at the ToBoolean section.

Furthermore, if you do not know whether a variable exists (that means, if it was declared) you should check with the typeof operator. For instance

if( typeof foo !== 'undefined' ) {
    // foo could get resolved and it's defined
}

If you can be sure that a variable is declared at least, you should directly check if it has a truthyvalue like shown above.

Further read: http://typeofnan.blogspot.com/2011/01/typeof-is-fast.html

Thanks to [WayBackUser jAndy – Stack Overflow who answered the above at [WayBackIs there a standard function to check for null, undefined, or blank variables in JavaScript? – Stack Overflow.

–jeroen

Posted in Development, JavaScript/ECMAScript, Scripting, Software Development | Leave a Comment »

How do I make the first letter of a string uppercase in JavaScript? – Stack Overflow

Posted by jpluimers on 2017/10/11

I’m a JavaScript n00b, so I like solutions like these:

Another solution:

function capitalizeFirstLetter(string) {
    return string.charAt(0).toUpperCase() + string.slice(1);
}

You could also add it to the String.prototype so you could chain it with other methods:

String.prototype.capitalizeFirstLetter = function() {
    return this.charAt(0).toUpperCase() + this.slice(1);
}

and use it like this:

'string'.capitalizeFirstLetter() // String

Thanks [WayBackHutch Moore and [WayBackDeviljho for answering at [WayBackHow do I make the first letter of a string uppercase in JavaScript? – Stack Overflow!

Note you can do it in CSS too as explained by [WayBacksam6ber:

In CSS:

p:first-letter {
    text-transform:capitalize;
}

–jeroen

Posted in CSS, Development, JavaScript/ECMAScript, Scripting, Software Development, Web Development | Leave a Comment »