Distributed Social Networks digest – october 2012

Winter starts well for DSN:

Advertisements

NodeJS Cron Job with Kue

At Cozy we needed to write some jobs of this kind for our Mails app. For that we used Kue a simple task manager for NodeJS that requires Redis to run. The documentation is great but there was no sample for writing a cron task. That’s why I share this little snippet that runs a 2 seconds long job every 3 seconds, in case you need something similar.

NB : The delay between each job is set in minutes.

kue = require 'kue'

Job = kue.Job

jobs = kue.createQueue()

# Set up server if you want to see your task progression with a beautiful UI
kue.app.listen 3003

# Your cron timing
delay = 3000

# Function used to launch a job.
repeatJob = ->
    job = jobs.create "test complete",
        title: "my job"
        info: "job is working"

    job.on 'promotion', () ->
        console.log job.data.title + " #" + job.id + " promoted"

    job.delay(delay)
    job.save()

# The job to run, a fake task that is 2 seconds long.
cronTask = (job, done) ->
    global.currentJob = job.id
    console.log job.data.title + " #" + job.id + " job started"
    setTimeout ->
        console.log "my job is done"
        repeatJob()
        done()
    , 2000

# Register job
jobs.process "test complete", myFunc = cronTask

# Check for new job every 3s, change this value to set your cron timing.
jobs.promote(delay)

# Run the cron job for the first time.
repeatJob()

2 years of FOSS Project, retrospective

On ocotber 19th 2010, I launched the Newebe Project, a distributed social network written with Python. Yes, it has already been already two years since I started the libre software aventure. As a recap, like last year, I am posting here a little retrospective of what happened during the past year.

Positive points

It still works. For the past two years I have used Newebe every day. It serves to communicate with my family and close friends and I’m satisfied of what it does. My Newebe loads quicker that Facebook, I see only the essential and I don’t feel limitated on what I say. Of course getting control back on my data is pleasant too.

Newebe got its first big contributions. During the last PyconFR hackaton, two contributors improved the Newebe packaging (thx Majerti!). This really accelerated the project and was the occasion to improve the code too and it reminded me that a good development workflow is a factor to be considered.

It led me to build a startup Last year, the company I worked for closed. I was unemployed and I had to ask myself what to do next. Since computer science field offers good opportunities for entrepreneurship, I oriented my focus towards it. At the same time, by looking at some articles related to the Newebe themes. I found a message of my actual partner. He was looking for people to help him to create a startup about self-hosting. Today, we are building Cozy Cloud an easy-to-manage platform for self-hosted web apps.

This pushed me to be more proactive and meet people. In the past, I was not used to participating in computer science events. Since starting Cozy Cloud I started going to several different ones. It then motivated me to go to events related to libre and open source softwares, like FOSDEM, LSM, PyconFR, etc. I even got the opportunity to do two lighthning talks! It also facilitates me in meeting various high-skilled people that like to share their knowledge.

I kept on learning and I did my first contribution to another project. It taught me new different things and now I can understand better what very technical people say. These past two years I feel that I have progressed a lot more than in my five previous year of professional experience. I also did my first contribution to another libre software called Fabtools.

Improvement Points

Truth be told , I’m afraid of the Dead Project. Sometimes developments takes a long time. I feel that it doesn’t progress fast enough and nothing moves on the software. It’s really an issue because I am thinking that this will cause the few people interested by what I do to move away. It’s a struggle to manage both development and community animation and I feel guilty if I don’t commit every week.

Number of users. I would say that I am not yet at maximum in building a user community. Lean startup principles would say that I didn’t do the right things. That’s why it’s not a surprise that the number of users are not yet as expected. However, I’m working on it : notably by making the installation process easier.
Moreover the good part of making a libre software is that you can do what you want and you are not obliged to seduce a huge mass of people.
A big contributing community has not yet existed. There are contributions- codes or advices- but they are rare. Most of FOSS projects are one-man project. This fact gives me assurance, but I can’t deny that a community à la Diaspora makes me dreamy.

I’m still exploring on the functionality. Previous inputs made me think that Newebe is not yet the most ideal solution to the problem of the centralized social network… At least, it serves me and the rest of it users well.

What’s Next?

I still enjoy working on this project. it allows me to experiment on different areas and it gives more variations in  my daily life. So, for next year, I will try to keep the same rythm, one release every six months and to focus on making it more user friendly (install process, better UI, communication protocol…). Coding a FOSS project is a great entertainment, so I’m going to take a little more.
That’s all for this year! If you had a similar experience or advice feel free to share the in the comment section!