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

Archive for January, 2014

praliases: the reverse of makemap generates an aliases text file out of aliases.db files

Posted by jpluimers on 2014/01/25

In case you want to inspect any of your aliases.db files, use praliases: the reverse of makemap to get an aliases text file.

Plus you don’t have to remember the makemap options.

Use the -f option to dump a specific db file:

snap:/etc/mail # praliases -f /etc/aliases.db

–jeroen

Posted in *nix, Linux, Power User, SuSE Linux | Leave a Comment »

Beveiligde gedeelte internetsite Belastingdienst: Makkelijker kan @BDzakelijk hiet niet maken…

Posted by jpluimers on 2014/01/25

Even lachen om de eisen van een nieuw zakelijk belastingdienst wachtwoord:

Uw wachtwoord moet:

  • anders zijn dan uw vorige wachtwoorden
  • minstens 3 karakters bevatten die niet in het wachtwoord voorkwamen dat u van ons hebt ontvangen
  • minstens 6 karakters lang zijn
  • niet meer dan 3 dezelfde karakters bevatten
  • minstens 3 letters bevatten
  • minstens 1 cijfer bevatten

Ofwel:

  1. het mag niet te complex (want dan krijg je herhalingen)
  2. het mag niet te makkelijk

Je komt daarmee uit richting een relatief kort en moeilijk te onthouden wachtwoord. Wat dan vast ergens genoteerd wordt en dus automatisch minder veilig is.

Iets als “WatWasDitEenGoedeUserExperience” kan dus niet (meer dan 3 keer een “e”)…

En dan komt daarna natuurlijk de password reset optie. Waar je “dus” niet je eigen controlevraag mag invullen, maar moet kiezen uit voor gedefinieerde vragen.

Controlevraag en antwoord opgegeven

Kies nu een controlevraag en antwoord. Bewaar uw controlevraag en antwoord goed. Hiermee kunt u zelf uw gebruikersnaam en/of wachtwoord achterhalen als u die later vergeten bent.


<select name="vraag"><option value="1" selected="selected">Initiële wachtwoord op de uitnodigingsbrief van de Belastingdienst</option>
<option value="2">Klantnummer van uw onderneming bij uw energiebedrijf</option>
<option value="3">Verloopdatum rijbewijs (dd-mm-jjjj) hoofdverantwoordelijke aangiften</option>
<option value="4">Pasnummer privé-bankpas van de hoofdverantwoordelijke aangiften</option></select>

De default is niet handig: stel je voor dat iemand de brief onder ogen krijgt. En de andere antwoorden zijn ofwel op te zoeken, ofwel met wat social engineering te achterhalen. Niet veilig.

De tekst boven de keuze suggereert dat je de informatie moet bewaren. Wat meestal een minder goede beveiliging oplevert, juist omdat bewaren (vaak op papier) vrijwel altijd impliceert dat ook anderen die informatie ooit te zien kunnen krijgen.

–jeroen

via: Beveiligde gedeelte internetsite Belastingdienst.

Posted in Usability, User Experience (ux) | Leave a Comment »

Happy 30th birthday Mac!

Posted by jpluimers on 2014/01/24

Being away from a computer sometimes means you forget about events.

So before I forget: happy 30th birthday Mac!

For me, real programming started 31 years ago on an Apple II at high school, soon followed by a II+ and a //e. At first, I was programming in both Integer Basic and AppleSoft Basic, then with Apple Pascal (which was based on UCSD Pascal, but way too slow), and finally with Turbo Pascal 1.0 (after they installed a Microsoft Z-80 softcard in a few of the machines which allowed it to run CP/M).

Back then me, nor my parents could afford a computer like a Mac, but I was lucky enough to keep on people at the “close by” (30 minutes by bicycle) University to use one and program in hyper card and various Pascal dialects (and later Delphi).

