Download Youtube Videos/Audios from CLI

Everyone downloads videos and audio from YouTube. There are countless plugins for it. Some work. Some don’t. Some just redirect you to their website. Some just stalk your browsing history.

youtube-dl is the solution [1]

$ sudo apt-get install youtube-dl

Downloading Video
$ youtube-dl {videourl}

Downloading only the MP3, [2]
$ youtube-dl --extract-audio --audio-format mp3 {videourl}

Isn’t it awesome?

Creole Speaking Union

30th laniverser Kreole

Going through my photo galleries. Came across the above photo.

Notice anything?

Creole Speaking Union

Creole Speaking Union. Why not “Ban kozeur kreole” or “lasociation ban kozeur kreole”? Were they afraid to look dumb and decided to look more professional by choosing an English name?

502 Bad Gateway

Suddenly, i would get a 502 Bad Gateway page while trying to access my localhost nginx web server.

Looking at nginx log, found these

$ cat /var/log/nginx/error.log
---
2014/06/26 00:26:10 [crit] 1260#0: *2 connect() to unix:/var/run/php5-fpm.sock failed (13: Permission denied) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /test.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "localhost"

I remembered having firing the system updater few hours ago. Looking at the logs

cat /var/log/apt/history.log

I see php5-fpm, php5-mysql, php5-common, php5-readline, php5-cli have been updated. I guess this is what caused the breakup.

I tried re-installing them
$ sudo apt-get install --reinstall php5-fpm
---
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
libwebkitgtk-3.0-0 : Depends: libjavascriptcoregtk-3.0-0 (= 2.4.2-1ubuntu0.1) but 2.4.3-1ubuntu2 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

I ran
$ apt-get -f install

Apparently the last update didn’t complete. But i’m still getting the 502 error :-/

But then googling more about the nginx log, someone posted a magical solution here


$ chmod 666 /var/run/php5-fpm.sock

Problem Solved 😀

mcrypt on Ubuntu Server

I tried installing Prestahop and Laravel on an Ubuntu Server and it was telling me mcrypt function cannot be called.

Tried doing this but it said it was already installed
sudo apt-get install php5-mcrypt

I finally edited php.ini adding
extension=mcrypt.so

It could have been done using this too i guess
sudo php5enmod mcrypt

It’s kinda weird why this wasn’t enabled by default.

Pundit Sungkur et al. refuse to return our stolen beach.

Last time, they said they’ll do everything to abide by the law [ ref ] despite having violated it at first. But now they are waiting for the law to abide to their plan [ ref ]. They are waiting.

This government is a joke. “Petit copains” can piss on the laws and regulations. Government don’t care. But what they do, install speed cameras that fine the general population Rs 2000 if they go at 80.1 km/h. This is them saying they’re just doing their duty by applying “The Law”!