Wednesday, January 18, 2017

Installing Node 6.9.4 LTS & Latest NPM Version On Fedora 25

10:11 AM Posted by Elie Obeid
Today I spent quite sometime trying to install Latest NPM version and NodeJs LTS version 6.9.4 on Fedora 25 and it's not as easy as you think.

Following official docs didn't work. Dnf installed an older version and I got strange errors when trying to update npm to the latest version

  sudo npm install -g npm 

I ended up installing  Node like this

  sudo dnf install --enablerepo rawhide nodejs libuv --best --allowerasing 

That installed Node LTS successfully but not NPM, and I still got weird errors when trying to upgrade NPM.

so I ended up removing node-modules folder

  sudo rm -rf /usr/lib/node_modules 

and installed NPM as root

 sudo curl -L | sh

Now NPM works as correctly, version 4.1.1 installed. I'm going to try yarn once it matures, I hate NPM. Hopefully that post helps someone.

Friday, March 4, 2016

Wednesday, February 3, 2016

Don't Think Like An HR, Don't Hire Experienced Programmers

6:56 AM Posted by Elie Obeid
Pretty much all the companies in my country want to hire experienced programmers, they want between 3 and years of experience. This is a great video showcasing why this is a bad idea.

And I'm going to give my own opinion on the subject highlighting why you shouldn't hire experienced programmers and how to treat junior programmers.
  • Firstly, you have to ask yourself, why would an experienced programmer want to join your firm?
Chances are he's been fired, if so then he might suck at his job or he had an argument with his boss or colleagues, in that case, you wouldn't know if he's the criminal or the victim, everyone lies to appear innocent.
  • Maybe he wants to join your firm because you offer more money.
In that case do you really want to hire someone who's sole motivation is money? Do you want to hire someone who's willing to quit if someone else pays him more? Can you trust on such person to take your company's secrets to the grave?
  • Experienced programmers are less likely to have the desire to learn something new. And they don't take risks.
I know a company who hired experienced programmers, and refuses to hire programmers with no experience, they specialize in content recommendation, they knew in no time that they need to switch to NoSQL, but who will do it? They'd rather spend more time trying to fix the problems in SQL servers, rather than switching to NoSQL. Furthermore Experienced programmers don't take risks implementing new technologies, that's good sometimes when you have a software to maintain, but maintenance is a bitch, sometimes it's easier to start new, and you get better performance too!

There's a company asking for a CodeIgniter programmer with at least 3 years of experience. Well first things first, CodeIgniter is outdated, it's wiser to dump your code and write it in Laravel, but who's going to do it? And how to find a CodeIgniter programmer with 3 years of experience? And again why would he want to join your firm?
Another company is looking for an experienced XMPP programmer, there are probably a handful of those! Some requirements are impossible to meet! You'll waste a lot of time until you find an applicant that fits your requirements.
  •  Sometimes, you don't even need experience! Why you ask for it?
A real company is asking for an engineer with 2 years of experience to work as a support team member, responding to their emails and fixing HTML, CSS and JavaScript bugs!
  • Experienced programmers, might get sloppy and ask to be paid more!
Yes! With experience comes sloppiness, sometimes, and refusal to give up on bad habits! I've seen it many times and I gave examples above!

  • Are you sidelining the junior programmers? 
 Is it another way for you to say "I don't want to hire junior programmers, I don't have time to teach them?" If so, were you ever a junior? Who taught you?

One of the most common ways for junior programmers to work in a company unfortunately, is to apply for internship, and then we give them useless or silly tasks, and we supervise them obsessively, some companies don't allow their employees to use internet, expecting that their employees know everything. This is bad for the employees and the interns, and a waste of time, at the end of the day, the interns learn nothing, because we didn't trust them enough to give them real tasks.


  • Don't ask the employees "Do you like this company?" Because the answer will obviously be "I love this company and I want to grow with it", they are lying, you know that they are lying, but that's the answer you expect to hear, why do you ask the question?

 - Dilbert by Scott Adams

I have taught many junior programmers and learned that they enjoy learning and they will try so hard to prove themselves and will consider you a mentor and will work sometimes for free, just to prove that they can accomplish the task you gave them and to gain your trust.

So stop asking for an experienced programmer, unless you really, really, really have to, and stop looking for a shiny CV, or for a student with a high GPA from a well known college, many programmers dropped out of college or perhaps they never went to one, because programming is a hobby at its essence!

Take a look at the Github and Stackoverflow account, give applicants a free trial, encourage him to take his own decisions, make sure he's excited about the job, then and only then, you know you have hired the right person for the right job. 

Tuesday, February 2, 2016

I tried to stop pirating, but Netflix sucks

2:55 PM Posted by Elie Obeid
When I was a teenager, I helped a friend create a MP3 search engine, we were teens, I was obsessed with hacking and pirating, not anymore. I used to download entire discographies from torrent sites, nowadays I used Youtube or Spotify. But when it come to movies, and TV series, it's a different story.

