Skip to content

Instantly share code, notes, and snippets.

@e-neko
e-neko / readme.md
Last active July 25, 2020 12:47 — forked from jobsamuel/readme.md
Run NodeJS as a Service on Ubuntu 14.04 LTS

Run NodeJS as a Service on Ubuntu 14.04 LTS

With Node you can write very fast JavaScript programs serverside. It's pretty easy to install Node, code your program, and run it. But > how do you make it run nicely in the background like a true server?

  • Go to /etc/init/
  • $ sudo vim yourapp.conf
  • Paste script.conf
  • $ sudo init-checkconf -d /etc/init/script.conf
  • $ sudo start yourapp
  • And when you wanna kill the process $ sudo stop yourapp
@e-neko
e-neko / nespresso.js
Created October 22, 2017 00:59 — forked from kolontsov/nespresso.js
Nespresso coffee machine BLE experiments (get AUTH_KEY with Android BT HCI log and Wireshark)
const noble = require('noble');
const SERVICE_UUID = '06aa1910f22a11e39daa0002a5d5c51b';
const TEMPERATURE = {low: '01', medium: '00', high: '02'};
const VOLUME = {ristretto: '00', espresso: '01', lungo: '02', americano: '04', hotwater: '05', recipe: '07'};
let brew_cmd = (vol, t)=>`0305070400000000${TEMPERATURE[t]}${VOLUME[vol]}`;
let process_char = char=>{
if (char.uuid=='06aa3a41f22a11e39daa0002a5d5c51b')
{
char.write(Buffer.from(AUTH_KEY, 'hex'));