Skip to content

Instantly share code, notes, and snippets.

View ankurk91's full-sized avatar
⛈️
Moving to Cloud

Ankur K ankurk91

⛈️
Moving to Cloud
View GitHub Profile
@ankurk91
ankurk91 / cloudwatch-agent.md
Last active June 1, 2025 02:49
AWS Cloudwatch agent setup on EC2

Install CloudWatch Agent on AWS EC2

Install CloudWatch Agent

Download the cloudwatch agent from the AWS Official Docs according to your platform.

Assuming that you are running Ubuntu with x86_64 architecture on your EC2

@ankurk91
ankurk91 / laravel-project.conf
Last active June 1, 2025 11:50
Ngnix conf with php/node on Ubuntu
# /etc/nginx/sites-enabled/laravel.conf
server {
listen 80;
# listen 443 ssl;
# ssl_certificate /etc/nginx/certs/laravel.test.pem;
# ssl_certificate_key /etc/nginx/certs/laravel.test-key.pem;
server_name laravel.test *.laravel.test;
@ankurk91
ankurk91 / docker-compose.yml
Last active February 8, 2025 05:49
My docker compose for local development
services:
postgres17:
image: 'public.ecr.aws/docker/library/postgres:17-alpine'
container_name: postgres-17
restart: unless-stopped
ports:
- "${FORWARD_PGSQL_PORT:-5432}:5432"
volumes:
- pg-17-data:/var/lib/postgresql/data
healthcheck:
@ankurk91
ankurk91 / dnsmasq.md
Last active October 8, 2024 06:43
DNSmasq on Ubuntu 18/20

DNSmasq wildcard on Ubuntu 18/20

  • Install dnsmasq
sudo apt install -y dnsmasq
sudo apt install -y resolvconf
  • 💡 The dnsmasq service will fail to start, you can ignore those errors for time being
  • Disable the default systemd-resolved service
@ankurk91
ankurk91 / phpstorm-install.sh
Last active January 2, 2025 08:43
Install Postman, PhpStorm on Ubuntu Linux (no snaps)
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# Run this script without sudo
# bash script_name.sh
INSTALL_TMP_DIR=~/phpstorm-tmp
mkdir -p $INSTALL_TMP_DIR
@ankurk91
ankurk91 / postgresql-ubuntu.md
Last active October 8, 2024 06:44
PostgreSQL Database on Ubuntu 20/22/24

PostgreSQL on Ubuntu

⚠️ I would rather recommend to install PostgreSQL inside docker.

Add PPA Source

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
@ankurk91
ankurk91 / laravel_horizon.md
Last active January 23, 2025 05:08
Laravel Horizon, redis/valkey-server, supervisord on Ubuntu server

Laravel Horizon, redis-server, supervisord on Ubuntu 20/22/24 server

Laravel 10+, Horizon 5.x, Redis/Valkey 7+

Prepare application

  • Install and configure Laravel Horizon as instructed in docs
  • Make sure you can access the Horizon dashboard like - http://yourapp.com/horizon
  • For now; it should show status as inactive on horizon dashboard

Install redis-server

@ankurk91
ankurk91 / 1-elementary-os-apps.md
Last active November 1, 2024 15:07
elementary OS 5.1 Hera

elementaryOS Apps and Configs

⚠️ No longer maintained! ⚠️

This guide has been updated for elementaryOS v5.0+.

Enbale PPA support

sudo apt-get update
sudo apt-get -y install software-properties-common
@ankurk91
ankurk91 / mac-apps.md
Last active October 8, 2024 06:45
Mac OS 10.15 Apps and configs

macOS Apps

⚠️ No longer maintained! ⚠️

# Install x-code command line tools 
xcode-select --install

# Install homebrew itself
@ankurk91
ankurk91 / bash_profile.md
Last active October 22, 2023 12:16
:octocat: Git branch name in Linux/Mac Bash Terminal

Mac OS : Show your git branch name on your bash terminal

⚠️ Does not work in zsh terminal

Add these lines in your ~/.bash_profile file

# Show current git branch name
parse_git_branch() {
     git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}