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 / wget
Created October 11, 2023 08:05 — forked from bueckl/wget
Wget examples
#Spider Websites with Wget – 20 Practical Examples
Wget is extremely powerful, but like with most other command line programs, the plethora of options it supports can be intimidating to new users. Thus what we have here are a collection of wget commands that you can use to accomplish common tasks from downloading single files to mirroring entire websites. It will help if you can read through the wget manual but for the busy souls, these commands are ready to execute.
1. Download a single file from the Internet
wget http://example.com/file.iso
2. Download a file but save it locally under a different name
wget ‐‐output-document=filename.html example.com
@abmmhasan
abmmhasan / Change Docker container storage location.md
Last active February 7, 2024 14:40
Change Docker container storage location

Windows:

  • Quite docker desktop
  • Open command prompt/powershell
  • List packages (& take note of the name you wanna move, i.e. docker-desktop-data)
wsl --list -v
  • Turn off wsl
wsl --shutdown
@abmmhasan
abmmhasan / DNS Servers.md
Last active November 15, 2024 06:03
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 4, 2024 06:37
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 October 25, 2023 12:48
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