Skip to content

Instantly share code, notes, and snippets.

View itsmunim's full-sized avatar
💂‍♂️
Extension over Modification...please!

Md Abdul Munim itsmunim

💂‍♂️
Extension over Modification...please!
View GitHub Profile
@itsmunim
itsmunim / action.yaml
Created December 29, 2021 06:51
An action that can be used to apply kustomize based kubernetes manifests in a digitalocean cluster
name: "Deploy into Kubernetes"
description: "Deploys the service into kubernetes"
inputs:
digitalocean_token:
description: "Personal access token to use digitalocean CLI"
required: true
cluster_name:
description: "Name of the kubernetes cluster"
required: true
name: deploy-to-doks
on:
push:
branches:
- master
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
name: provision-infra
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
terraform {
required_providers {
digitalocean = {
source = "digitalocean/digitalocean"
version = "~> 2.0"
}
}
backend "s3" {
endpoint = "https://sgp1.digitaloceanspaces.com"
apiVersion: apps/v1
kind: Deployment
metadata:
name: api
labels:
app: api
spec:
replicas: 3
selector:
matchLabels:
#!/usr/bin/env bash
# Creates a certificate authority cert & key; this you can use as CA for your self-signed certs
function create_ca() {
openssl req -new -x509 -nodes -days "${1}" -keyout ca.key -out ca.crt
}
# Creates a private key and a respective csr
function create_csr() {
openssl req -new -newkey rsa:2048 -nodes -keyout "${1}".key -out "${1}".csr
const ref = React.createRef();
// ...
return (
<ScrollToStick applyOn={ref} offset={60}>
<div className="header-wrap" ref={ref}>
<header>
<div className="logo"></div>
<div className="brand-title"></div>
</header>
@itsmunim
itsmunim / Dockerfile
Last active April 19, 2020 16:39
Multi stage docker build for NodeJS Service
# installation step #
FROM node:lts-alpine3.9 AS builder
ENV BUILD_DIR /build
RUN mkdir -p $BUILD_DIR
WORKDIR $BUILD_DIR
COPY . $BUILD_DIR/
RUN npm install --no-audit
# if you have any build step, you should include that
# in this stage as well. e.g. npm run build
@itsmunim
itsmunim / easyhacks.md
Last active April 3, 2020 07:23
Use git the right way with these aliases

🕺Easy Hacks with Git Alias 🕺

👊To make things easier with git, I have created a few git aliases as well as few bash aliases.

👀Combining these two, I do power use of git commands during my daily development.

🤘Sharing here so that you can do the same!

@itsmunim
itsmunim / .bash_profile
Created April 3, 2020 07:06
Necessary bash profile aliases
# git shortcuts
alias fetch="git fetch origin"
alias push="git push origin" # push to branch
alias fpush="git push -f origin" # force-push to branch
alias pull="git pull --rebase origin" # always do safe pull from a remote branch to avoid any merge commits getting created
alias clr="git cleanup" # deletes the branches which are already merged
alias rrw="git pull --rebase origin" # remote rebase with
alias delbr="git br -D"
alias delall="git branch | grep -v 'master' | xargs git branch -D" # del all local branches except master
alias rename="git co master && git br -m ${1} ${2}" # rename branch 1 to 2