Hi there

Thank you for visiting! I’m a Software Engineer learning things

Use Golang Migrate on Docker Compose

Previously I setup docker compose for golang application and PostgreSQL. It can run the application and can connect to PostgreSQL. While doing basic CRUD, I found that I need a tool to migrate my database structure and seed the database for easy onboarding and development. Thus I want to use golang-migrate to do that. What Is Golang Migrate Contrary to the name, it is not a migration tool specifically created for golang development, although we can use it as a golang package in your application....

May 25, 2024

Golang: Keep JSON String as JSON. Or Dynamic JSON in Golang

The Problem I want to use response where the content field comes from external API response which will return varied formats. For example: { "souce": "http://guesthost.com/check-in", "payload": { "token" : "somerandomtoken", "id" : "1up" }, "content": { "name": "John Doe", "occupation": "Doctor" } } or { "souce": "http://localhost.com/hello-world", "payload": { "token" : "somerandomtoken", }, "content": { "status": 404, "message": "Missing resource or wrong naming" } } If you come here you should know that the usual way for Golang to create JSON is using struct then convert it to JSON string using json....

May 24, 2023

ImportError libffi.so.7 cannot open shared object file No such file or directory on Manjaro

This error happened after I try to run a Django project on Linux(Manjaro) after an sistem update. ImportError: libffi.so.7: cannot open shared object file: No such file or directory What Have I try: Install libffi using pacman pacman -Sy libffi The installation is successful but the error persists. Delete and recreate virtualenv it did not help neither. Solution Install That specific libffi.so.7 I use yay to search for suitable package to install...

December 13, 2021

Testing Set Up in Golang

File conventions, function naming conventions, how to separate test to test cases, send output (fmt.Println-ish), mark the test as fail ...

November 30, 2021 · Yanuar Arifin

Dockerize Laravel Application Using Laradock

Create Docker containers for Laravel, MySQL, and PhpMyAdmin without fiddling with Dockerfile and docker-compose.yml. ...

June 20, 2021 · Yanuar Arifin

Laravel 7.x Seeding

Laravel Version: 7.x(7.24) Seeding is one of my favorite tools that helps my development tremendously. This is how you could insert some(I mean whatever amount you want) records to database. Using Faker library to randomize the value, you could specify how far the randomness of your record values are. Check what Faker Provider could do and there’s additional Faker Provider Collection to step up your faking game. Just clone a project from the cloud?...

September 14, 2020

Dbeaver Jump Server Tunneling Problem On Linux

Overview I want to connect to remote MySQL server using DBeaver on linux. Note I need to connect jump server before I could open a connection to the database server. On Windows I could do that using Putty tunneling by SSH to first server, then from that server, I SSH second time to the DB server and tunnel the connection to a port. Using this recipe does not work on linux in my case....

February 26, 2020

docker-compose.yml for Golang Development

Hi, test things

February 26, 2020

Using For Loop In Alpine JS

The steps are: add alpine.js to head section of your HTML create loop data get data on template loop and show data Create Loop Data Make a function inside a script tag just above the </body> tag ... <body> ... <script> function theData() { return { produk: [ { name: "Boaty McBoatface", price: "$300.000", }, { name: "WD-40", price: "$45.000", }, { name: "Bugs for lyfe", price: "$105.000", }, ]}; } </script> </body> Get Data to HTML We need to make it available on the HTML....

February 26, 2020

uRxvt's .Xresources Not Loaded Properly on Manjaro

The Problem When I open urxvt after booting up the linux, it is terrible. The hide scrollbar part is working, but the color is off, way off. I wanted to use solarized-dark color theme, but the display it shows is pink text color on pink backgroud. I couldn’t see the text!! The config is working properly only after loading the resource file with xrdb ~/.Xresources. What I Wanted To Do I wanted to use urxvt to replace gnome-terminal as my terminal because it has more feature(I think) than the latter....

June 16, 2019