Skip to content

Instantly share code, notes, and snippets.

@ajazfarhad
ajazfarhad / Internal-load-balancer.yml
Created June 27, 2022 11:36
GKE Internal load balancer service
apiVersion: v1
kind: Service
metadata:
name: shop-api-internal-load-balancer
namespace: staging
annotations:
networking.gke.io/load-balancer-type: "Internal"
spec:
ports:
- port: 80
@ajazfarhad
ajazfarhad / milligram_css.rb
Last active April 9, 2021 14:51
Add Milligram css to your Rails app using Webpacker with this app template.
# rails app:template LOCATION=https://gist.githubusercontent.com/ajazfarhad/53eb05cfd435840d09a6ab5037d7e955/raw/f8c4e850665e800d357da5f0c2555bd84a7ee679/milligram_css.rb
def yarn(package)
run("yarn add #{package}")
end
yarn 'milligram'
inject_into_file 'app/views/layouts/application.html.erb', before: '</head>' do <<~EOF
<%= stylesheet_pack_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
@ajazfarhad
ajazfarhad / sc_script.sh
Created November 5, 2020 10:04
Secure file transfer on Fargate service
#!/bin/bash
CLUSTER="cluster-name"
SERVICE="service/service-name"
last_parameter=${@:$#} # last parameter
other_parameters=${*%${!#}} # all parameters except the last
helpFunction()
{
@ajazfarhad
ajazfarhad / docker-compose.yml
Created May 12, 2020 13:00
docker-compose file for Rails API and Datadog Agent
version: "3.7"
services:
db:
image: postgres
environment:
POSTGRES_PASSWORD: password
volumes:
- ./tmp/db:/var/lib/postgresql/data
@ajazfarhad
ajazfarhad / Dockerfile
Created May 12, 2020 12:50
Dockerfile for Rails application
FROM ruby:2.6
RUN apt-get update -qq && apt-get install -y nodejs postgresql-client
# nodejs
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg -o /root/yarn-pubkey.gpg && apt-key add /root/yarn-pubkey.gpg
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install -y --no-install-recommends nodejs yarn