Saturday, September 29, 2012

red-bean: the Open Source Development with CVS, 3rd Edition


An excerpt of the TOC of the HTML version of the book:
An Overview of CVS
** Branches

The PDF has a nice, printable 4-pages quick reference card ("CVS Commands") at the end.

Friday, September 28, 2012

Thursday, September 27, 2012

how to reach the usual "alt-..." keyboard bindings with an emacs from emacsformacosx

GNU Emacs For Mac OS X – this is the emacs, I am referring to here.

OS X and emacs use the "alt" key differently, so how do I achieve on OS X within emacs what I usually achieve with "alt", like entering "[" through alt-5?

I sacrificed the right "alt" key to work the Mac OS X way (by setting ns-right-alternate-modifier to none), and the left "alt" key to work the emacs way.

Enter this within your emacs (from emacsformacosx.com) on OS X:

M-x customize-group ns


bdecaf
 suggested that in a thread on stackoverflow.com [Link].


Now I can enter "[" on my Austrian/German Mac keyboard through (right) alt-5.

I had waited far to long, before thoroughly investigating this.

Wednesday, September 26, 2012

SIGSTP: Understanding Unicode and UTF8 in Perl

SIGSTP: Understanding Unicode and UTF8 in Perl

chromatic's book "Modern Perl"

Q: Where to download from? A: [Link]

Table of Contents

  • Unicode and Strings [Link]
  • Moose [Link]
  • Testing [Link]
  • POD [Link]
  • transforming a main program into a module, so that we can test also it local subroutines separately [handling main], [controlled execution] –– I call this "main à la Python"

O'Reilly Media book: Advanced Perl Programming, 2nd Edition

Advanced Perl Programming, 2nd Edition - O'Reilly Media


Just put the 1st paperback edition on top of the batch going to the charitable book collection.

From the TOC:

  • Chapter 8: Testing; with a subchapter on "Keeping Tests and Code Together" within POD sections of the source code

O'Reilly Media book: TCP/IP Network Administration, 3rd Edition

TCP/IP Network Administration, 3rd Edition - O'Reilly Media

"Of course" it's not covering IPv6.

Just put the 2nd paperback edition on top of the batch going to the charitable book collection.

O'Reilly Media book: IPv6 Network Administration

IPv6 Network Administration - O'Reilly Media

Monday, September 24, 2012

O'Reilly Media book: Perl Testing: A Developer's Notebook


Perl Testing: A Developer's Notebook - O'Reilly Media

Is there any sexier topic in software development than software testing? That is, besides game programming, 3D graphics, audio, high-performance clustering, cool websites, et cetera? Okay, so software testing is low on the list. And that's unfortunate, because good software testing can increase your productivity, improve your designs, raise your quality, ease your maintenance burdens, and help to satisfy your customers, coworkers, and managers. […]

In chapter 7 ("Testing Web Sites") the book has a rather nice example on recording a web-surfing session, that creates a perl script to replay that session: "Record and Play Back Browsing Sessions". But  they say, there is trouble with HTTP::Recorder as of the time of writing of that book – and it still does not really work for me. How bad. Nice but unusable.

chromatic in "Modern Perl" on Moose

Objects (Modern Perl 2011-2012)

dpunkt.verlag : Basiswissen Softwaretest

dpunkt.verlag :: Basiswissen Softwaretest - Aus- und Weiterbildung zum Certified Tester – Foundation Level nach ISTQB-Standard

chromatic in "Modern Perl" on Testing

Managing Real Programs (Modern Perl 2011-2012)

Sunday, September 23, 2012

O'Reilly Media book: MapReduce Design Patterns

MapReduce Design Patterns:

This handy guide brings together a unique collection of valuable MapReduce patterns that will save you time and effort regardless of the domain, language, or development framework you’re using. Each pattern is explained in context, with pitfalls and caveats clearly identified—so you can avoid some of the common design mistakes when modeling your Big Data architecture.

Friday, September 21, 2012

using foolabs' pdfinfo for extracting the creation date from PDF files

Xpdf: Ports & Tools

