Example of CI/CD stack

Context

When I started to work at TRAXxs (we are doing some pretty cool stuff there btw 🙂 ), there was a lot of things to put in place to setup our back-end / front-end layers. The cool thing was the possibility to select the technologies we will use… Let’s go Docker, Node.js, Mongo + other cool stuff then (a little bit of Clojure + some Go, as they are languages that Im also very interested in).

At TRAXxs, we are working on connected insole devices. To keep it simple, on the server side (the part I’m in charge) we collect the data, make some analysis and expose it to the clients via api and web front-end. There is, obviously, much more than this but this is a cool summary.

Lire la suite

Handling several version of node.js with nave

A couple of months ago I decided to give nodeJS a try and I honestly really enjoyed it since then.

The first version I used was 0.4.8. In my application I used several modules:

  • expressjs (you can make an API server in no time with this guy)
  • node-proxy (very usefull to make cross-domain AJAX request)
  • cluster (to use the power of a multi-core CPU)
  • … plus a couple of others

Lire la suite

Linux one liners

Too often I remember having already searched and used some useful commands but also too often I do not manage to quickly find them again. This is the place I will save them for future use and not forget them this time.

Copy a public key onto the remote server
ssh user@remote-server 'cat >> .ssh/authorized_keys' < .ssh/id_dsa.pub

Add a user in the sudoers on Ubuntu
sudo usermod -a -G sudo username

Save a file in vi when you made a lot of changes and did not notice it was read-only
:w !sudo tee %

List all IPs connected to a LAN
nmap -sP 192.168.1.*

List all IPs of LAN running a server on port 8080
nmap -p 8080 192.168.1.*

List all open port on Ubuntu
netstat -lnptu

Get process listening on a given port
lsof -i:8080 -n

Version of Linux running
cat /etc/issue

Range of date in Ruby

I needed to select a random date within a range… I figured out this is very easy in ruby 🙂

Let’s say I want to be able to select a random date between « today – 15 days » and « today + 15 days ».
Here is a snippet that describes the thing:

require 'date'
today = DateTime.now
new_date = (today-15..today+15).to_a[rand(15)-15]


irb(main):010:0> today.strftime("%a %d/%m/%y %H:%M")
=> "Thu 25/02/10 11:33"
irb(main):011:0> new_date.strftime("%a %d/%m/%y %H:%M")
=> "Wed 03/03/10 11:33"