docker-machine for better Docker on OSX

faster docker on macA while ago I published a blog post about Dockerizing my php development environment, soon after that I learned about the poor i/o performance of docker-containers on MacOSX. 

While that is manageable for small projects where there are not much I/O happening between multiple containers, I was stunned by how bad it could get after starting to work with my new company.

Continue reading “docker-machine for better Docker on OSX”

Fix: Adaway no free space problem on miui/xiaomi.eu roms

If there is one reason for me to root my devices that would be system wide AdBlocking without compromising battery and performance.

That being said Adaway has been my best friend for the past 5-6 years and I’ve had it on every single Android based devices of mine.

a while ago I picked up an Xiaomi Mi Pad 4 for multimedia purposes which immediately after receiving it I attempt to unlock. The process took a good 7 days of my time (thanks to xiaomi). Anyway I flashed xiaomi.eu and magisk afterwards.

When I tried to apply Adblocking on Adaway I got this message that there is not enough disk space left on some system partition, and Adaway was suggesting me to change the target hosts file location to /data/data/hosts and creating a symbolic link. Doing some researches I was not able to find a clean solution (other than creating a symbolic link manually in recovery mode).

So I found that this can be resolved by using systemless hosts feature in magisk.

  • Point back the target hosts file to /etc/hosts
  • Open Magisk manager
  • Click on “Systemless Hosts” in Magisk’s settings
  • Reboot your device
  • Launch Adaway and re-apply Adblocking! 

Thats all, that should do it, I hope it helps some of you folks out there.

a week with Macbook Pro 2019

Story

The 13 inch Macbook Pro 2016 was the first of them with the new design & chassis that I owned. Back then when it was still new most of the reviews were around how replacing all those I/O ports with USB-C a headache for the users.

as I remember, I couldn’t care less about any of those issues. All I wanted was to replace a 17 inch brick pro from 2011 with something lighter with a greater battery life, so I pretty much settled on the idea of dongles before even receiving my device.

Continue reading “a week with Macbook Pro 2019”

Setting up dnsmasq on MacOS with Homebrew

So earlier I posted about my decision to Dockerize my entire development environment. In that post I mentioned that you can either manually edit your /etc/hosts file or install a dns server to point domains to your local web server.

Disclaimer: this nothing to do with Docker, this steps are can be used even if you are running your own instance of web server directly on your machine.

dnsmasq is a simple DNS server that does a lot but it is not as complicated and full featured as stuff like BIND. In this article I will be using dnsmasq to spoof all the DNS requests to “.test” domain to my own local machine. Having my web server running (nginx) and listening for domains set on the virtualhost configurations I will then be able to serve my apps locally.

Continue reading “Setting up dnsmasq on MacOS with Homebrew”

LaraDock: Dockerizing my PHP Development Environment

As a PHP Developer I’ve always had instances of webserver, php & database server running as first level services on my Development machines. I can claim that configuring LAMP (recently LEMP) stack was always one of the first things I’d do when I get a new machine.

I’ve been using Docker for running other services such as Redis, Mongo, Elasticsearch, Neo4J and … but today I am going to completely configure my development environment on top of containers on my new Mac.

Thanks to LaraDock this process should be much easier and smooth. For those of you who don’t know about LaraDock, it’s a set of containers with configurations templates that can come handy to any PHP developers.

Although the project is targeting Laravel developers, but any PHP developer can benefit from these tools.

Why the change?

Running a traditional LAMP/LEMP stack setup has no issues, but occasionally there are some glitches time to time that I’m hoping to avoid by fully going Dockerized.

  • I realised sometimes OS updates (Specially Major Updates) can mess up with services installed on the machine. This is simply inevitable and has happened to me multiple times so far. So this way I only need to make sure my Docker service is running.
  • I realised that I hesitate more on updating my services fearing that they may break. I believe going with Docker should make the process of upgrading those services easier.
  • Things sometimes break! I remember when homebrew simply changed where formulas for PHP were, they added it to the core formulas and I had a hard time updating from PHP 7.0 to 7.2.

I’ll however install php itself on the machine for times that I want to run php scripts within the console or work with the PHP Built-in Webserver.

LaraDock comes with many containers, but I am more interested in a LAMP stack of containers, so we will be starting nginx, mariadb, php-fpm and make sure they will be always up by modifying the restart-policy variable.

Continue reading “LaraDock: Dockerizing my PHP Development Environment”