Now I own a few Macs (most more portable than the //c) bought a //e and //c last summer and collecting some extension cards to make life easier.

Just look at the B&N magazine rack how popular the Apple stuff is today:

image

So again: happy 30th birthday Mac!

Without you, I wouldn’t be a software developer.

–jeroen

via: Apple bracht eerste Mac-computer 30 jaar geleden uit – Computer – Nieuws – Tweakers.

Posted in //e, Apple, Apple Pascal, Delphi, Development, 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, Object Pascal, OS X 10.8 Mountain Lion, OS X 10.9 Mavericks, Pascal, Power User, Software Development, Think Pascal, Turbo Pascal, UCSD Pascal | 1 Comment »

Mac function keys (F1-F12) in remote desktop (Windows RDP/MSTSC) – MacRumors Forums

Posted by jpluimers on 2014/01/24

The F keys on a Mac still perform the Mac OS X specific function, even in a full screen RDP session, but you can get their Windows functionality back with ease as MacRumors user blindzombie shows:

I got it to work with fn – command – F9

or just command – F9 if you set your keyboard preferences to use F1, F2, etc as standard function key

–jeroen

via function keys (F1-F12) in remote desktop – MacRumors Forums.

Posted in Apple, Keyboards and Keyboard Shortcuts, 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-Air, OS X 10.8 Mountain Lion, Power User, Remote Desktop Protocol/MSTSC/Terminal Services, Windows | Leave a Comment »

Generate HTML Tables Clean and Fast

Posted by jpluimers on 2014/01/23

I wish I had found about Generate HTML Tables Clean and Fast years ago.

Every once in a while I want to generate the source code for an HTML table with some content easily.

I’ve found no tool doing this in an easy manner and starts in a split second.

But the web page Generate HTML Tables Clean and Fast does.

Correction: did. It is now off-line, but the Blended Technologies » Blog Archive  blog posts about it are still online: Introducing TableGen – The HTML Table Generator and Tablegen Goes Open Source, as is the WayBack machine archive for it.

So I installed Python on my openSUSE server according to Embedding Python In Apache2 With mod_python (… OpenSUSE) | HowtoForge, (could as well have configured in httpd.conf in stead of python.conf: no difference between installing mod_python via httpd.conf and conf.d in apache) then installed the TableGen source there.

(Note: more python.conf examples)

That would still have Python generate a 404 error (uncool: a python generated 404 error does not leave a log of the cause anywhere), not because the index.py was absent, but because it was written in old style “print” statements, not using the new style def index(req); way (thanks Senthil Kumaran, and AJ. for your answer).

So I did some research (this was my first encounter with Python) at for instance Paul Osman : Introduction to mod_python, then rewrote the print parts of the script into string concatenations, then return the full HTML.

(Note: if there is a print "Content-Type: text/html" (for instance demonstrated in Hello World | Web Python), you can omit it, or set the req.content_type like req.content_type = 'text/html' which usually is determined automatically by Python).

That caused quite a few IndentationError: expected an indented block quote errors: python is indentation sensitive (I hadn’t used a language depending on that for ages), and gives a confusing error when you have a colon (:) followed by an unindented docstringPython: I’m getting an ‘indented block’ error on the last 3 quotes (“””).

Then it still didn’t completely work: the form parameters would not be obtained correctly, so I read further, found 3.1 A Quick Start with the Publisher Handler and started to fix that too. That took way too long, so I found out that “mod_python” is not very much maintained any more and “mod_wsgi” is the way to go.

So I disabled the “python” module in YaST2, removed “/etc/apache2/conf.d/python.conf”, then installed the “apache2-mod_wsgi” software package in YaST2, then added the “wsgi” module to HTTP Server Configuration list of Server Modules (it automatically gets enabled) and saved the configuration.

These steps modified the APACHE_MODULES in /etc/sysconfig/apache2, restarted apache with “rcapache2 restart”. You can verify with “httpd2 -M” which modules are loaded. The list should exclude “python_module (shared)” and includes “wsgi_module (shared)”.

Most of this is described in has anyone gotten mod_wsgi working.

Python is whitespace sensitive, but you can have multiple statements on one line. That’s why Python allows semicolons after each statement.

Read Setting up Python with WSGI on Apache for a directory – Stack Overflow.

Read PyCon Conference Slides – Sydney 2010 – Python WSGI adapter module for Apache.

Read Graham Dumpleton: Why are you using embedded mode of mod_wsgi?.

Read Serving Python scripts with Apache mod_wsgi, part I | Leave No Bit Unturned.

Read Parsing the Request – Get | Web Python.

Watch WSGI Tutorial. It explains a lot, including Accessing POST Data from WSGI.

Error “Attempt to invoke directory as WSGI application” -> you cannot do that, there is no way to map a directory to an “index.py” in that directory.

For importing .py files from the same directory as your main .py file:

    import os
    import sys

    directory = os.path.dirname(__file__)
    sys.path.insert(0, directory)

    from webutils import *

Start using The Web framework for perfectionists with deadlines | Django.

A few really cool things about this page:

  • It is a web page, so easy to reach
  • It starts fast
  • You can increase the column/row count without loosing the entered data
    (as it stores the contents as a URL)
  • It can generate a thead for you
    (but not a tfoot)

Generating something like this was a breeze: Read the rest of this entry »

Posted in *nix, Apache2, Development, HTML, Linux, openSuSE, Power User, Software Development, SuSE Linux, Tumbleweed, Web Development | Leave a Comment »

On “Bad Habits to Kick : Using AS instead of = for column aliases” (via: Aaron Bertrand)

Posted by jpluimers on 2014/01/22

A while ago, I came across an interesting post Bad Habits to Kick : Using AS instead of = for column aliases by Aaron Bertrand, a major contributor on SQLblog.com – The SQL Server blog spot on the web.

The last link indicates my problem with this “AS” versus “=”: it is SQL Server specific.

So, if you mainly use SQL Server, then it is OK (or even preferable) to use “=” for aliasing columns in human written SQL as it makes spotting the names used much easier. Read the rest of this entry »

Posted in Access, Database Development, DB2, Development, Firebird, InterBase, MySQL, OracleDB, Paradox, PostgreSQL, SQL, SQL Server, Sybase | Leave a Comment »

Faking num lock, caps lock and scroll lock leds – About My Code

Posted by jpluimers on 2014/01/21

I remember doing this in DOS ages ago (in the Turbo Pascal 5 era) for exactly the same reason: flash the keyboard LEDs to indicate some event was happening, but I’ve yet to find back the source code.

Here is how to do it in Windows using either C# or C: Faking num lock, caps lock and scroll lock leds – About My Code.

–jeroen

via: c# – Way to turn on keyboard’s caps-lock light without actually turning on caps-lock? – Stack Overflow.

Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, C++, Development, Pascal, Software Development, Turbo Pascal | Leave a Comment »

How to identify MacBook models (regular, Air, Retina)

Posted by jpluimers on 2014/01/20

For finding the ModelId of your MacBook, in case you want to buy an OWC SSD upgrade:

–jeroen

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

Google 2 factor authorization: “The code you entered didn’t verify. Learn more Tip: codes are time-dependent…”

Posted by jpluimers on 2014/01/18

Not sure what went wrong, but I could not use 2 factor authentication, but somehow the codes generated by the Google Authenticator didn’t work at all. When entering the codes, I got this message:

“The code you entered didn’t verify. Learn more Tip: codes are time-dependent. Make sure your phone is set to the correct local time.”

Of course both devices were having the same time, were in the same time zone, etc.

The “codes are time-dependent” – Google Search got me on the right track.

The fix was the second steps from this article (I updated the steps as some of the UI changed): Read the rest of this entry »

Posted in Google, GoogleAuthenticator, Power User | Tagged: , , | Leave a Comment »

SoftPerfect Network Scanner: fast and free network scanner

Posted by jpluimers on 2014/01/17

On my list of things to try: SoftPerfect Network Scanner: fast and free network scanner.

–jeroen

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