Picture by luis gomes at https://www.pexels.com/photo/blur-close-up-code-computer-546819/

Hello developers, here comes a super quick fix for an annoying problem.

When you set up your PHP project to use Doctrine Migrations library and every time that you run a migration command the result is:

SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘migration_versions’ already exists

This is because at your configurations for the migration tool, a schema was specified.

At the file migrations.php or similar (it depends on your setup):

return [
'name' => 'Project Name',
'migrations_namespace' => 'Namespace',
'table_name' => 'migration_versions',
'column_name' => 'version',
'column_length' => 14,
'executed_at_column_name' => 'executed_at',
'migrations_directory' => __DIR__ . …


Hi all, as part of my goals for 2018, I decided to watch a few movies on my list that are not related to the Science Fiction category.

The selection of the movies are based on classics or claimed as good by the critics.

My intention with this exercise of watching things out my comfort zone is to amplify my vision of the world, storytelling, and references.

This text does not contains spoilers.

To start the year I choose Whiplash.

Plot: A promising young drummer enrolls at a cut-throat music conservatory where his dreams of greatness are mentored by an…


Hi everyone, here is tip to fix this Wordpress issue.

NOTE: This is a procedure that will works only if you have administration permission.

The cause of the problem is: Your folder doesn't have the same owner of the PHP process / Apache.

So lets go, step-by-step (uuuhhh babyyyyy!!!)

1 — Connect to you server using the terminal
2 — RUN the ps aux | grep php

3 — Check out the first line of the result. If it's different from the second line, we are good to go to the next step;
4 — Time to change your site folder…


Hi guys a new tip about how to solve the following warning:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = “UTF-8”,
LANG = “en_US.UTF-8”

Every time that this type of warning appears its because some of the environment variable are unset.

Note that in my example, LANGUAGE and LC_ALL are equal to (unset).

To solve that problem, just set / export the variable with your system language. In my case: en_US.UTF-8.

Command:

export <VARIABLE≥=<VALUE>

Command with values

export LANGUAGE="en_US.UTF-8"

If the problem persist, feel free to contact me by twitter @gabrielpires or e-mail eu at gabrielpires.com.br

Seeya!


Hello people, here is another tip for RaspberryPi.

Could be a pain in the ass handle audio output over RaspberryPi

So I'll let here a few tips to help you in the day by day.

Changing Output:

Sometimes, you need to change from the HDMI output to 3.5mm jack.

To do that, simple type: sudo raspi-config

After enter into the configuration panel, follow the steps

1 — ADVANCED OPTIONS

Accessing Advanced Options

2 — AUDIO CONFIGURATION


Hello everybody, I found out that a lot of people has trouble trying to install the PyGame because of the dependencies.

So here is a few commands to help you to do so.

$ sudo apt-get install mercurial
$ hg clone https://bitbucket.org/pygame/pygame
$ cd pygame

$ sudo apt-get install libsdl-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev
$ sudo apt-get install libsmpeg-dev libportmidi-dev libavformat-dev libswscale-dev
$ sudo apt-get install python3-dev python3-numpy

$ python3 setup.py build
$ sudo python3 setup.py install

All this process should take a while:

RaspberryPi 1 B+ around 1 hour
RaspberryPi 2 B+ around 25 minutes

If you have any problem doing the process, feel free to contact me at twitter: @gabrielpires or e-mail eu at gabrielpires.com.br

Seeya!


Hi everybody, this is a simple snippet to help you convert your JSON file to a CSV file using a Python script.

Create a new Python file like: json_to_csv.py

Add this code:

import csv, json, sys
#if you are not using utf-8 files, remove the next line
sys.setdefaultencoding("UTF-8") #set the encode to utf8
#check if you pass the input file and output file
if sys.argv[1] is not None and sys.argv[2] is not None:
fileInput = sys.argv[1]
fileOutput = sys.argv[2]
inputFile = open(fileInput) #open json file
outputFile = open(fileOutput, 'w') #load csv file
data = json.load(inputFile) #load json content
inputFile.close() …


Hi, here is a quick tip about a really annoying problem when you install MongoDB over Ubuntu 16.04 distro at AWS LightSail.

When you start your MongoDB through:

sudo service mongod start

And the result is something like this:

● mongod.service — High-performance, schema-free document-oriented database Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled) Active: failed (Result: exit-code) since Wed 2016–12–07 03:43:00 UTC; 3min 9s ago Docs: https://docs.mongodb.org/manual Process: 24453 ExecStart=/usr/bin/mongod — quiet — config /etc/mongod.conf (code=exited, status=14) Main PID: 24453 (code=exited, status=14)

And you don't know why.

The problem is, the Mongodb SOCK do not belong to the mongodb group…


Once in a while, when you try to connect to the database using a code like PHP, Python or even with a MySQL cliente like SequelPRO an error message will popup for you:

Your password has expired. To log in you must change it using a client that supports expired passwords.

You have different paths to solve this situation and here is a simple one:

1 — Open your terminal
2 — Type: mysql -u root -p
3 — Type you old password
4 — Type: SET PASSWORD = PASSWORD(‘XXXXXX’); //REPLACE XXXXXX WITH YOUR NEW PASSOWRD
5 — Be Happy :)

If you still have trouble after this step by step, feel free to contact me: Twitter @gabrielpires or e-mail eu at gabrielpires.com.br

Seeya!


I create a simple application using NODEJS + EXPRESS over my server.

AWS MICRO with UBUNTU 16.4 LTS

After several attempts to run my application I discover that NODE was installed at /usr/bin/nodejs and should be installed over /usr/bin/node.

So if you need to run NODE over UBUNTU, after the installation, run the following command to create a link:

sudo ln -s /usr/bin/nodejs /usr/local/bin/node

Be Happy :)

If you have any doubt and want to talk about tech, feel free to contact me by email eu at gabrielpires.com.br or twitter @gabrielpires.

Gabriel Pires

Senior Back-end Engineer @ Helloprint. Tech Professional, Software Development, Data and more. Straight to the point without bullshit.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store