They don't list pdfinfo there, but it is a part of their open source tool set. It's a companion tool to xpdf and pdftohtml.

I like to use the creation date (or last modification date) of (external) documents as the leading part of their file names on my computers.

I use pdfinfo for extracting CreationDate and ModDate from PDF files:

$ pdfinfo …
$ pdfinfo -rawdates …

Of course I like the raw dates better for this purpose than the "human readable" ones.
BTW: The raw date look a little like they are UCT or GMT, but they apparently aren't.

So far I have not created a wrapper script around it, as I am not really using this utility often enough – but sooner or later …

Thursday, September 20, 2012

ssh-ing from OS X into a Linux on a local VM (VirtualBox)


  • for the specific virtual machine: Network Adapters / Port Forwarding / add a rule like "Protocol=>TCP, Host Port=>2222, Guest Port=>22, leave the IP addresses blank!"; the VirtualBox help system opens a nice and very instructive PDF manual, that really made me feel comfortable with this
  • this way you should actually be able to "ssh -p 2222 localhost" on the host machine
  • in my case this failed, complaining like this: "port 2222: Connection refused"
  • it took me a while to reason, whether the guest OS really has an ethernet / LAN interface configured – and there wasn't any such active interface – TBD
To be continued …

Update 2013-02-26:
"Bridged networking" looks superior to NAT, as things work far more easily – you don't need to forwards ports (e.g. SSH), you can simply talk to the VM guests. I couldn't get Samba working with NAT's port forwarding, but with bridged networking "it's just there" (what a joy!!!), and you can also have "natural" communication amongst the guests. Imagine: an Oracle DB within some VM …

Wednesday, September 19, 2012

problems talking to a web-site through https, actually an SSL / TLS issue

May I point you to my updated article [Link]?

my Lego Ninjago links

son#2's current favorite toys …
to be continued resp. updated.

is there such a thing as a silent subscription" to a "majordomo" driven mailing list?




I would love to stay subscribed and be able to post to a particular mailing list (I can read them elsewhere), but I don't want to receive the messages – alright, apart from the administrative ones.

from "docs" to "drive", docs.google.com to drive.google.com

I guess like many people on planet Earth, these days I received a message saying something like this:
Your 99 files stored in Google Docs are now in Google Drive
I wonder. whether they did a good job, letting all applications have access to the old paths for long enough.

Tuesday, September 18, 2012

curl hangs talking to a web-site through https – actually a TSL version issue

Solved.

Known problems (possibly) related to this:
This SSL / TLS problem seems to appear in March 2012; all the "before 2012" problems, that sound similar, are not related to this issue resp. they do not have the exact same reason.

The solution is described almost at the end down here ("Update 2012-09-19 / 1"). Skip to there, if you are in a hurry!



With my recent openSUSE upgrade / migration (from 12.1 to 12.2) came a new curl (and of course libcurl).

My bank statement scraper in Perl makes use of libcurl, and now it does no longer read the HTML for the bank's web-site.

curl and libcurl always come together, and I tried the rough equivalent of the libcurl access in question with curl on the command line:

