Skip to main content

Posts

How to connect to Heroku rendezvous url with openssl

In this post we are looking into how to run a command on a heroku one-off dyno with curl and consume the rendezvous url over tcp. Running a command If you are familiar with the heroku API, you know that you can easily query it from the shell with curl . For example, in order to run a rake task, you can do something like this: # $1 is your heroku app name, $2 is the command curl -H "Authorization: Bearer ${HEROKU_OAUTH_TOKEN}" \ -H "Accept: application/vnd.heroku+json; version=3" \ -H "Content-Type: application/json" \ -d "{\"attach\": true, \"command\" : \"$2\", \"type\" : \"run\"}" \ " https://api.heroku.com/apps/ $1 /dynos Heroku API will return you a json object that contains a rendezvous URL. { "attach_url" : "rendezvous://rendezvous.runtime.heroku.com:5000/<secret>" ... } Connecting to the rendezvous url One
Recent posts

Ubuntu Ldap auth with an OpenDJ server

In this post we will show how to use OpenDJ ldap server to authenticate user on an ubuntu workstation. OpenDJ setup I will assume that you already have an OpenDJ server running. If not please, have a look at the OpenDJ instalation guide . PosixAccount and posixGroup One important step before setting up ubuntu is to add the ldap user, you want to allows on the workstation, to the auxiliary objectClass posixAccount and posixGroup . It can easilly be done through the OpenDJ control-panel, in the Manage Entries section of the Directory Data . You will need to set the field uidNumber , gidNumber and the homeDirectory . They must contains respectively the user id number, the group id number and the user home directory path. For example: uidNumber = 1100 uidNumber = 1100 homeDirectory = / home / foo If you don't add those objectclass to your ldap user, he won't be able to be authentified on the workstation. If that the case, you will likely have a log sayin

Travis Ci & Maven deploy

Travis CI and Maven deploy A simple way to set up Travis CI and Apache Maven to properly deploy snapshots into a maven repository. The first step is to write a proper pom.xml that allows for the deployment of snapshots, without signing it. The gist bellow shows part of maven build files that is set up to deploy on the sonatype oss repository. By default, the deploy command will deploy the snapshot. If the release profile is active then the project artifacts will be signed and deploy to the release repository. You can find more information here . The second step is to define the server credentials on Travis CI. It can be done via your Travis repository environment variables . Just go to the settings tab and choose the subtab Environment Variables By default the variables you define here will be secure, and won't be shown in the build log. So let's define two properties: OSSRH_USER =< yourusername > OSSRH_PASS =< yourpass > AT this point, there is one last th

WebSocket with Grizzly, OSGi and iPOJO

Setup In this project we use the Grizzly http-service bundle version 2.2.18 which supports websocket and iPOJO . org.glassfish.grizzly.osgi grizzly-httpservice-bundle 2.2.18 org.apache.felix org.apache.felix.ipojo.annotations 1.6.4 We have to activate the websockets support by settings the following framework properties:  org.osgi.service.http.port=8080 org.glassfish.grizzly.websocketsSupport=true A simple 'echo' WebSocketApplication The following class implements a simple echo websocket app, such as describe here . import org.glassfish.grizzly.websockets.WebSocket; import org.glassfish.grizzly.websockets.WebSocketApplication; package org.barjo.websocket.test; public class MyEchoWebSocketApp extends WebSocketApplication { @Override public boolean isApplicationRequest(HttpRequestPacket request) { return true; } @Override public void onMessage(WebSocket socket,String text) { socket.send(text); /