Skip to content

Instantly share code, notes, and snippets.

View abmmhasan's full-sized avatar
:octocat:
Going well!!!

A. B. M. Mahmudul Hasan abmmhasan

:octocat:
Going well!!!
View GitHub Profile
@abmmhasan
abmmhasan / DNS Servers.md
Last active December 5, 2024 06:50
DNS server/providers list

Popular providers

Provider Type Primary DNS Secondary DNS
Cloudflare Global 1.1.1.1 1.0.0.1
Cloudflare Secure 1.1.1.2 1.0.0.2
Cloudflare Secure+Family 1.1.1.3 1.0.0.3
Google Global 8.8.8.8 8.8.4.4
Quad9 Secure 9.9.9.9 149.112.112.112
OpenDNS Global 208.67.222.222 208.67.220.220
@abmmhasan
abmmhasan / Git Cheatsheet.md
Last active March 15, 2025 03:50
Git Cheatsheet

Basic

## Unstage files
git restore --staged .

## Change last commit message (1st one will open editor)
git commit --amend
git commit --amend -m "New commit message"

## Add another repo in existing
@abmmhasan
abmmhasan / Pi-Hole Setup.md
Last active December 5, 2024 06:49
Setting up your own Ad-blocking DNS server is easy with Pi-Hole! It also gives you full control as it, itself act as a DNS server(obviously with help of your chosen Global DNS providers).

1. Buy a Raspberry Pi (or any low-cost PC build)

At first buy a Raspberry Pi (I recommend Zero edition for minimum cost) with casing (official one is enough for Zero). My configuration:

  • Rapberry Pi Zero with Official Casing (used the Cover with Center Hole)
  • MicroSD card
  • Micro-USB to LAN converter (can be replaced with OTG Cable + USB to LAN converter)
  • Micro-USB power cable
  • LAN connection cable

2. Prepare OS

@abmmhasan
abmmhasan / PostgreSQL Queries and Commands: Export_Import.sql
Last active January 9, 2024 04:12
Useful PostgreSQL Queries and Commands
-- Import(FROM) / Export(TO) CSV file from/into a table
-- Ref: https://www.postgresql.org/docs/current/sql-copy.html
-- If processing all columns, no need column specification
-- If CSV file don't include header, remove 'HEADER' from below query
-- For Export, can also specify Query, instead of Table & Column name
COPY table_name (column_1, column_2, column_3, column_5)
[FROM/TO] 'csv_file_location' DELIMITER ',' CSV HEADER QUOTE '"' ESCAPE '"'
-- Dump database on remote host to file
-- Ref: https://www.postgresql.org/docs/current/app-pgdump.html