I live in Lebanon, not a "mainstream country". I can't go to the cinema often, for reasons outside the scope of this post, and TV channels are bad, they don't air the TV series I'm eager to watch, or perhaps they air an old season and keep repeating it.

Most of the series can't be found on DVDs, and if you do find them, then it's most likely that the store owner had pirated them and he's selling them, and he pirates them on demand, you ask for the big bang theory, he says come back in two days and get it, two days is enough to torrent it and burn it on DVDs and sell it, movies are pirated and sold too. Why buying a pirated DVD when you can download the torrent yourself and then delete the episode?

But I wanted to try something different, I wanted to try not to pirate, so when I knew that Netflix is now available in my country, I immediately signed up for the premium plan, ulta hd, 4 screens! free trial! Let me test it, I don't want to be a pirate no more!

 - Dilbert by Scott Adams


Hulu and other on demand streaming services aren't available in my country, I was so excited to see what on demand streaming service looks like, was so excited to try Netflix!

I started searching!

  • Mokingjay part 2 not available, the entire hunger games series is not available
  • Star wars, not available, not even 1 episode 
  • Even The last witch hunter is not available
  • Etc. no good movie is available, the likes Forrest Gump and the Shawshank redemption are available but I already watched those. 
In short, movies that are available are either too old, chances are you watched them, or too bad. Now lets search for series

  • No hot new TV series is available, not even the big bang theory
  • The blacklist, only season 1 is available
  • Mythbusters, first 3 seasons only!
I Googled and concluded that Netflix stream different content depending on the country you live in, for instance, the big bang theory is available on Netflix France and very few other countries. And that's the big problem with legal streaming services frankly.

A new component of the Creative Content UK initiative is set to discourage Internet piracy via the classroom. Encouraging students to think about who will pay for Vin Diesel's socks if everyone pirates movies, charity Into Film in partnership with The Industry Trust, The IPO and FACT have a lesson plan up their collective sleeves.
source Torrent Freak

But they ignore the fact that content creators expect to get paid different fees in different countries and if the fees aren't paid by the streaming service then the users won't have other options but to use torrents.

Torrents hurt content creators? Maybe or it might help spread their work, the last witch hunter was downloaded many times on torrent websites, but it was a box office failure. Paulo Coelho pirates his own books to promotes them.

But if we take for granted that torrenting is a bad habit, then Hollywood is stupid, they should care less about the money they expect to make, and stream all the movies to all the countries as soon and they become available on DVD and they should stream all TV episodes to all the countries the very next day after they get aired on TV. And the pricing should be cheap and should vary from country to country, for example average poor countries can't afford 11$ per month just to watch movies! If you refuse to lower the price to 3$ you gain nothing from them, they are not going to subscribe, but if you do lower the price you get many subscriptions!

Monday, January 18, 2016

Installing PHP7, Nginx, Mysql (Mariadb) (LEMP), Composer and Laravel on Arch Linux/Manjaro

8:24 AM Posted by Elie Obeid
My blog isn't meant to be a How-To guide, per SE, for that you could refer to DigitalOcean.

I dumped XAMPP, it has it's own php.ini, some configurations didn't work, couldn't enable mcrypt, etc, XAMPP is not a good solution. Tried to run PHP7 on Apache on my manjaro, didn't work, God knows why, so I settled on Nginx, and here's how I install it.

I have php7, php7-fpm, mariadb, Nginx and mcrypt for php7 installed, the first four can be installed using Pacman, the last should be installed using Yaourt, if you have package manager Pamac,  you could install all of them by using that. if you got stuck during the installation refer to DigitalOcean's blog post.

Now lets configure Nginx, which is the most important part, use your favorite text editor and edit etc/nginx/nginx.conf, fastcgi configuration, line (64 to 72 in my file) should look like this:

        # pass the PHP scripts to FastCGI server listening on
        location ~ \.php$ {
            root           html;
            fastcgi_pass   unix:/var/run/php-fpm/php-fpm.sock;
           fastcgi_index  index.php;
           fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name;
            include        fastcgi_params;

I suppose you know how to change the root, root   /usr/share/nginx/html; to something else, line 44 in my file, I tend to leave the root as is, create a folder inside it for php, Chmod 777 -R folder I created, and create a shortcut for it.
I also installed the latest version of composer using Pamac, you could also
sudo pacman -S php-composer

Or follow instructions on their website

For database management I use Adminer or SQLbuddy, the latter seems dead, last release 3 years ago. To install composer you run

composer global require "laravel/installer"
If Composer  asked for token, click on the link generated in terminal, and grant composer access for public repos.

One small note, I couldn't get Laravel to run on Nginx so I just do

php artisan serve application

You think you can make it work on Nginx? Let me know in the comments, but I'm satisfied for development, on a production server, I'd be using apache if I knew I want to run Laravel, and probably an Ubuntu or Debian VPS. Don't forget to

  sudo systemctl restart php-fpm.service and sudo systemctl restart nginx