Proftpd – user is not a UserAlias

If you get this error you are probably trying to configure a new ftp user on proftpd.
This error found on proftpd.log refers to UserAlias configuration

UserAlias [ login-user real-user]

add early in your /etc/proftpd/proftpd.conf a line similar to this:

UserAlias ftp-login-name real-unix-user

and that’s it.
Remember to check that the user exists and it’s inside the proper ftp group, based on your proftpd configuration

React JS – Render an array of items in JSX

Hello everybody.
Quick code snippet for JSX for rendering an array of items, instead of a single one, in a ReactJS component:

'use strict';

var React = require('react');

var MyComponent = React.createClass({
  render: function() {
    var myString = ["L","o","r","e","m"," ","i","p","s","u","m"];
    return (
        <div> { 
          myString.map(function(letter) { 
            return <span>{letter}</span>
          }) 
        } </div>
      ); 
    } 
}); 

module.exports = MyComponent;

voilà!

Avoid sync folders and files in dropbox or google drive as git with .gitignore

Hello everybody,
I bet everybody has his own cloud solution for syncing it’s folders from home to work, viceversa and between devices.
Before today i always relied on a Dropbox / Google Drive combo depending on the project:

  • Dropbox is great with Heroku which has a sync plugin (super-sweet!!) and its client is fast and not memory wasting
  • Google Drive client is super slow and takes ages to init but i tend to use a lot the whole google suite on the web and it’s really integrated well (history, revisions, etc)

BUT as any other web developer i have this big, nasty problem of not wanting to sync:

  1. Git repositories (.git folders)
  2. NPM modules (node_modules folders) or Bower components (bower_components folders)
  3. Other trash folders left by the various IDE (nbproject folder) or OS (Thumbs.db files)

Everybody have tried a npm install with devastating consequences for poor cloud clients and it’s a known fact that in the long run both dropbox/drive will corrupt a git repo.

Read more

WordPress unexpected ‘$theme’ (T_VARIABLE) in constants.php

Parse error: syntax error, unexpected ‘$theme’ (T_VARIABLE) in /……./wp-content/themes/optima/lib/constants.php on line 1
 or perhaps
PHP Parse error: syntax error, unexpected ‘$theme’ (T_VARIABLE) in /…./wp-content/themes/Lightbox/lib/constants.php on line 1
what to do:

Simply re-upload the constants.php file.

why?

When you upload the theme with FTP some of your file such as constans.php are compressed and spaces removed from file. That issue comes from some host. Trey to re-upload files that have errors.

seriously.

Headless Jenkins Chrome testing on Ubuntu

Let’s go straight to the point :)

First, install a VNC server:

sudo apt-get install vnc4server

Be sure to use jenkins unix user from now on:

sudo su jenkins

Next, start and configure the server:

vncserver

At this point, it should ask you to create a password for VNC. Do so, then continue.

Start a VNC screen on screen 99:

vncserver :99

If that goes through alright, then kill the screens created. (For me, when I ran vncserver for the first time, it created a screen at :1, so we’ll kill both of the screens created)

vncserver -kill :99  
vncserver -kill :1

Done with the vncserver part.
Then on jenkins:

- install XVNC plugin
- activate XVNC in every job that requires it
- run the job

Voilà!

How to make a job fail on Jenkins

Hello all,
This is a rather important topic with a rather simple solution:

  1. Add to your build an Execute Shell
  2.  Set the command to something like:
    if [ -f "$file" ]
    then
        echo "$file found."
    else
        echo "$file not found."
        exit 1
    fi

The important part for the failure is exit 1

If the condition meets it (and for what we care they can always meet it), exit 1 will fail the job.

Remembers that anything that fails (even plugins/syntax errors) will make the job fail.
Don’t fail at failing.

Continuos Integration with Jenkins and Github and Karma

Hello all,
Continuos integration is an hot and complex topic, not my usual beginner tutorial.  I found few documentation about this topic so i think it could be useful to give a direction to anyone who faces Jenkins for the first time and want to integrate it with a javascript project on github.

Read more

Node.js process doesn’t die on exit (ctrl+c)

Hello all,
Back in action with some uber simple node.js suggestions:
I bet that everybody have experimented the frustration of having this error:

EADDRINUSE, Address already in use

The reason is pretty simple, we quitted from the terminal without properly killing the node.js process. Till here everything plain and simple.

Then what to do to avoid this frustrating behavior…

Read more

I think there’s a jQuery plugin for that..

Hi all,
Because of the new job and my relocation to Paris i’ve been too busy to write any article in this period.

But since i don’t want to leave too many months without posts here is a nice picture with much wisdom:

If, for each functions in sass and images naming

Hi all,

This article seems a bit old since SASS is nowadays well-known and it has a lot of great tutorials everywhere, but i really wanted to suggest you to never forget to give your website images a proper naming structure, expecially icons.
I had to deal with a lot of icons during a recent project:

.icon_s1{
    background: url('../images/s1.png') no-repeat top left;
    &.active{
        background-image: url('../images/s1_on.png');  
    }
}
.icon_s2{
    background: url('../images/s2.png') no-repeat top left;
    &.active{
        background-image: url('../images/s2_on.png');
    }
}
.icon_s3{
    background: url('../images/s3.png') no-repeat top left;
    &.active{
        background-image: url('../images/s3_on.png');
    }
}
.icon_s4{
    background: url('../images/s4.png') no-repeat top left;
    &.active{
        background-image: url('../images/s4_on.png');
    }
}
// others

… and after 30 icons the whole _icons.sass would become a whole mess as you can see.
The first thing i thought is to use a common sass for cycle..

Read more