Install Oracle JDK with Puppet

Problem

You would like to install Oracle JDK using Puppet.

Using the puppetlabs/java module, you might get an error message such as:

Error: Java distribution oracle-jdk is not supported. at […]/init.pp:57 on node […]

Solution

Use the module puppet-jdk-oracle.

Just follow the installation instruction from the GitHub page.

Note that you might want to set the java version used to the latest available. You can find the latest version and build number from the Oracle JDK downloads page.

To get the build number, you first need to accept the terms and conditions and then check the URL of the link to download the version of the JDK you are interested in:

Also, make sure to configure the right platform: ‘x64′ for 64 bit systems and ‘i586′ for 32 bit systems.

As of 30th of April 2015, this would be the configuration for the latest JDK version on 64 bit Linux:

class { ‘jdk_oracle':

    version => ‘8’,

    version_update => ’45’,

    version_build => ’14’,

    platform => ‘x64′,

    ensure => ‘installed’,

}

MySQL ERROR 2026 (HY000): SSL connection error – Some Troubleshooting Ideas

I just spent a fair amount of time setting up MySQL replication between two servers encrypted by SSL (using MySQL 5.1.73).

I struggled with fixing a nasty error displayed only as ‘ERROR 2026 (HY000): SSL connection error‘.

In the following, I have collected a few possible strategies for resolving this error:

  • Is the password for the user on your server shorter than 36 characters?
  • Do the *.pem files on the server and client have the right file permissions?
  • Do your client and server certificates use a different COMMON NAME?
  • Have you tried a basic SSL setup with only certificate authority certificate (e.g. ca-cert.pem), server certificate (e.g. server-cert.pem) and server key (e.g. server-key.pem) (see). In theory, client certificates are not required for a basic setup.
  • Have you tested your certificates with a simple openssl HTTP server (see)?
  • Is your private key in the PKCS#1 format (file starts with ‘—–BEGIN RSA PRIVATE KEY—–‘)? (see, see)
  • Did you generate your certificates with TinyCA with the default settings?
  • Did you try connecting to the server WITHOUT using the certificate authority certificate (e.g. ca-cert.pem) BUT WITH specifying a client certificate and key?
    • mysql –ssl –ssl-cert=[client_cert] –ssl-key=[client_key] -u[ssluser] -h[server] -p[ssluser psw]
  • Is your certificate ‘simple enough’ for the MySQL SSL implementation e.g. not a chained certificate tree? (see) Or did you use a wildcard certificate (which are not supported) (see).

Good luck :)

Resources

Check if MySQL User Exists on Command Line (and in Puppet)

If you are using Linux, there is simple way to check if a user exists in MySQL:

echo `mysql -u root -p[your root password] -e ‘use mysql; SELECT user FROM user;’` | grep ‘[user name]

Executing this command will exit with return code 0 if the user exists and otherwise exit with 1.

This is very useful for building puppet scripts. The following execution will create a user if it doesn’t exist.

exec { “add user if not exist”:

unless => “echo `mysql -u root -p[psw] -e ‘use mysql; SELECT user FROM user;’` | grep ‘[username]‘”,
path => [“/bin”, “/usr/bin”],
command => “mysql -u root -p$mysql_password -e \”[Create User/Grant Rights Here]\””,
require => Service[“mysqld”],
}

Free Cloud CRM for Small Business

I had a brief look around today for Cloud-based (SaaS) CRM solutions which are free and of use for small businesses and startups.

My recommendation as of now would be to go with Podio. It’s free and offers a nice set of features and integrations.

Here is the list of all the solutions I looked at:

1. Insightly

PROS: Good integration with Gmail and other Google Services

CONS: Synchronization with Gmail contacts only available for paid accounts

2. Nimble

PROS: Good integration with various social platforms, especially for monitoring them.

CONS: Ability to synchronize contacts with Gmail only via PieSync (which starts at $5 / mo).

3. Zoho CRM

PROS: Good integration with other Zoho Services such as Email and Calendar.

CONS: No integration with LinkedIn (not that there could be much of it anyway). No Mass Emails for free account.

4. Highrise

PROS: Easy to use, focusses on the management of contacts and everything around them.

CONS: No file storage for free account.

5. Podio

PROS: Very versatile system with many other applications. Nice design.

CONS: Not very strong specific CRM features.

Further solutions I didn’t look into: Clevertim, Capsule, Odoo

