How to Open Jura ENA 5 Automatic Coffee Machine

Mar 29, 2015

Tools needed:

  • Torx T15 Screwdriver
  • Jura Oval Security Key (available on eBay)

Duration:

  • About 5 minutes

Start by removing the water reservoir and the front tray.

Unscrew the two T15 screw located at the back of the machine.

Unscrew the back Jura logo to access the back oval security screw. Press gently on the Jura logo and rotate it counter-clockwise. To open it, you’ll need to rotate it about 10 degrees.

Unscrew the back oval security screw.

Pull up the locking mechanism located.

Move the coffee spout up and unscrew the front oval security screw.

Gently, pull the unscrewed tag out and then down.

Using a plastic opener tool (or your finger) pull down the two front security locks.

Slide the lateral panels to the back.

Now you have access to the water pump, the grinder and the other internals.

To assemble the coffee machine follow the same steps in reverse order.

Tips for node.js deployment on SmartOS

Apr 2, 2013

At the lovely company I work, we’re doing quite some work with node.js. Best environment for node.js deployment is a SmartOS machine, of course. One of the nice features of SmartOS is the deep level of dtrace integration. Check Max’s presentation from Node Dublin ‘12.

On the other side, SmartOS is SunOS’s younger nephew and not Linux’, which means that all your init.d/upstart scripts your already have will not be 100% portable to this new OS.

I’ll show here a couple of tips, to make the first deployment of your node.js service or site easier.

First, give your server a nicer name, so when you ssh in, it’s easier on your eyes and memory then the default md5/guid name.

echo "massive-lannister.local" > /etc/nodename

Second prepare your server to communicate with your Github account. Generate a private key…

ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub

…and copy the content of ~/.ssh/id_rsa.pub to GitHub > Account Settings > SSH Keys > Add SSH key.

Now let’s set up a home for your project.

mkdir /home/massive/
cd /home/massive/

Clone the repository

git clone git@github.com:bamse/massive-lannister.git

Install the npm dependencies

cd massive-lannister/
npm install

To set up the node.js service, you’ll be using Service Management Facility.

In your git project, create a directory srvconf where the you’ll store the non-critical server configuration files like nginx.conf or SMF manifest.

Now create a SMF xml manifest based on this template.

<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="manifest" name="node-massive-lannister-service">
  <service name="site/node-massive-lannister-service" type="service" version="1">
	<create_default_instance enabled="true"/>
	<single_instance/>
	<dependency name="network" grouping="require_all" restart_on="refresh" type="service">
	  <service_fmri value="svc:/milestone/network:default"/>
	</dependency>
	<dependency name="filesystem" grouping="require_all" restart_on="refresh" type="service">
	  <service_fmri value="svc:/system/filesystem/local"/>
	</dependency>

	<method_context working_directory="/home/massive/massive-lannister">
	  <method_credential user="admin" group="staff" privileges='basic,net_privaddr'  />
	  <method_environment>
		<envvar name="PATH" value="/home/massive/massive-lannister/bin:/usr/local/bin:/usr/bin:/usr/sbin:/bin"/>
		<envvar name="HOME" value="/home/massive/massive-lannister"/>
		<envvar name="NODE_ENV" value="production"/>
	  </method_environment>
	</method_context>

	<exec_method
	  type="method"
	  name="start"
	  exec="/opt/local/bin/node /home/massive/massive-lannister/app.js"
	  timeout_seconds="60"/>

	<exec_method
	  type="method"
	  name="stop"
	  exec=":kill"
	  timeout_seconds="60"/>

	<property_group name="startd" type="framework">
	  <propval name="duration" type="astring" value="child"/>
	  <propval name="ignore_error" type="astring" value="core,signal"/>
	</property_group>

	<property_group name="application" type="application">
	</property_group>

	<stability value="Evolving"/>

	<template>
	  <common_name>
		<loctext xml:lang="C">node.js massive lannister service</loctext>
	  </common_name>
	</template>
  </service>
</service_bundle>

Import the service and start it.

svccfg import srvconf/node-massive-lannister-service-manifest.xml
svcadm enable node-massive-lannister-service

And verify that it works:

tail -f -n 50 "/var/svc/log/site-node-massive-lannister-service:default.log"

If you wish to stop the service:

svcadm disable node-massive-lannister-service

If you’re using the node.js service behind a nginx server, set this up too. Some companies (like Joyent) are exposing node.js directly, not behind a proxy.

Install nginx:

pkgin in nginx -y

Copy the nginx config:

mkdir -p /opt/local/etc/nginx/sites-enabled
cp srvconf/nginx-site-api.conf /opt/local/etc/nginx/sites-enabled

