Skip to content

Instantly share code, notes, and snippets.

View eftakhairul's full-sized avatar
💭
writing code for spaceship :P

Md Eftakhairul Islam eftakhairul

💭
writing code for spaceship :P
View GitHub Profile
@eftakhairul
eftakhairul / Nginx Default Configuration
Created September 11, 2012 19:12
Nginx Default Configuration in located /etc/nginx/conf.d/default.conf
#
# The default server
#
server {
listen 80;
server_name _;
#charset koi8-r;
#access_log logs/host.access.log main;
@eftakhairul
eftakhairul / Makefile
Created February 2, 2021 18:55 — forked from kwilczynski/Makefile
Makefile for my Go projects (an example).
SHELL := /bin/bash
REV := $(shell git rev-parse HEAD)
CHANGES := $(shell test -n "$$(git status --porcelain)" && echo '+CHANGES' || true)
TARGET := packer-provisioner-itamae-local
VERSION := $(shell cat VERSION)
OS := darwin freebsd linux openbsd
ARCH := 386 amd64
@eftakhairul
eftakhairul / exportDB.sh
Last active June 16, 2020 21:49
Export mongodb database into JSON files, and import the JSON again.
#!/bin/bash
if [ ! $1 ]; then
echo " Example of use: $0 database_name dir_to_store"
exit 1
fi
db=$1
out_dir=$2
if [ ! $out_dir ]; then
out_dir="./"
@eftakhairul
eftakhairul / System Design.md
Created May 6, 2020 04:34 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@eftakhairul
eftakhairul / killport
Created April 25, 2020 03:39
killport tool
#!/bin/bash
# Kill process on requested port
# Author: Md Eftakhairul Islam
if [[ $# -eq 0 ]]; then
echo "Port is not specified"
exit 1
fi
#!/bin/bash
iatest=$(expr index "$-" i)
#######################################################
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me
#######################################################
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
@eftakhairul
eftakhairul / Introduction to Ruby
Last active October 2, 2019 18:06
Some snippets of Ruby on Knowledge Sharing Session -Ruby at Mangoes Mobile
=begin
author Eftakhairul Islam <eftakhairul@gmail.com>
website http://eftakhairul.com
=end
#My First Program at Ruby.
puts 'Hello World'
puts ("I'm here")
@eftakhairul
eftakhairul / ES5 class.js
Created August 29, 2019 04:22 — forked from apal21/ES5 class.js
Example for blog to show the difference between ES5 and ES6 javascript classes using inheritance and prototypes use cases.
'use strict';
/**
* Person class.
*
* @constructor
* @param {String} name - name of a person.
* @param {Number} age - age of a person.
* @param {String} gender - gender of a person.
*/
@eftakhairul
eftakhairul / file_backup.sh
Last active March 6, 2019 09:58
Dump backup scripts
#!/bin/bash
DB_DIR='file-dumps'
rsync -avz DB_DIR app@ip_address:/home/app/backup
echo "Dump has been synced successfully at $(date)" >> /tmp/dump_cron_log.txt
@eftakhairul
eftakhairul / config.go
Created January 28, 2019 06:14 — forked from chazcheadle/config.go
Golang Viper config read into struct
package main
import (
"fmt"
"github.com/spf13/viper"
)
// Create private data struct to hold config options.
type config struct {