Processing Java – “WARNING: Could not open/create prefs root node”

How to get rid of the “Could not open/create prefs root node…” warning?

  • Go into your Start Menu and type regedit into the search field
  • Navigate to path HKEY_LOCAL_MACHINE\Software\JavaSoft
    (Windows 10 seems to now have this here: HKEY_LOCAL_MACHINE\Software\WOW6432Node\JavaSoft)
  • Right click on the JavaSoft folder and click on New -> Key
  • Name the new Key Prefs and everything should work

Windows – Drag and Drop stopped working

Drag and drop suddenly stops working:

“If you’re drag and drop stop working, just click on an object (a mail if it is in Outlook, a file if it is in Explorer, etc.) with left mouse button and maintain it, then strike on your escape key (on keyboard of course) and release them all.”


Windows – Enable SSL for Apache

How to enable SSL for an Apache web server?

1. Create a certificate and key, using keytool and openssl

Create a keystore (.jks) file:

keytool -genkey -alias rolf -keyalg RSA -keystore rolf.jks -keysize 2048

Create a pfx (.p12) file:

keytool -importkeystore -srckeystore rolf.jks -destkeystore rolf.p12 -deststoretype PKCS12

Start openssl and generate .key- and .crt files:

OpenSSL> pkcs12 -in rolf.p12 -nocerts -out rolf.org.key
OpenSSL> pkcs12 -in rolf.p12 -clcerts -nokeys -out rolf.crt

Remove the private keyphrase from the .key file:

OpenSSL> rsa -in rolf.org.key -out rolf.key

2. Update the httpd.conf file

Enable mod_ssl.so (uncomment the next line):

LoadModule ssl_module modules/mod_ssl.so

Include the SSL config file (add the following line):

Include conf/extra/httpd-ssl.conf

3. Update the httpd-ssl.conf file

Disable the cache:

#   Inter-Process Session Cache:
#   Configure the SSL Session Cache: First the mechanism 
#   to use and second the expiring timeout (in seconds).
#SSLSessionCache        "dbm:c:/Apache24/logs/ssl_scache"
#SSLSessionCache        "shmcb:c:/Apache24/logs/ssl_scache(512000)"
#SSLSessionCacheTimeout 300

Add the location of the .key and .crt files:

#SSLCertificateFile "c:/Apache24/conf/server.crt"
SSLCertificateFile "C:/.../apache/conf/rolf.crt"
# SSLCertificateKeyFile "c:/Apache24/conf/server.key"
SSLCertificateKeyFile "C:/.../apache/conf/rolf.key"

Disable per-server logging:

#   Per-Server Logging:
#   The home of a custom SSL log file. Use this when you want a
#   compact non-error SSL logfile on a virtual host basis.
#CustomLog "c:/Apache24/logs/ssl_request.log" \
#          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

Disable PassPhraseDialog:

#   Pass Phrase Dialog:
#   Configure the pass phrase gathering process.
#   The filtering dialog program (`builtin' is an internal
#   terminal dialog) has to provide the pass phrase on stdout.
#SSLPassPhraseDialog  builtin

4. PHP OpenSSL extension not working (TYPO3)

Activate the PHP module openssl in php.ini

extension=php_openssl.dll

Add an environment variable “OPENSSL_CONF” with value:

C:\...\apache\conf\openssl.cnf

Add to the PATH environment variable:

C:\...\apache\bin

Restart the webserver.

5. Resource

http://stackoverflow.com/questions/23754996/php-openssl-extension-not-working-while-install-typo3-6-2-2-on-window7


Windows – Symbolic links

How to create a Symbolic Link in Windows 7?

Open the command prompt and type:

C:\Copy>mklink /D stuff "C:\Users\rvgelder\Desktop\my stuff\stuff"
symbolic link created for stuff <<===>> C:\Users\rvgelder\Desktop\my stuff\stuff

This creates a symbolic link in the C:\Copy directory pointing at a folder named ‘my stuff\stuff’, located at the desktop.

How to remove a Symbolic Link?

rmdir stuff

Processing Android – Signing an Android app

How to sign an Android app, generated with Processing Android (or generated with another tool)?

Create a (Windows-) batch file (.bat) with the following code:

@echo off
ECHO.
set /p varSketchName="Please enter the Name of your sketch: "
ECHO.
set /p varSketchAlias="Please enter an Alias for your sketch: "
ECHO.
ECHO [KEYTOOL]
keytool -genkey -v -keystore %~dp0%varSketchName%-release-key.keystore -alias %varSketchAlias% -keyalg RSA -keysize 2048 -validity 10000
pause
ECHO [ANT RELEASE]
call ant release
pause
ECHO [JARSIGNER]
call jarsigner -verbose -keystore %~dp0%varSketchName%-release-key.keystore %~dp0bin\%varSketchName%-release-unsigned.apk %varSketchAlias%
pause
ECHO [JARSIGNER VERIFY]
call jarsigner -verify %~dp0bin\%varSketchName%-release-unsigned.apk
pause
ECHO [ZIPALIGN]
set /p varSignedAppName="Please enter name for final signed apk (w/o .apk extension): "
call zipalign -v 4 %~dp0bin\%varSketchName%-release-unsigned.apk %~dp0%varSignedAppName%.apk

Programs you need:

  • keytool.exe (part of the Java JDK)
  • ant.bat (part of Apache ant)
  • jarsigner.exe (part of the Java JDK)
  • zipalign.exe (part of the Android SDK)

Steps:

  1. In Processing: create your sketch in Android Mode
  2. Export the sketch as an Android Project (Ctrl-Shift-E)
  3. Copy the .bat-file above to the newly created android directory and run it
  4. Name of your sketch = name of the .pde-file (without .pde!)
  5. Alias = same as the name (or something else)
  6. Enter a password for your keystore
  7. Enter your personal data
  8. Enter the same keystore password again
  9. Enter the name of the final .apk-file (without the .apk extension!)

N.B. Make sure your folder names DON’T include any SPACES! That will break the batch file.

And there you go! You’ve got a signed .apk file!