Edit nginx.conf and add the include line after http {

vim /opt/local/etc/nginx/nginx.conf
#add this line after http {
include /opt/local/etc/nginx/sites-enabled/*.conf;

Enable nginx:

svcadm enable nginx

Sample of nginx-massive-lannister.conf

server {
	listen   80; ## listen for ipv4; this line is default and implied
	#listen   [::]:80 default ipv6only=on; ## listen for ipv6

	root /home/massive/massive-lannister/public;
	index index.html index.htm;

	# Make site accessible from http://localhost/
	server_name api.massive-lannister.com;

	location /api {
		proxy_pass http://127.0.0.1:5648;
		proxy_buffering off;
		proxy_connect_timeout 66;
		proxy_read_timeout 66;
		proxy_send_timeout 66;
		proxy_hide_header X-Powered-By;
		proxy_hide_header X-Response-Time;
		proxy_set_header Host $host;
	}
}

To make a new deployment, at a later point:

ssh root@massive-lannister.com
cd /home/massive/massive-lannister/
git pull
svcadm restart node-massive-lannister-service

Another useful tip, with this setup is the separation of production and development environment. If you noticed, in the manifest xml file, we set a variable called NODE_ENV to production.

In app.js, include the reference to your config file:

var conf = require('./lib/config.js')

And later:

seneca.use('mongo-store', conf.mongo)

The content of lib/config.js is pretty small:

var env = process.env.NODE_ENV || 'development'
console.log('Config in ' + env + ' mode')

var config = {}
config.port = 5648; //TYRI
if (env === 'development') {
  config.mongo = {
	name:'db-dev',
	host:'',
	username:'massive-test',
	password:''
  }
} else {
  config.mongo = {
	name:'db-prod',
	host:'',
	username:'massive-prod',
	password:''
  }
}

module.exports = config

Inspired by Isaac Schlueter’s Github project.

Happy coding!

P.S. In case you’re wandering who’s massive-lannister, that’s the name of the project suggested by Github, when I went on to create a new repository. Some of their suggestions were north-american-hipster and mustached-sansa. If Tyrion Lannister and Sansa are present, I guess that someone from Github is a big fan of George RR Martin’s A Song of Ice and Fire. Or HBO’s Game of Thrones, I can’t tell until I see if they used Khaleesi or Daenerys for the Mother of Dragons’ name.

On IPv6

Jan 3, 2013

IPv6 is here, however its support is not ubiquitous. Although some hosting providers support it, some of the big names don’t offer native support (cought Amazon/Azure).

The first step in setting your IPv6 ip is to check if your hosting provider supports it. The previous hosting company I used (easyspeedy.com) and the current companies (prgmr.com, burst.net) do however, some of the biggest players like Azure (Azure FAQ) and Amazon (Amazon FAQ) don’t. Unfortunately, this means that a lot of other companies built on top of Amazon’s services don’t. The following service providers, although not based on Amazon or Azure, still doesn’t offer IPv6 internet routing (Squarespace, WPEngine, Joyent, Nodejitsu). Some companies offer a tutorial on how to set up IPv6 using he.net tunnels.

The second step is to get an ip. Check if you already have an IPv6 address assigned. Login via ssh and run

sudo ifconfig|grep inet6 

If you’re output has some record like the one from below, you’re in luck.

inet6 addr: 2001:470:1:41:891d:4105:8c8d:2942/64 Scope:Global

If not, contact your provider support team and they may assign you ip addresses. Some providers will give you a /64 class (several billions) others will give you just 10 or 20. Since there are so many IPv6 addresses available (several billions for each person on the planet), these should be free of charge (compared with $10-S20/year for any additional IPv4 address).

Setup the address you received. Tutorials for Ubuntu/CentOS are available online. They are really to find them using your favourite search engine.

Note on setting your IPv6 address: at the moment, cPanel does not support IPv6. According to their site, support for it is coming soon (soon as in 2013-2014). This is somewhat sad, since you won-t be able to set up Apache if you’re also using cPanel.

Verify that your IP is correctly, set up. Use one of the many online sites

Step three is to let others know that you are using IPv6, meaning that all your hosts which have an IPv4 IP should have an IPv6 one. This is done from your hosting provider DNS server (or from your own DNS server). Start by quering your domain, cli whois or online whois. Then log in to your domain provider or DNS server and set up an AAAA record, for each A record. CNAME or MX point to hosts, so nothing to do here. Depending on your DNS TTL (time to live), your new IPs will be available sooner or later.

Step four is to setup the rest of your infrastructure, web server, ssh, and other.

Verify which service is already listening on ipv6 using netstat.

bash$ netstat -nalvt
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp6       0      0 :::22                   :::*                    LISTEN

In the previous example, ssh listes on IPv4 (address 0.0.0.0:22) and IPv6 and (address :::22), however mysql listens only on IPv4 (127.0.0.1:3306).

From experience, ssh and mail already listen on IPv6.

The web server, has to be setup, though. Nginx is easier to setup, because you only need to configure it to listen on IPv6, however Apache needs to be then configured for each virtual host (for Apache only).

Once you’ve completed these steps, you can setup an IPv6 only address for your site (e.g. ipv6.site.com or www.ipv6.site.com) and see that you can open it. If this works too, congratulations, you’re ready for the future.