Türker Yıldırım
Writing
Snippets
About
Search
Snippets
One-liners, regexes and short scripts worth keeping. Copy, adapt, move on.
Show replication lag on a MySQL replica
architecture
monitoring
mysql
sql
Await several promises without failing on the first
async
javascript
logging
performance
Reload nginx only if the config is valid
bash
ci-cd
deployment
nginx
List systemd timers and when they next run
bash
deployment
linux
monitoring
Build only one stage of a multi-stage Dockerfile
bash
ci-cd
deployment
docker
Read a JSON config file with a fallback in PHP
linting
oop
php
refactoring
Limit a container to one CPU and 512MB
docker
linux
monitoring
performance
Run PHPStan on changed files only
bash
ci-cd
phpstan
static-analysis
Rate limit a location in nginx
deployment
nginx
performance
security
Tail a Kibana-bound log with jq
bash
elk-stack
logging
monitoring
Find tables with no primary key
indexing
migrations
mysql
sql
Show the size of every Docker image layer
bash
docker
monitoring
performance
Ignore a PHPStan error by pattern
bash
phpstan
refactoring
static-analysis
Show the InnoDB buffer pool hit rate
monitoring
mysql
performance
sql
Test an SSL configuration from the command line
bash
monitoring
security
tls
Redirect HTTP to HTTPS in nginx
deployment
nginx
security
tls
Copy a file out of a running container
backup
bash
deployment
docker
Issue a Let’s Encrypt certificate with certbot
bash
nginx
security
tls
Show the systemd units that failed to start
bash
linux
logging
monitoring
Enable gzip for JSON responses in nginx
caching
deployment
nginx
performance
List the largest autoloaded options in WordPress
mysql
wordpress
wp-cli
wp-performance
Debounce a function with ES6
html
javascript
performance
refactoring
Generate a UUID version 4 in PHP
design-patterns
oop
php
security
Lazy-load images with IntersectionObserver
css
html
javascript
performance
Check when a TLS certificate expires
bash
monitoring
security
tls
Deep clone an object in JavaScript
javascript
oop
refactoring
testing
Remove all stopped Docker containers
bash
deployment
docker
linux
Add a generated column over a JSON field
indexing
migrations
mysql
sql
Read a huge file line by line in PHP
benchmarking
performance
php
refactoring
Retry a callable with exponential backoff
async
design-patterns
php
queues
Flatten a nested array in PHP
design-patterns
oop
php
refactoring
Show the current MySQL sql_mode
linting
migrations
mysql
sql
Time a block of code in PHP
benchmarking
performance
php
profiling
Dump and restore a single Redis database
backup
bash
migrations
redis
Follow the logs of one Docker container
bash
docker
logging
monitoring
Delete rows in batches without locking the table
migrations
mysql
performance
sql
Find the biggest keys in Redis
bash
monitoring
performance
redis
Reindex an Elasticsearch index behind an alias
bash
deployment
elasticsearch
migrations
Find which Docker images are using the disk
bash
deployment
docker
monitoring
Test an nginx config before reloading
bash
deployment
linux
nginx
Newer
1
2
3
4
…
6
Older