24. July 2014

couriertls: /etc/courier/esmtpd.pem: error:0906D06C:PEM routines:PEM_read_bio:no start line

After upgrade of Linux distribution Courier stopped to accept emails delivered over TLS or SSL.

There was just nice error message in the log file:

couriertls: /etc/courier/esmtpd.pem: error:0906D06C:PEM routines:PEM_read_bio:no start line

Long story short. The problem was in pem file.

Previous versions of Courier-SSL were able to read files with Windows EOL. The new version is failing with this nice error.

Solution is simple: get rid of Windos EOL.

You can use e.g. dos2unix

dos2unix esmptd.pem

Restart services and everything will work :)

6. July 2014

SimpleHTTPServer in Python 3.x

One very cool feature of Python 2.x is instant web server. You can type following command and Python will start simple http server.

python -m SimpleHTTPServer

This command does not work in Python 3.x. The reason is that SimpleHTTPServer was merged to http.server module.

Correct command for Python 3.x is:

python -m http.server

23. June 2014

How to debug Gradle script

First of all: do not use daemon mode for debugging.

IntelliJ Idea is automatically spawning daemon when you start any Gradle task. You have to attach to remote process.

I wrote small “How to debug” based on info from forums.gradle.org.

You’ll need to set GRADLE_OPTS environment variable to:

-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005

Here is example in PowerShell:

01-command-line-options

$env:GRADLE_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"

Configure Remote debugging in Idea:

02-configure-remote

You do not need to change anything in default configuration.

Now return to command line with your project and invoke task. Gradle will automatically stop and it waits for debugger.

03-start-process

Attach debugger

04-attach-to-process

Here we go :-)

05-break-point

There is small limitation. You can stop code execution outside DSL e.g. in class method (line 3). You won’t be able to stop execution in Gradle DSL line 10.

You can download sample build script from Github.

13. June 2014

Gradle Summit 2014 Lightning talk: Bamboo + Gradle

I had an opportunity to be one of Lightning talks speakers at Gradle Summit 2014 in Santa Clara – California.

I’d like to share with you slides from my talk about Bamboo and Gradle integration which we successfully deployed in Y Soft.

Link to Speaker Deck

It was exciting to hear about experience with Gradle from other speakers from companies like Netflix, Prezi or JFrog.

28. May 2014

Book review: Visual Studio 2013 Cookbook

Visual Studio 2013 is a huge technological leap forward. The book Visual Studio 2013 Cookbook helps to get on track with latest features including enhanced support for JavaScript and C++.visual-studio-2013-cookbook

Software projects often combine many different technologies like C++, .NET or JavaScript. Professional developer must be aware of all these technologies. The book is a great source of essential information which helps developer to grasp important concepts implemented in Visual Studio.

Cookbook provides short and easy to understand chapters about wide range of features. Each chapter contains some links to web sites or related technologies.

I recommend to read the book one chapter a day. Learn new stuff, experiment with it and next day continue with next chapter.

What you can find inside the book? Here is selection of some interesting topics

Chapter 1: Discovering Visual Studio 2013

  • contains productive tips how to use Visual Studio in effective way (keyboard shortcuts, navigation in project)

Chapter 2: Getting Started with Windows Store Application

  • good starting point for building own application for Windows Store
  • introduction to analysiss of application performance

Chapter 3: Web development

  • learn how to work with Bootstrap
  • minification of JavaScript and CSS

Chapter 4: .NET 4.5.1 Development

  • unit testing of .Net apps
  • managing packages with NuGet

Chapter 5: Debugging .NET Application

  • debugging with IntelliTrace
  • debugging parallel code

Chapter 6: Asynchrony in .NET

  • introduction to popular way of programming applications
  • integration of async concepts with web applications

Chapter 7: Unwrapping C++ Development

  • C++ is still very popular and Visual Studio 2013 introduces several concepts known in .NET or JavaScript
  • Native Unit Test Project for C++
  • graphics programming – 3D, DGSL and diagnostics