Zapier

Zapier is not exactly a CRM system but it is a great service to link the various CRM systems to other systems such as an email system or various social networks. But watch out, some of the CRM services, such as Zoho CRM are marked as ‘Premium Services’ of which you can only connect a small number without incurring higher fees.

Rendering Beautiful PDF Documents with Calibre

The free software Calibre allows to convert various ebook formats (such as EPUB and MOBI) into PDF documents.

Unfortunately, the default settings of Calibre do not result in the creation of easily readable documents.

Thus, I have provided here some sample settings for a nice looking PDF output for Calibre:

  • First, import the book you would like to convert to Calibre. For this, just drag and drop the file from your file browser onto the Calibre screen.
  • Right click the book and select the option Convert Books / Convert Individually

calibre-1

  • Change the output to PDF on the top right corner of the screen
  • Go the the page ‘Page Setup’ and change all margins to 75 pt.

calibre-2-page

  •  Go the the Page ‘PDF Output’ and set the following settings:

calibre-3-pdf-output

Now you can start the conversion. Right click the book after the conversion has completed and select ‘Open containing folder’ to access the converted PDF file.

freepdf-print

Free PDF Printing for Windows without Adware

Printing from any windows application to a PDF printer is not supported in the most recent Windows versions by default.

Most free applications for this purpose which can be found through a simple Google search unfortunately often come with unwanted Malware or Adware (hello, Ask.com toolbar!).

However, there is a free and easy solution which comes bundled without any additional software:

Ghostscript + The FreePDF printer

Just download and install Ghostscript from here: heise.de.

Then, download the FreePDF printer from here: freepdfxp.de/download_de.html

freepdf

The website is in German, so I highlighted the download link in the image above.

Next time you print a document, the FreePDF printer should be available as one of the windows printers:

freepdf-printer

You then can choose whether to save the file or sent it by email (as well as choose the quality):

freepdf-print

The FreePDF/GhostScript solution might not look shiny but it certainly does the job done (and leaves your system free of any unwanted guests).

Work in Disguise: Two Strategies to Find Out If You Are Truly Taking a Break

One of the most challenging aspects of knowledge work is one that is often overlooked: much of what we call knowledge ‘work’ is actually quite fun. Think of an entrepreneur, a software developer who likes to write code, think of a manager who likes to see her objects develop in fruitful ways, think of a teacher who likes to teach!

I myself like very many aspects of the tasks that occupy me at present. However, as difficult as it is for me to acknowledge, if I take a good, pure break; a break in which I am not in the least worried about the pursuit of my current professional passions, then, on my return back to work, I feel very positive and productive. In fact, many of my best ideas come to me right after a break or within a break.

However, the question arises what exactly makes up this good, pure break. What does it mean for me to be not working – not working at all? Since there are many other ‘projects’, which I pursue with great pleasure but which effectively could also be characterized as knowledge ‘work’.

To identify which activities are ‘work in disguise’ and therefore do not qualify to be part of a good, pure break, I came up with the following strategies:

Useful Tests

The useful test is relatively easy to apply. For the activity in question, ask yourself whether you would deem it useful in the general scheme of things. Will this help you to advance your career? Will it help you to become a better person? Will it earn you money now or in the future? If you can answer any of these questions with yes or if the activity is useful in any other way, then it does not pass the Useful Test and thus it should be carefully considered to be part of a good and honest ‘pure’ break.

Self Observation

The second strategy is a bit trickier to apply. This strategy entails to reflect upon how you worked AFTER pursuing the activity in question; where ‘after’ does not have to mean in direct succession; it could be the next day or a couple of hours later. The key point is not to look at how you feel during or directly after the activity. Instead, look at how effectively you work when you pick up on your main work again. In particular, focus on how easy the work feels to you: Do you have to drag yourself to get started, or does the work literally pull you in with the warm embrace of optimistic confidence? If the former is the case, the activity in question might not be well-suited for a healthy break.

Is this a strange problem to have: Being in danger to work too much and too often? My observation of the world tells me that not everybody is haunted by this very problem. However, I would expect there is many a founder/student/researcher/programmer/artist out there who is being less productive and happy because of wanting to work too much and, more importantly, because of the inability to relax truly and guilt free. Take some time off and enjoy the fruits of your non-work in form of a clearer mind, a more positive attitude and more creative ideas when you need them.