Skip to content

Instantly share code, notes, and snippets.

View binaryfire's full-sized avatar

Raj Siva-Rajah binaryfire

View GitHub Profile
@kiddtang
kiddtang / .env
Last active January 30, 2024 21:12
Host WordPress on your Win 11 / 10 with Free Docker Desktop
MYSQL_ROOT_PASSWORD=your_root_password
MYSQL_USER=your_wordpress_database_user
MYSQL_PASSWORD=your_wordpress_database_password
@kiddtang
kiddtang / .env-Swoole
Last active June 14, 2023 06:29
Youtube - Boosts your Laravel Sail
OCTANE_SERVER=swoole
OCTANE_HTTPS=true
@zackpyle
zackpyle / *Best Snippets*
Last active May 1, 2024 20:05
Best PHP/JS Snippets
This is a collection of my most used or most useful PHP and JS snippets
**Disclaimer, I didn't write most of these - I just curated them over the years**
@hermanbanken
hermanbanken / Dockerfile
Last active April 22, 2024 10:53
Compiling NGINX module as dynamic module for use in docker
FROM nginx:alpine AS builder
# nginx:alpine contains NGINX_VERSION environment variable, like so:
# ENV NGINX_VERSION 1.15.0
# Our NCHAN version
ENV NCHAN_VERSION 1.1.15
# Download sources
RUN wget "http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" -O nginx.tar.gz && \
@exocode
exocode / xfs-on-hetzner.yml
Last active January 27, 2024 06:33
Create xfs partitions on Hetzner via cloud-init. It keeps root disk available again after rebooting. Simply change your desired sizes and filesystem to use it for your needs.
#cloud-config
resize_rootfs: false
disk_setup:
/dev/sda:
table_type: 'mbr'
layout:
- 25
- 75
overwrite: true
@flox1an
flox1an / default.conf
Last active September 1, 2023 07:26
nginx config that uses the oauth2-proxy (via auth_request) to authenticate against gitlab and then proxies all requests to a backend service while setting the auth headers X-User and X-Email
server {
listen 80;
server_name localhost;
location /oauth2/ {
proxy_pass http://oauth-proxy:4180;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Auth-Request-Redirect $request_uri;
@krisnod
krisnod / gist:56ff894f400cce7c742fb11fb2fde9cf
Last active April 6, 2022 18:46
RancherOS on Hetzner using software RAID (RAID 1)
Install:
----------
* Activate Hetzner Rescue System (Debian)
* Connect to Hetzner Rescue System using SSH and live boot RancherOS
(thanks goes to William Fleurant for showing how this can be done: https://github.com/wfleurant/boot-rancheros-hetzner/)
* apt-get update
* apt-get install kexec-tools aria2
@Firefishy
Firefishy / sysctl-tune.conf
Created March 23, 2017 17:57
Safe sysctl tuning for modern high traffic systems
# Enable Packetization Layer Path MTU Discovery.
net.ipv4.tcp_mtu_probing = 1
net.ipv4.tcp_base_mss = 1024
# Ensure slow start is disabled
# https://github.com/ton31337/tools/wiki/tcp_slow_start_after_idle---tcp_no_metrics_save-performance
net.ipv4.tcp_slow_start_after_idle = 0
net.ipv4.tcp_no_metrics_save = 0
# Tune network buffers - servers have more than 16MB of RAM in 2017
@KyleBanks
KyleBanks / docker-stats-json
Created February 10, 2017 01:27
Returns Docker stats as a JSON Object
docker stats --no-stream \
--format "{\"container\": \"{{ .Container }}\", \"memory\": { \"raw\": \"{{ .MemUsage }}\", \"percent\": \"{{ .MemPerc }}\"}, \"cpu\": \"{{ .CPUPerc }}\"}"
@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active May 13, 2024 19:45
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \