Use a Custom Domain for Your Local Docker Containers with `caddy-docker-proxy`
I recently discovered that using caddy-docker-proxy is an excellent solution for setting up local domains for my Docker containers. It has become my go-to reverse proxy setup for Docker containers. Nginx Proxy Manager VS Caddy Docker Proxy Before this, I was using Nginx Proxy Manager, which works great if you’re using verified public domains. But for local development, it’s needs extra work, which I don’t have time for. While I did consider using self-signed SSL certificates, the setup process seemed more trouble than it was worth. ...
Import 10GB SQL script successfully using source command
If you’ve ever tried importing a large .sql file using GUI tools like DBeaver, SQLyog, or HeidiSQL, chances are you’ve seen them freeze, timeout, or crash when the file is too big. I’ve personally experienced this multiple times — especially when working with SQL files larger than 1GB. But here’s the tool that just works, even for a 10GB+ SQL script: the source command in the MySQL (or MariaDB) CLI. ...
setup docker for MySQL
Overview This is how I setup MySQL in docker for development so I can just copy and paste this. create volume create volume for saving data, by creating volume, it will make sure that tis volume is readable for our project. else it will use the parent directory name where the docker-compose.yml is located. If you use volume from inside MySQL container, the data will be lost when the container stops. ...
Github Workflow Keeps Old Failed Workflow from Old Config
Open your eyes. See the workflow name, or the file source where the workflow comes from. It was an old workflow file that have been replaced.
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. This tool is a CLI tool that can be installed on Windows, Mac, and Linux. As a CLI tool, it means that no matter what language you use to code, your migration can be managed using this golang-migrate. ...
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.Marshal(). But the downside is we need to create every Struct for each JSON if we want to represent all those formats. Like my current problem. ...
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 ...
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 ...
Dockerize Laravel Application Using Laradock
Create Docker containers for Laravel, MySQL, and PhpMyAdmin without fiddling with Dockerfile and docker-compose.yml. ...
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? migrate then seed the database Think that your database values is confusing to manage? empty then reinsert data Make a new table but too lazy to populate it? just run Seeder Has migration with many tables and its a mess to seed the data? Use Seeder All with a simple CLI command. ...