$ curl --verbose 'https://banking.postbank.de/rai/login'
* About to connect() to banking.postbank.de port 443 (#0)
*   Trying 62.153.105.15...
* connected
* Connected to banking.postbank.de (62.153.105.15) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs/
* SSLv3, TLS handshake, Client hello (1):
* Unknown SSL protocol error in connection to banking.postbank.de:443 
* Closing connection #0
curl: (35) Unknown SSL protocol error in connection to banking.postbank.de:443 

That new curl (7.25.0) was compiled against OpenSSL/1.0.1c.

So how did I proceed in order to find the reasons for my problem?

A web page on curl.haxx.se (http://curl.haxx.se/docs/sslcerts.html) teaches me, that I should try this, in order to find out, whether the problem is with openssl resp. where it is:

$ openssl s_client -connect banking.postbank.de:443

I am quite sure, it must have worked once, so when ("with which release?") did the problem start?

Alright, I am doing a binary search on the "recent" releases of openssl:

0.9.8x, 1.0.0, 1.0.0j, 1.0.1, 1.0.1c

The latest one, that does not break my request is 1.0.0j,
the first one, that breaks my request is 1.0.1 (I skipped the betas),
and it looks like this ("SSL handshake has read 0 bytes and written ..."):


$ openssl s_client -connect banking.postbank.de:443
CONNECTED(00000003)
write:errno=104
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 321 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
---


I am posting my problem with a few more details to the "openssl-users" mailing list (see the thread on Google Groups [Link]), now I am waiting for responses.

In the meantime I am going to "brew" my own curl.
Compiling against openssl-1.0.0j, the last release, that successfully talks to that bank's web-site, fails.
Compiling against openssl-1.0.0, another release, that successfully talks to that bank's web-site, does not yet build a curl, that uses openssl-1.0.0, but instead it uses openssl-1.0.1c nevertheless.
I will keep you updated.

Update 2012-09-19 / 0:
My attempts to brew my own openssl were sort of successful. I wasn't actually quite use, which way my curl brewing would prefer:

  • $ ./config --prefix=/usr/local --openssldir=/usr/local/openssl
  • $ ./config --openssldir=/usr/local/openssl

My attempts to brew my own curl, that in turn uses my own openssl were a terrible mess.
I gave up – but only after receiving the successful hint, reported below.

I actually started with brewing openssl into /usr/local/openssl-u.v.w and curl into /usr/local/curl-x.y.z, but that did not lead to the success, that I had expected.

But then, I also did not the expect the rather quick reply from the openssl-users mailing list, that directly led to my problem fix.

Update 2012-09-19 / 1:
Dr Stephen N. Henson ("OpenSSL project core developer") gave me a rather precious hint on the openssl-users mailing list [Link]:
This is a problem with the server. OpenSSL 1.0.1 is the first release to support TLS version 1.2 and some servers "hang" when connecting. The option -no_tls1_2 or -tls1 should allow you to connect again.
I did as advised –– success:

$ openssl s_client -no_tls1_2 -connect banking.postbank.de:443
$ openssl s_client -tls1      -connect banking.postbank.de:443

curl and libcurl do have their related options in order to makes use of this:

shell $ curl --verbose --tlsv1 'https://banking.postbank.de/rai/login'

perl: $h->setopt(CURLOPT_SSLVERSION,CURL_SSLVERSION_TLSv1);

I am very relieved.

Update 2012-09-19 / 2:
Now that my problem is solved, I wonder, why curl+openssl don't negotiate the right TLS version with the https server, just as we might assume web browsers do. I guess, that's because curl and openssl are developers' tools, so people using curl and openssl are expected to be able to handle this sort of thing. Maybe you are experiencing this problem as well, now you are reading my article, and maybe this saves you a lot of time.

Sunday, September 16, 2012

O'Reilly Media book: Linux in a Nutshell

Linux in a Nutshell: Everything you need to know about Linux is right in this book. The latest edition of this popular reference offers a tighter focus on Linux system essentials, as well as more coverage of new capabilities such as wireless network management, DVD recording, and revision control with git. Linux in a Nutshell, Sixth Edition thoroughly covers programming and administration tools, editors, and the shell, and highlights the most important options for using the vast number of Linux commands.

I had bought it quite a while ago, just "on stock", never used it, but yesterday I looked up a few topics.

As a committed openSUSE user I have been using YaST for most tasks for quite a while. But now there is an ubuntu system in a VM w/o GUI, and things need to be done the command line way. Alright, there are also a few curses-based GUIs like aptitude … .

So this is what I looked up in this nice book:
  • user management; I had to add a user account for myself
  • keyboard configuration; the system was set up for a U.S. keyboard, and my keyboard has the German layout
  • package management (apt-*)
It also has a nice introduction to Git.

No Starch Press: Ubuntu Made Easy

Ubuntu Made Easy:
Ubuntu Made Easy
Full of tips, tricks, and helpful pointers, Ubuntu Made Easy is perfect for those interested in—but nervous about—switching to the Linux operating system.
read more

Monday, September 10, 2012

Saturday, September 8, 2012

plupload: completed my experiments for now

plupload: experimenting with the sample application

  • the plupload ZIP archive (available on http://plupload.com/) comes with a sample application
  • copied the contents of the ZIP file to /srv/www/htdocs/plupload/ on an openSUSE-12.1 Linux box ("HOST") – this is where my Apache2 httpd serves HOST/plupload/ resp.  HOST/plupload/examples/custom.html from
  • where does the application want to get the files uploaded to? silly me didn't have a close enough look at that for too long
  • plupload/examples/upload.php has a $targetDir for that; apparently the proper way would be to set upload_tmp_dir in the system php.ini (which is de-commented there, so that we don't get files dropped, where we don't expect them, and for as long as we don't expect them); but for our local experiments we choose the other branch and set it to our local plupload/examples/uploads/ directory (i.e. /srv/www/htdocs/plupload/uploads/) – success: it works!!!
  • we have a working application
  • the Apache log-files don't actually mention the file uploaded – that's sad, but why should I care?
which browsers and front-ends resp. front-end plugins talking to the Apache httpd work?
  • Mac OS X: Chromium 22.0.1204.0 / Firefox/16.0 / Safari (6.0 (7536.25)) together with "html5" / "flash" / "silverlight"
  • openSUSE-12.1/12.2 : Chromium 22.0.1126.0 / Firefox/15.0 together with "html5" / "flash"
  • Android 4.0.3 (on a Samsung Galaxy SII): the built-in browser (AppleWebKit/534.30) / Chrome 18.0.1025.166 (AppleWebKit/535.19) together with "html5"
  • Android 3.1 (on a Samsung Galaxy Tab 10.1): the built-in browser browser (AppleWebKit/534.13) together with "html5" / "flash"
  • WinXP (5.1.2600 Service Pack 3 Build 2600): IE8 together with "html4" / "flash" / "silverlight" ("html5" does not exist) / Chrome 22.0.1229.39 with "html5" / "html4" / "flash"
  • [now] …
  • [To Be Done] what about trying a couple of browsers on other Windows platforms?

openSUSE-12.2 : upgrading again …

  • downloading the 4.7GB DVD ISO image from a mirror – funny to watch a download rate of 1.92M/s with wget; my last installation was with the network CD, but this time I am giving the DVD installation another try, as I want to implement this upgrade on 3 boxes within a rather short time after the release of 12.2, so there should only be a few upgrades necessary and most packages will get installed from the DVD anyway
  • checking the download: sha1sum openSUSE-12.2-DVD-i586.iso
  • cutting the DVD – doing this on my Mac using Disk Utility – OS X refused to mount the DVD afterwards; but the PC booted from it (etc.) w/o complaints
  • installing 12.2 on the Eee Box
  • rcxdm failed; I removed /etc/X11/xorg.conf, after that I am able to start up rcxdm successfully; apparently /etc/X11/xorg.conf.install is also quite suitable /etc/X11/xorg.conf – it uses the screen with 1024x768 at least
  • logging into the system with ssh works as usual for root but not for my personal account – solved! they changed something in sshd_config, from now on only .ssh/authorized_keys counts
  • installing 12.2 on the NEO
  • installing 12.2 on the ASUS notebook
  • installing 12.2 on a "x86_64-suse-linux" VirtualBox VM with Mac OS X as host
  • [now] …
Of course I need these, and of course I have notes on them here on the blog:
  • $ zypper install gcc
  • $ zypper install patch
  • $ zypper install libcurl-devel
  • perl: $ perlbrew available # perl-5.16.1 (needed "--force --notest"), perl-5.14.3-RC1 (???), perl-5.14.2 (broken on my x86_64-suse-linux), … – it does not list all available ones, only the most recent ones on all major releases – here are all of them: www.cpan.org/src/5.0/ – you may want to pre-download a few of them ("$ perlbrew download perl-5.14.1"), and they go here: $PERLBREW_ROOT/dists/
  • perl: $ perlbrew install-cpanm; perlbrew install-patchperl
  • perl: migrate CPAN modules using perlbrew and cpanm (https://metacpan.org/module/perlbrew)
  • ruby: rvm