Juha Palomäki

Latest blog entries

  1. Fixing invalid SamAccountName in Azure AD Domain Services

    Azure AD user had been initially created with a typo on his name. All the attributes had since then been fixed or so it looked like.

    Everything else worked fine, but this particular user could not log-on to Azure AD Domain Services connected Remote Desktop servers with his domainusername style …

  2. Using Azure.Storage module from Azure PowerShell function

    I was building a simple tool to automate some uploads to Azure Blob Storage in Azure Functions. Decided to use PowerShell for that, since well, sounds like a job for PowerShell!

    Getting the script to work on my computer was easy, getting it to work on Azure Functions.. not that …

  3. Site-to-site VPN with Meraki and Azure

    After setting up point-to-site VPNs on Azure, I thought I'd just throw in quickly also a site-to-site connection between the office Meraki MX device and the Azure VPN gateway.

    Turned out it was not so straightforward. The VPN gateway on Azure was route based, which means IKEv2. To my surprise …

  4. Ping with timestamps

    Sometimes it is handy to run ping on the background to monitor network connectivity. Combine Microsoft PowerShell and the PsPing utility from Microsoft and you get a nice logging solution with shows on each line a timestamp and the results from the ping.

    Ordinary ping:

    psping -t -i 10 server1 …
  5. Git on Windows & Github, authentication suddenly stopped working

    I'm using Github 2FA and git on Windows with the Windows Credentials store credential helper. This can be configured with
    git config --global credential.helper wincred

    Couple of times git has suddenly started complaining "remote: Repository not found" when trying to do a pull on existing project. I haven't figured …

  6. QC35, Windows, Bluetooth audio

    I started investigating pairing problems with my Bose QC35 headphone/headset and Windows. At first I was wondering why I actually see two separate QC35 devices with different icons in the pairing list. Soon I figured out the other one was "headphones" and the other one "hands-free" device. If I …

  7. Get SSL cert in PFX format using OpenSSL

    Steps for getting SSL certificate in pfx format (suitable for Azure for example)

    openssl req -new -nodes -keyout mycert.key -out mycert.csr -newkey rsa:2048
    

    Upload CSR, get the Certificate and save it local file. Get the intermediate certificates (if needed).

    Concatenate the intermedia certs to one file:

    cat …
  8. Azure, add IP address to cloud service

    Azure now supports multiple IP addresses per cloud service. This means you can for example host multiple web sites, each running in different IP address on one cloud service (1..n virtual machines).

    Right now it seems to be be possible to manage this only via the Azure PowerShell commandlets …

  9. IntellijJ IDEA: Maven home directory is invalid

    When creating a new project based on Maven archetype IntelliJ IDEA wants know certain Maven related directories. It took few minutes to figure out what IDEA actually wants here and answering wrong gives the not very informative "Maven home directory is invalid" -error message.

    The Maven home directory is the …

  10. Convert SPSS .SAV file to CSV (for Excel)

    SPSS alternative, GNU PSPP include a very easy to use tool that can convert the SPSS SAV file to CSV. This can be further read in to excel. Just open the csv file in Excel. If excel does not automatically split data, choose the first column, go to Data tab …

  11. Enable debug log in Azure Storage Emulator

    Azure Storage Emulator has logging capability but this is not enabled by default and it does not seem to be available via user interface.

    In order to enable the log,

    • Head to the Storage Emulator data directory, which is located at %LOCALAPPDATA%\DevelopmentStorage.
    • Edit the the developmentstorage configuration file located …
  12. Ubuntu, disable special effects

    I installed Ubuntu under Hyper-V and for reason the UI with all the effects is S-L-O-W.

    Quick steps for disabling the UI effects:

    sudo apt-get install compizconfig-settings-manager ccsm
    

    Then head to the effects tab and disable those that you want. This does not make the UI blazing fast, but helps …

  13. Keymapper mappings for using Apple keyboard with Windows

    I fell in love with the full size Apple keyboard. It is low profile and I really like how it works. Plus it's pretty affordable (compared to premium keyboards).

    Unfortunately by default few of the keys are out of place compared to standard PC keyboard. In order to fix this …

  14. Change SQL Server Express authentication mode

    When you install SQL Server Express you can select the authentication mode. If you want to enable SQL Server authentication mode (username and password) later on, you can use T-SQL to do it:

    ALTER LOGIN sa ENABLE;
    GO
    ALTER LOGIN sa WITH PASSWORD = '<strong password>';
    GO
    
  15. Digging Liferay article categories from database

    In order to investigate certain issues I wanted to find out the journal categories directly from database.

    Below is the select I came up with. This is for MySQL. The string operations on the second line try to extract the actual content that is inside the extra markup. It is …

  16. Write log from Liferay velocity templates

    A simple example for writing log entries from Liferay velocity templates

    #set ($logFactory = $portal.getClass().forName('com.liferay.portal.kernel.log.LogFactoryUtil'))
    #set ($log = $logFactory.getLog('myTemplate'))
    $log.info('Here we go again')
    
  17. Visio 2013 and 2016 disable rerouting

    Drop something to the drawing surface, all other shapes freak out, running away from your new shape which you just wanted to throw in the background. Sounds familiar?

    If this something you don't like, then disable connector splitting. Head to File-menu, select options. Then go to advanced and uncheck the …

  18. Disable Tomcat thread pool

    I recently ran into issues with a third party application that had certain issues with threadlocals. Namely certain parts of the application were using threadlocal to store information, but did not clean up the stored information. This information then caused issues on other part of the application. Now this certainly …

  19. Create self-signed SSL certificate for Azure

    Creating a self-signed certificate is simple - when you know the correct commands.

    First create the sertificate and private key

    makecert -r -sv example-org.pvk example-org.cer -a sha1 -n "CN=www.example.org" -pe -len 2048 -sky exchange -eku 1.3.6.1.5.5.7.3.1
    

    (specify some …

  20. Hotkeys for moving windows around screens

    I'm using multiple monitors and sometimes it would be useful to have hotkeys that would position the active window to certain place on certain screen. I took a quick look at ready made software but those did not seem to solve my specific problem.

    Luckily I found Autohotkey which allows …

  21. Windows 8 hotkeys

    Few Windows 8 hotkeys I have found useful:

    Win
    
    Goto start screen, start typing application name to search for it
    Win-X
    
    Open advanced menu from bottom-left corner of screen (you can access this by right clicking mouse on same place)
    Win-X + A
    
    Open command prompt as administrator
    Win-X + C
    
    Open …
  22. SSD encryption - How does it work?

    Quite many vendors brag about the AES-256 encryption capabilities of their SSD drives. This sounds good, everybody like to keep their data safe & secure. But how this encryption really works, what does it protected you from? Easy questions, right? Sure this is clearly documented by the vendors.

    Well.. It is …

  23. Get rid of NaN and INF values in Orbeon

    With calculations in binds it is easy to run into NaN (Not-a-Number) or INF values showing on the form.

    There are few ways to get rid of them

    • You can use if inside the calculation to prevent the calculation from running if the inputs would result in NaN or INF …
  24. Orbeon forms processsor for extracting locale from request

    A simple processor for Orbeon forms that extracts locale information from request.

    package fi.iki.juhap.xpl;
    
    import java.util.Locale;
    
    import org.dom4j.Document;
    import org.dom4j.DocumentHelper;
    import org.dom4j.Element;
    import org.orbeon.oxf.pipeline.api.ExternalContext;
    import org.orbeon.oxf.pipeline.api.PipelineContext;
    import org.orbeon …
  25. Debugging Orbeon XPL programs

    Orbeon XPL is way of describing processing flows using XML syntax. Since there is no debugger the debugging mostly happens by putting something in and looking at what comes out.

    You can always get the output from pipeline by using the "debug" attribute with processors, but reading the information from …

  26. Orbeon XPL copy values from request

    Quite often I end up in situations where I need to use a value from HTTP request (either parameter or header) inside a configuration element for another Orbeon XPL processor.

    One fairly simple way to do this is to use oxf:xslt processor as shown below:

    <p:config xmlns:p …
  27. Customizing Liferay service builder templates

    Liferay service builder code generation is based on Freemarker templates. The default templates come packaged inside the portal jar files. You can take a look at them for example in Github (note that those are from master branch - if you want to make modifications you should probably locate template files …

  28. Liferay service builder, class loader issues

    When you create a new service with Liferay service builder that system generates a whole lot of boilerplate code based on the few lines you put into the service.xml. Part of the code deals with the problem related to passing objects between different web applications.

    Think about a simple …

  29. Debugging ClassCastExceptions in Eclipse

    Working with application servers it is not uncommon to run into strange ClassCastExceptions which seem to have now reason. You are trying to cast an instance of MyModel to MyModel and yet them JVM is having issues with it.

    Experience has shown that there are two main categories for these …

  30. Using git to deploy new versions

    Simple instructions for setting up git so that you can push new versions to server from the comfort of your workstation. This is based on article by Abhijit Menon-Sen. If you need more details, take a look at that.

    This will create the home directory for the project underneath /var …

  31. Replacing multiple occurences of character in bash

    I wanted to replace multiple occurrences of underscore with single in one bash shell script. With regular expressions this is pretty simple, but by default they are not available directly in bash (using awk, sed and other tools would have obviously solved the problem). The "pure bash" solution involved turning …

  32. Transfer MongoDB collection to Windows

    A quick'n'dirty1 way for transfering MongoDB collection from Linux to Windows, using plink as the ssh client.

    If you have setup the key based authentication for SSH and are using pageant to manage the key locally, this does not prompt for password. -load null forces plink to ignore the …

  33. Install latest MongoDB in Ubuntu

    The MongoDB version available from the default Ubuntu/Debian repositories can be fairly old. Luckily it is easy to get a newer version directly from 10gen repository

    # If necessary, remove previous installation
    # sudo apt-get remove mongodb
    # Add appropriate key
    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
    # Add Repository …
  34. Apache reverse proxy on Ubuntu

    Install Apache and Enable relevant Apache proxy modules

    sudo apt-get install apache2
    sudo a2enmod proxy proxy_http
    

    Create new configuration file for the virtual host in /etc/apache2/sites-available.

    Link the created configuration file to sites-enabled. The numbers in target name are there to guarantee the files get loaded in …

  35. Ubuntu quick firewall configuration

    Quick instructions for enabling firewall on Ubuntu using Uncomplicated Firewall (ufw). The resulting rules are quite obvious. Incoming traffic is denied, except for ssh, http and https (these refer to /etc/services) and outgoing is allowed.

    These policies do not affect ICMP. Incoming ICMP remains allowed as per default ufw …

  36. MongoDB as service on Windows

    Quick install script for installing mongodb a service on Windows. Further instructions are available in official MongoDB docs.

    Download appropriate version: http://www.mongodb.org/downloads extract to your folder of choice, startup cmd.exe as Administrator and change to the MongDB folder. .. code-block:: bash

    REM -- Setup directories set mongodir …
  37. Refresh DHCP IP address in Ubuntu

    Simple steps for getting new IP address via DHCP on Ubuntu (tested on Ubuntu 11.10, running under vmware with bridged network)

    # Release existing sudo dhclient -r # Get new sudo dhclient # Restart networking sudo /etc/init.d/networking stop sudo /etc/init.d/networking start
  38. Nokia's smart future

    Resent news tell that Nokia has already in November acquired Smarterphone, A norwegian company that makes a lightweight platform that turns feature phone
    hardware into smartphone user experience. There's not that much information available about their software which used to be called "Mimiria", but it seems to play nicely with …
  39. Logging to Loggly from JBoss 5.1.0

    Loggly is a fairly new cloud base log management service. You can think about it as lightweight and hosted version of Splunk. I find it pretty interesting, especially because it provides pay-as-go licensing model which I believe suits better to SaaS business than Splunk's traditional licenses. I also love the …

  40. Nokia still loving Linux?

    Job postings are always the best way to glance to a future of company, aren't they? Maybe this reads as further evidence about the Linux future of Series 40.

    According to the posting on Monster, Nokia is looking for (Senior) Linux SW Engineer to work with their mobile phones team …

  41. Nokia bringing Linux and Qt to S40?

    Rumours are saying that Nokia's "Meltemi" project is about melting Linux and Series40 and adding some Qt magic in the process of doing it.

    As you probably know, Series 40 is currently based on Nokia's proprietary operating system. To my knowledge it is completely inhouse developed. So far this has …

  42. Red Hat OpenShift

    Red Hat is the latest company to join the big happy cloud provider family and they have interesting stuff to bring. OpenShift is a "portfolio of cloud services for deploying and managing applications in the cloud". Basically with OpenShift tools you can easily deploy for example JavaEE applications to Amazon …

  43. Work 2.0

    Think about how the cloud changed the way startups were run when we went from 20th centure Web 1.0 to Web 2.0. During the dot-com boom it was all amount of money and big hardware. Success started with $1M set of Sun hardware. Then came the cloud and …

  44. Enhanced JIRA widget for Zendesk

    Zendesk provides a very nice JIRA integration widget that allows creating JIRA cases directly from Zendesk and keeps them in sync.

    The widget however is missing some features. It only supports setting values for certain fields on the JIRA ticket. In our case this was a problem, since for certain …

  45. Cross-domain HTTP with Python

    For security and other reasons browsers put limitations on what sites you can access from the Javascript. The basic rule is: if the web page containing the script originates form mysite.com, then the script is only allowed to access mysite.com.

    New Firefox and Chrome versions allow the server …

  46. Amazon Beanstalk

    This is exactly what the world was waiting for! Amazon published Beanstalk, their first PaaS offering. Beanstalk allows customer to easily deploy standard Java web apps to AWS cloud.

    Beanstalk builds on top of Amazons existing services. The applications run on Tomcat, which itself runs on EC2 virtual machine instance …

  47. Atlassian Crowd - Zendesk integration

    In my quest to free my collegues from unnecessary passwords, I created a simple web application for integrating Zendesk to Atlassian Crowd.

    The webapp (well, it is just one JSP page actually) takes care of authenticating the users with Crowd and then passes this information to Zendesk. It also supports …

  48. New features for SWIFT Alliance v7

    Few interesting v7 related things.

    • Access installation will no longer create random Oracle instance names - very nice for cluster installations, at least on Windows platform. Previously when you installed separately on both cluster nodes, you ended up having different instance names on both nodes - which did not really work out …
  49. Theory of (web framework) evolution

    A look at the history of web frameworks and my views on where we are heading.
    1G
    It all started with cgi-bin applications that really did not separate the templating from rest of the logic.
    1.5G
    It is little bit difficult to say if the simple scripting based approach …
  50. Grouping and null values in Jasper reports

    Nulls are not created equal - except in Jasper. In somes cases you want to do grouping on the report based on some field that might also contain null values. Jasper treats these null values as equal, meaning that they go to the same group. This means you only get one …

  51. Stretching band in Jasper

    Making a band stretch according to the height of its contents is simple. First you need to have some content that is stretching, for example a text field with "stretch with overflow" property set to true.

    For the band you need to set "split type" to stretch. Also make sure …

Juha Palomäki
Projects
Categories