Skip to content

Instantly share code, notes, and snippets.

View jd-apprentice's full-sized avatar
❤️
Enjoying life!

lalala jd-apprentice

❤️
Enjoying life!
View GitHub Profile
@rameerez
rameerez / postgres-production-setup.sh
Last active August 11, 2025 16:06
PostgreSQL Production Server Setup - Set up a new Ubuntu Server 24.04 LTS machine to run a production Postgres server
#!/bin/bash
# This script takes a clean Ubuntu Server 24.04 LTS image and installs and configures
# everything needed to deploy a production-ready PostgreSQL server.
set -euo pipefail
# --- AESTHETICS ---
GREEN='\033[0;32m'
@ScorpionConMate
ScorpionConMate / setup-node.md
Last active September 6, 2023 15:45
Setting Up Node.js Typescript Project with Eslint, Prettier & Live Reloading

Setting Up Node.js Typescript Project with Eslint, Prettier & Live Reloading

Setting up Typescript and live reloading in Node.js

First, setting up the file tsconfig.json to compile the typescript files into javascript files.

{
  "compilerOptions": {
 "module": "commonjs",
@Kyuubang
Kyuubang / docker.yml
Last active October 1, 2023 17:48
sample ansible playbook for install docker
- hosts: 'master, worker'
become: yes
tasks:
- name: update and install dependencies
apt:
name:
- apt-transport-https
- ca-certificates
- curl
@kopwei
kopwei / k3s-cluster.md
Last active August 12, 2025 12:32
K3s and Rancher on Raspberry Pi 4 Cluster

Deploy K3s and Rancher on Raspberry Pi 4 cluster

Today I tried to setup a small Kubernetes cluster on top of 3 Raspberry Pi 4 (4GB Memory). Here is the steps to install the cluster.

IMG_3817

Preparation

I have 3 Raspberry Pi 4 stacked with PoE headers and connected to a PoE switch at home. The are connected to Internet through a home router. All Pis are equipped with a 64GB Samsung SDXC card flushed with Ubuntu 20.04 image.

@HirbodBehnam
HirbodBehnam / tg.sh
Last active March 18, 2025 08:14
A dead simple script to upload files on your server through Telegram bot
#!/bin/bash
# This is a simple script that takes some files as arguments and sends them to a special chat
# Just create a new bot at @BotFather and get your chat ID from @myidbot and enter them here
# You can also make a shortcut in '~/.bashrc' like "alias tg='bash /opt/scripts/tg.sh'"
# After that restart bash and use it like 'tg file1.txt file2.jpg'
# EDIT TOKEN and CHAT_ID:
TOKEN="TOKEN"
CHAT_ID="12341234"
# Make sure curl is installed
for arg in "$@"
@sundowndev
sundowndev / GoogleDorking.md
Last active August 12, 2025 19:39
Google dork cheatsheet

Google dork cheatsheet

Search filters

Filter Description Example
allintext Searches for occurrences of all the keywords given. allintext:"keyword"
intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"
inurl Searches for a URL matching one of the keywords. inurl:"keyword"
allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"
intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"
@mraaroncruz
mraaroncruz / steps.md
Last active July 30, 2025 12:56
Get the Telegram channel ID

To get the channel id

  1. Create your bot with botfather
  2. Make you bot an admin of your channel

Simplest way (via @anhtuank7c)

Go to Telegram web and open a channel, get the ID from -[channel id] from hash in the path

https://web.telegram.org/k/#-9999999999999

@dduvnjak
dduvnjak / add_cloudflare_ips.sh
Last active August 8, 2025 10:19
Add CloudFlare IP addresses to an EC2 Security Group using awscli
# first we download the list of IP ranges from CloudFlare
wget https://www.cloudflare.com/ips-v4
# set the security group ID
SG_ID="sg-00000000000000"
# iterate over the IP ranges in the downloaded file
# and allow access to ports 80 and 443
while read p
do
@ssstonebraker
ssstonebraker / sed cheatsheet
Created August 2, 2013 14:06 — forked from un33k/sed cheatsheet
Sed Cheatsheet
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'