Running Docker containers in production normally doesn't need mounting local files or dirs. But when using Docker for development, it makes sense to mount the source code to avoid re-building the Docker image on every change. That looks straight forward except for some cases.
Some files or directories are generated by package managers or compilers during the compile time. They should be generated as part of the Docker image build and should stay untouched during runtime. On the other hand, mounting other files that need to be changed constantly during development is necessary.
This post uses an example app to experience different ways of using Docker volumes and learn about their pros and cons.
List the cards contents after a given card content inside the browser. Useful to generate a quick report from your Trello board.
I needed to move a DigitalOcean Droplet to AWS which was running a Docker application using Docker Compose and had its SSL configured using Let's Encrypt. I couldn't find an easy way to convert the DigitalOcean disk snapshots to AWS EBS ones, otherwise, the whole disk could be cloned in AWS with much less effort since Linux configuration is all about the filesystem. I ended up installing needed packages on the target machine and move the configurations. Since I tested everything and it was successful I figured it might be useful to put all the commands and steps in the same place as a quick step-by-step guide. Also, the exact same steps apply to any other cloud as well as the other way around, from AWS to DigitalOcean.
Use this code snippet when you need to see the generated HTML by active mailer in the browser.
To list users who haven't enabled MFA on their AWS accounts:
You can use these regular expressions and replacement expressions inside your favorite editor when you need to unify your YAML file to use double quote for all strings.
For example converting:
key1: value 1
key2: 'value 2'
key3: 'value "3"'
key1: "value 1"
key2: "value 2"
key3: "value \"3\""
Focusing on the same task for a long time has always been a big challenge for me. Based on my online research I've convinced that I might suffer from ADD, though I find many in the software industry who look like suffering from ADD, OCD, or both.
Whether we suffer from ADD or developed a similar behavior as a symptom of our lifestyle, we can build new habits that not only keep us calm and relaxed but also improve our productivity and quality of work that leads to creating better software and ultimately a better world!
In this post, I'm going to share my experience, methods, and habits that helped keep myself calm, focused, and available, especially at my job as a software engineer particularly, in this pandemic situation where we work remotely.
The event-driven design has already been around for a while. Like many other trendy patterns, it's far older than what we think. Before the web era, it was quite normal to design stand-alone desktop applications using this design. But it is even older than that. It has already been used massively since the mainframe era (and probably even before).
This is the story of how I learned about event-driven design without even knowing what it's called in the late 90s when I was just getting started to learn how computers work.
I use analogy whenever I need to explain something in the clearest and fastest possible way. Gaining knowledge in an abstract manner is hard and costly. Using existing knowledge as a foundation speeds up the learning process and prevents misunderstandings. When a C# developer, for instance, asks me what's
flatMap in Scala, I'll ask if they know what's
SelectMany? If they do, explaining how
flatMap works on non-list types would be far faster and easier.
Now let's do this with Kubernetes and AWS. Let's see what are the Kubernetes components closest equivalents in AWS.
The point is that an analogy doesn't provide a deep understanding of a new concept, but it provides the foundation to speed up the learning process. So don't expect a conclusive 1:1 mapping from Kubernetes elements to AWS.
A while ago, I decided to give Firefox a try. Here I'm going to share why and how it happened. Also I'll share how I configured my work and personal browser profiles on my Gnome desktop.
OK, you came to the conclusion that type-safety is good. It helps you get things
done in a safer manner, at least for whatever you’re working on at the moment.
So you started using types more than before to describe what a piece of code
does without the need to run. In another word, to bring forward unwanted errors.
Sometimes, we need to invoke our own brain to describe some facts about itself but in a more pleasant way to help ourselves move on. It’s not a bad thing at all, but I prefer to know the scientific facts, no matter what’s the cost.
SBT is the main build tool for Scala projects. It's simply one of the most powerful build tools available. You're not limited to a single method for doing a specific job and there is no predefined and restricted rules. You can automate things as much as you want. And the good news is that SBT tries to run the tasks in parallel as much as possible.
Choosing the best editor/IDE for your favorite programming language is not as easy as it seems to be. Obviously, that's not the case if you work with the main-stream technologies or if you don't consider yourself a geek programmer!
Right now, Scala is my favorite language and fortunately, contrary to what most developers think, there are a good number of available choices as editor/IDE. This post is about my experiences of using these tools.
Several month ago, I left Ubuntu for Arch. This post is about my experiences and the reasons that led me to move back to Ubuntu.
Update 2017-01-21: As the VirtualBox bug, which made me go back to Ubuntu, is resolved, I couldn't resist going back to Arch. This time I tried i3 instead of a full fledged DE and I'm very happy so far.
I'm not sure if it's a good name but as we inject types into our classes, type injection seems a good name. I used this technic in my latest project to build a database-agnostic data-access layer on top of Slick 3.
If you use Linux and encrypt your home folder, you may get the following error when compiling a SBT project:
[error] File name too long
[error] one error found
[error] (compile:compile) Compilation failed
Andorid SDK is a 32-bit application and needs some extra works to run on a 64-bit Arch Linux.
Default internationalization support in Play works with cookies which is not SEO-friendly. It would be very nice if it was possible to use route parameters instead of cookies but as Play routes are (nicely, truly and correctly) type-safe, this will come at some cost; verbosity. Albeit it's not true for smart people who code in Scala :D
Multi-JVM tests are the default way of testing an Akka cluster sharding application. But sometimes you just need the sharding functionality where multi-JVM tests are just overkill. I didn't find any sample or guide describing the best practices for this situation.
I don't use services like Heroku as deployment infrastructure. They are amazing but I have my reasons.
There are plenty of reasons why functional programming are becoming mainstream, but I came across the one I think is the most visible.