Skip to content

Instantly share code, notes, and snippets.

View fahadsiddiqui's full-sized avatar

Fahad Siddiqui fahadsiddiqui

View GitHub Profile
@fahadsiddiqui
fahadsiddiqui / go_chan_wg.go
Created May 9, 2024 06:33
Go routines, channels and wait group demo.
package main
import (
"log"
"math/rand"
"sync"
"time"
)
type Report struct {
@fahadsiddiqui
fahadsiddiqui / find_string_in_certain_files.sh
Created February 20, 2024 14:44
Find/grep all occurrences of certain string in all the files ending with certain extension.
find . -type f -name "*.env" | xargs grep "HTTP_PORT"
@fahadsiddiqui
fahadsiddiqui / generate_gitignore_go.sh
Created November 27, 2023 05:36
Generate .gitignore file for a Golang based basic project.
#!/usr/bin/env bash
wget https://www.toptal.com/developers/gitignore/api/go -O .gitignore
@fahadsiddiqui
fahadsiddiqui / keybase.md
Created August 11, 2023 16:03
Keybase public identity.

Keybase proof

I hereby claim:

  • I am fahadsiddiqui on github.
  • I am fsdqui (https://keybase.io/fsdqui) on keybase.
  • I have a public key ASCL3APHaktYii4s1q9LPl5zfZmD2hhyGkTG2QevG2GatAo

To claim this, I am signing this object:

@fahadsiddiqui
fahadsiddiqui / install-hadoop-mac-apple-silicon.md
Last active June 27, 2023 21:00
Install Hadoop on Mac (M1, M2) with Apple Silicon
  • Install brew (Homebrew)
  • Install hadoop
    brew install hadoop
  • cd into hadoop configuration files
    cd /opt/homebrew/Cellar/hadoop/3.3.4/libexec/etc/hadoop
    
@fahadsiddiqui
fahadsiddiqui / docker_ps_pretty_print.md
Last active September 1, 2021 18:33
Program details docker handy commands.

Format out of Json using docker inspect

docker ps -q | xargs docker inspect --format '{{ .Id }} - {{ .Name }} - {{ .NetworkSettings.IPAddress }}'

Format docker ps

docker ps --format="{{.Names}}\t{{.ID}}\t{{.Ports}}"
#!/usr/bin/env bash
set -ex
PWD=$(pwd)
mkfifo /tmp/servicelogs.pipe || echo "pipe already exists"
runningPIDs=()
exitfn () {

First run the one below to be able to install pg_config

brew install postgresql

Install openssl

brew link openssl
@fahadsiddiqui
fahadsiddiqui / md_tree.sh
Last active October 20, 2020 10:46
Markdown-safe tree creation using bash command `tree`. Just go to the project root, and run it.
tree . -aF --dirsfirst -I '.git|node_modules|.idea' | sed -e 's/│/|/g' -e 's/└/+/g' -e 's/├/+/g' -e 's/──/--/g'
@fahadsiddiqui
fahadsiddiqui / .hyper.js
Created September 10, 2020 19:59
My Hyper.is terminal configuration.
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',