Removing Artifacts from Nexus using Curl

Curl is awesome for getting things done. Whether it’s downloading files, spamming the local library’s website or simply messing around you can rest assured Curl has a use.

Have you ever uploaded an artifact to your Nexus repository and immediately grimaced as the realization that you’ve uploaded [the wrong file|to the incorrect path|it’s a picture of your car] washed over you? Well fear no more! Here’s a handy Curl command to add to your bag of tricks.

curl --request DELETE --write "%{http_code} %{url_effective}\\n" --user <user>:<password> --output /dev/null --silent <URL>

This does as it implies. It delete the resource out of Nexus. Poof! Gone. Vanished.

Problem? Solved.

Running Liferay on Docker inside OpenShift

I can only imagine your plight if you’ve landed up here.

So, you’re trying to run the latest version of Liferay DXP 7.0 inside a Docker container which is managed within an OpenShift containerized environment deployed on top of Amazon AWS 🙂

Oh what fun!

Well, this is what I’ve been working on for some time now and I reckon I’ve about got it down just right.

I’ve created my own Dockerfile that builds up a DXP container that’s able to adapt to any environment. It is driven by parameters which are passed through from the OpenShift deployment configuration.

Features include:-

  • Ability to change the database type, URL, credentials.
  • Ability to work behind a Reverse Proxy.
  • Ability to configure SAML integration.
  • Ability to define a list of authorised IP addresses for JSON API access.

I’ve also configured an external mount (OpenShift Persistent Volume) for Liferay Advanced File Store. Additionally, it’s linked to OpenShift’s Elastic Search instance.

I’ll get down to documenting the process some time real soon.

Ping me if you have any pressing concerns.

Changing WSO2 Identity Server’s Default HTTPS Port

My day job currently has me playing with WSO2’s Identity Server. In very simple terms, Identity Server is used for identity and Entitlement management across applications within an environment. It’s quite a comprehensive product and is worth a look if you need to solve problems related to authentication, authorization, provisioning etc within your organisation.

By default Identity Server starts up on the HTTPS protocol and runs on port 9443. No problems there. However, the standard HTTPS port is 443 so it is very conceivable that you may want to change it to run on the standard port.

Fortunately for us, Identity Server runs inside Tomcat so it’s simply a matter of configuring Tomcat accordingly.

To do this, find the catalina-server.xml file that’s contained inside the Identity Server distribution. It is located in the <WSO2-IS-HOME>/repository/conf/tomcat/ directory.

Locate the connector for port 9443. It should look similar to the below XML snippet.

.....
port="9443"
bindOnInit="false"
sslProtocol="TLS"
sslEnabledProtocols="TLSv1,TLSv1.1,TLSv1.2"
server="WSO2 Carbon Server"
clientAuth="want"
.....

Update the connector to look as follows.

.....
port="443"
bindOnInit="false"
sslProtocol="TLS"
sslEnabledProtocols="TLSv1,TLSv1.1,TLSv1.2"
server="WSO2 Carbon Server"
clientAuth="want"
.....

Notice that all we’ve done is change the port value from 9443 to 443. That’s it! Job done. Now you can access Identity Server using HTTPS without needing to specify a port number in the URL.

PS: This was tested on Identity Server version 5.1.0.

How to enable the administrator account in Windows

I found myself doing some end user PC maintenance this afternoon and came across a scenario that required me to access Windows’ built in administrator account. However, the laptop I was working on didn’t have this account enabled so I needed to find a way to enable it.

It’s quite simple so I thought I’d share it.

To enable the administrator account simply type in the following command in the command prompt window.

net user administrator /active:yes

Obviously to deactivate the administrator account you can make use of the same command except with no instead of yes. It will look like this

net user administrator /active:no

Note that you cannot disable the administrator account while you’re logged into the administrator account. You will need to deactivate it while logged into another user account.

This was tested on Windows 7 but should work on all recent versions.

Have fun.

Setting Your Eclipse VM

It happens from time to time that an Eclipse-based IDE might need to use a version of Java other than the one on your classpath. It’s pretty simple to set this up in your eclipse.ini file – or whichever configuration file your specific Eclipse-based IDE may use.

Here’s what you need to have as the first line in your config file –

-vm 
D:/Java/jdk1.6.0_13/bin/javaw.exe

And that’s it!

Enjoy.