Skip to content

Instantly share code, notes, and snippets.

@supairish
supairish / gist:2951524
Created June 18, 2012 23:58
Nginx - how to limit requests by User Agent
http {
map $http_user_agent $limit_bots {
default '';
~*(google|bing|yandex|msnbot) $binary_remote_addr;
}
limit_req_zone $limit_bots zone=bots:10m rate=1r/m;
server {
@kgriffs
kgriffs / vlc
Last active February 23, 2024 17:57
Run VLC from the command line on Mac OS X and stream internet radio (such as Radio Paradise).
#!/usr/bin/env bash
/Applications/VLC.app/Contents/MacOS/VLC -I rc "$@"
@plentz
plentz / nginx.conf
Last active March 20, 2024 18:49
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048