Using Minio server for simulate S3 locally

The other day, I was building a small development environment for me to test Laravel and S3, but as usual, I didn’t want to use production credentials nor to use S3 directly, so after a small search I found Minio :

Minio is an open source object storage server with Amazon S3 compatible API. 
Build cloud-native applications portable across all major public and private clouds.

And I was so happy, as I’ll be able to use S3 locally and wont worry about hitting outside my local network, I pulled the docker image, and then I realize that I’ll have to specify the command to run and some environment variables which okay for local development, but it wont work with Bitbucket Pipelines, so my tests wont work.

you can read this tweet and the list of tweets under it

So what I did was to build a new docker image that will have everything up and running, the content of the Dockerfile was

which is simple and nice, but again wont be that much helpful, as I need to have two default buckets created automatically for me, so I altered the file to create a new directories under the /data directory.

Continue reading

Filed under: Code, docker

New fresh start, many things to end

Starting from today, the plan is to catch up with everything I have missed in the past few years, so there will be a lot of reading and a lot of side projects to learn even more.

The main points which I’ll try to cover while searching for a new opportunity are:

  1. Laravel 5: I did missed a lot of the new things that has happened to Laravel in past few years, I was concentrating on using it more than learning the main components individually, this hopefully will change as I’ll have to put some time to read and check the internal Illuminate components, and maybe build some packages while am doing so.
  2. Docker: yes I’ve talked about me trying to learn Docker a lot in the past, and it was a fun and exciting experience, so now its the time to put what I have learned in more production ready state, to deploy and learn more about how we can use it in production.
  3. Microservices: so in the past few months I spend 99% of my time deploying microservices in the company, which they do one thing only, so now its time for me to read more and see how can I group microservices in one big system that can communicate internally with each other, and yes by utilizing what I have learned about Docker.

So maybe they are a lot of things to do, but now that am on a break I might have the time to do that, and finish also most of the courses that I have bought but never found the time to finish.

Also, if you have any idea which you want someone to help you develop, you can communicate with me via the contact form.

Filed under: Business, docker, Laravel, Personal

[Tip] Connect to multiple databases on the Fly with Lumen

Its not always an easy way to connect to different database if the configuration files does not include any information about it, in older version it was even a tricky one, especially if you have a bit of relationship that you want to use.

Don’t understand from my words that you cant do that, but it was not a direct use of setConnection , from my memory, the setConnection function used to force the connection on the current model only not the children nor any other one that it has a relationship with, when the info for this connection was not part of the database config file.

Things has changed and now in Lumen 5.5 (I didn’t try it with older version), as now you can use the function on to enforce the connection on the Model and any relationship it needs. like the following:

Create a base Model and create a function within called mergeConnections:

Continue reading

Filed under: Code, Laravel, PHP

This is why I can’t be a mentor

Not everyone can be a mentor or a teacher, some of us have this naturally, some don’t have it at all, am from those who don’t have it at all.

There are many reasons, why I can’t be a mentor, and why I can’t be a mentor, one of the main reasons is my temper, I can get angry fast, and most of the people will found my hard words as an insult to them as if I don’t appreciate the work they do or even the experience they have, so lets me tell you for example what I can’t understand nor able to work with.

1- If you are going to tell me that you are a developer, let’s say a Mac user who use Mac to develop iOS apps, I can’t accept from you that you don’t know how to use the terminal, or at least you don’t know the most common command line commands.

2- If you told me that you are a Laravel Developer, but you don’t know what is the Collections class, nor how to use or what functionality it has.

3- If you told me that you are a PHP developer, but you can’t setup Vagrant on your computer.

4- If you told me that you are an old Mac user, but you don’t know how to deal with the Terminal, nor how to solve permission denied error.

So yes, at this point, I’ll start to shout and start with the sentence are you a developer?

I can’t help it, if you are a developer, then you should respect this word, and try to be good at it. Most of those who called developers out there have earned this title by working hard on learning so you are not an exception.

Filed under: Other

Should we keep working 24/7

In the past few months, and the last year, everyone around me (and most of them from the EU/US) talked about how you should not be working 24/7 and that you should always take a break, have fun and enjoy the life after work.

I don’t blame them, I mean it’s not easy to work 24/7, it’s not easy to run after your dream all the time, or at least try to improve your life and the life of those around you all the time, it’s not easy and won’t be. But those forget something, forget that the lifestyle you have in the EU/US is not the same that everyone around the world is having, for example, a recent article was talking about the hourly rates for the freelancers around the world, and am not talking about the whole world, am just going to talk about the one in my region, they said that the average is about $60/h (based on a sample from 130 persons from one country, Lebanon) so yes they have generalized 381Mpeople (based on Wikipedia: The population of the MENA region at its least extent is estimated to be around 381 million people.) with only 130 person, so am pretty sure that this info is not correct, at least in my personal experience, in 10y of my work I didn’t reach that hourly price at all.

Continue reading

Filed under: Business, Personal