port forwarding in xfinity
This article is part of my Today I Learnt. I have been trying to share whatever I learnt newly on the day. Some of them are basic, but still I want to write it down for two reasons.
- To help me understand the concepts better
- Potential help other people who running in to same issue.
Alright, It’s all started when I bought a new domain (synergy.net) for my Dad. Who doesn’t like yet another domain for their future project? He wanted a blog, so I thought it would be nice to host a ghost [1] blog on my Raspberry Pi which has been sitting idle on my desk. As like every good netizen, I did a Google search and found this medium article [2] which exactly solves what I want. Software installation went fine and I reached the step of forwarding traffic to my Raspberry Pi.
Understanding .phony in makefile
This is a crosspost from my TIL
What the heck is .PHONY in makefile? I have seen this for so long but I always shrugged off. Whatever that is. Well, finally I decided to learn about it.
A bit of introduction to Makefile syntax.
target: prerequisites
<TAB> recipe
The first target in a Makefile will be executed by default when we call make.
blah: blah.o
cc blah.o -o blah # Runs third
blah.o: blah.c
cc -c blah.c -o blah.o # Runs second
blah.c:
echo "int main() { return 0; }" > blah.c # Runs first
In the above example, blah, blah.o and blah.c are targets and they are all files.
Understanding libpq in Postgres, Debian and Go
Libpq-Postgres-Go
After I started working on Postgres, I have heard this term libpq enough times, but never had a good grasp of it. After digging around this topic for a couple of days, here is my understanding.
From the Postgres doc https://www.postgresql.org/docs/9.5/libpq.html,
libpq is the C application programmer’s interface to PostgreSQL. libpq is a set of library functions that allow client programs to pass queries to the PostgreSQL backend server and to receive the results of these queries
Here is one way how I can help
This aricle is inspired by [Give and Take] (https://www.adamgrant.net/give-and-take) by [Adam Grant] (https://www.adamgrant.net/). I was wondering how can I help my friends and network. Searching a job is something stressful and we all have been through. Once my wife and I searched for a year and finally we moved to San Francisco.
So far its been a challenge for my network to know whether I can refer to a particular company. To solve this, I am publishing a list of companies where I can refer. If you don’t know, now you know (Yeah, we have been watching a lot of Trevor Noah shows)
How to deploy a cloud run application using Gitlab CI/CD
In Google Cloud Next 2019, they introduced a new product called [Cloud Run] (https://cloud.google.com/run/). I’ve been using it from the EAP (Early Access Program) days. [As the name suggests, basically it runs your docker image. You might be familiar with other serverless products such as [Cloud Function] (https://cloud.google.com/functions/) or [lambda] (https://aws.amazon.com/lambda/) where you provide your source code instead of a docker image. In my opinion, Cloud Run is more flexible than functions. Let me explain why.
Part 2/2: How to set up HAProxy for an active-active postgres databases
Step 1: Setting up HAProxy
I hope you gone through [Part1] (https://viggy28.dev/article/postgres-active-active-replication/) of this series. Perhaps, one thing you might have noticed is that I’ve to connect to the specific master database. In our case, since both the databases are running on docker, only the localhost port is different. (In a production environment, most likely you going to run the databases on a different host). The main reason for active-active replication is high availability. If one of the nodes goes down, you still want your application to behave normally. You don’t want to hard-code your DSN on the application or keep checking the health of the database every time before you make a connection. Fair enough. [HAProxy] (<www.haproxy.org>), an open source project solves this particular change.