Chapter 8: Working with Team Foundation Server

  • getting feedback from users
  • git integration

Chapter 9: Languages

  • highly improved integration with further languages like TypeScript or Python
  • Python support is simply awesome

Visual Studio 2013 Cookbook is available at Packt Publishing store.

28. April 2014

Gradle and build systems for C language – slides


Slides available in formats: PDFSlideShare

Source code: GitHub/georgik

10. April 2014

PowerShell in Terminal of IntelliJ Idea

IntelliJ Idea has neat feature – Terminal Window.

Unfortunately on Windows it’s set just to old school cmd. Good news is that it’s possible to change it to something better. E.g. PowerShell.

Go to project settings, type “terminal”. Change value in Shell path to powershell.exe.

intellij-idea-powershell

Then you can invoke Terminal:

idea-terminal

Note: If you’re using 32bit version of Idea then it will open 32bit version of PowerShell. This is important when you want to change Set-ExecutionPolicy. 32bit and 64bit PowerShell have two different settings.

10. April 2014

Debian Heartbleed openssl bug remains even after upgrade of openssl package

If you’re using Debian and you want to get rid of Hearbleed bug then it’s not sufficient to upgrade openssl package.

The really important package is libssl1.0.0:

apt-get install libssl1.0.0

It will restart all services which depends on this package.

4. April 2014

Debian – Tomcat 7 is not serving https after upgrade

I made upgrade of Tomcat7 server on Linux Debian.

Tomcat stopped serving https. Port was open, no strange message in log, but it was not possible to connect from browser.

Here is configuration of https connector:

Connector port="8443" SSLEnabled="true" 
 protocol="org.apache.coyote.http11.Http11Protocol"
 maxThreads="150" scheme="https" secure="true"
 clientAuth="false" sslProtocol="TLSv1"

Long story short. Old version of Tomcat7 was using keystore from file /etc/tomcat7/keystore, but new version expects /etc/tomcat7/keystore.jks.

Simple fix:

cd /etc/tomcat7
ln -s keystore keystore.jks

Restart Tomcat. :-)

22. March 2014

Kivy – buildozer android debug failed with libstdc++.so.6: cannot open shared object file

Kivy is awesome library for developing GUI applications in Python.

It’s possible to build same application for desktop, Android or iOS. It’s something like Cordova/PhoneGap for JavaScript.

I was following Kivy crash course 2: Building an android apk tutorial recorded by Alexander Taylor.

I was trying to build application on Linux Debian for Android:

buildozer android debug

Build failed with quite strange message:

[mergemanifest] Manifest merger disabled. Using project manifest only.
     [echo] Handling aidl files...
     [aidl] Found 1 AIDL files.
     [aidl] Compiling 1 AIDL files.
     [aidl] /home/georgik/.buildozer/android/platform/android-sdk-21/platform-tools/aidl: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

BUILD FAILED

assets/private.mp3: /home/georgik/idea/kivytest/.buildozer/android/app/sitecustomize.pyo
Traceback (most recent call last):
  File "build.py", line 431, in 
    make_package(args)
  File "build.py", line 346, in make_package
    subprocess.check_call([ANT, arg])
  File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ant', 'debug']' returned non-zero exit status 1

The reason of this problem is not so obvious.

My operating system is 64bit, but Android build system requires 32 bit version of stdc++ library.

Fix is very easy. Just install lib32stdc++6 package :-)

apt-get install lib32stdc++6

If build is still failing, because of other missing libraries, then you can use online Debian package search to find missing dependencies: https://www.debian.org/distrib/packages

Other missing 32bit libraries are often libz, libncurses5:

apt-get install lib32z1 lib32ncurses5
  • Babel fish

      Translate from:

      Translate to:

  • Where’s the fish?

  • Further info

  • Twitter

    Follow @jurajmichalek on twitter.

  • Badges

  • Learning

    lynda.com online training tutorials
  • Tags

  • Topics

  • Comments