Skip to content

Instantly share code, notes, and snippets.

@hieubuiduc
hieubuiduc / nginx_install.sh
Last active March 17, 2020 13:01
Script to install/upgrade Nginx (Naxsi, PageSpeed, PCRE) from sources on CentOS 6
#!/bin/bash
#
# Script to install/upgrade Nginx(Naxsi,PageSpeed,PCRE) from sources on CentOS 6
#
# Author: Duc Hieu - 12/2014.
# Base System: CentOS release 6.6 (Final)
# License: MIT
#
# Syntax: # sh nginx_install.sh
#
@jmetzger
jmetzger / git-download-private-repo-tarball.sh
Last active July 21, 2023 21:58
Git-Downloader for private repo
#!/bin/bash
CF=~/.git-dprz.sh
function info {
cat <<- INFO
-- Script for downloading PRIVATE(!) git-repos as tar-archive on old systems (like Debian Etch)
-- That only have old git - binaries
--
@phedoreanu
phedoreanu / apache ssh keys
Last active January 25, 2024 17:34
git PHP webhook
sudo mkdir -m 0700 /var/www/.ssh
sudo chown -R apache:apache /var/www/.ssh
sudo -u apache ssh-keygen (empty passphrase)
paste public key into repo manager
(git-repo) sudo -u apache git pull origin branch (this will create /var/www/.ssh/known_hosts)
call git_hook.php?branch=xxx
@frdmn
frdmn / bash_aliases
Last active November 13, 2023 17:47
Nginx and PHP-FPM configuration + default virtual host
alias nginx.start='sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.nginx.plist'
alias nginx.stop='sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.nginx.plist'
alias nginx.restart='nginx.stop && nginx.start'
alias php-fpm.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist"
alias php-fpm.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist"
alias php-fpm.restart='php-fpm.stop && php-fpm.start'
alias mysql.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist"
alias mysql.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist"
alias mysql.restart='mysql.stop && mysql.start'
alias nginx.logs.error='tail -250f /usr/local/etc/nginx/logs/error.log'
@ysimonson
ysimonson / gist:7120798
Last active February 18, 2016 20:24
Tornado decorator to make an endpoint prerenderable for search engine crawlers
# This has been turned into a full-fledged repo:
# https://github.com/dailymuse/torender
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
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
@sauloperez
sauloperez / signal_catching.rb
Last active November 11, 2020 11:25
How to catch SIGINT and SIGTERM signals in Ruby
# Signal catching
def shut_down
puts "\nShutting down gracefully..."
sleep 1
end
puts "I have PID #{Process.pid}"
# Trap ^C
Signal.trap("INT") {
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active April 1, 2024 11:21
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@aseemk
aseemk / i18n._coffee
Last active January 28, 2019 14:52
Node.js script to extract i18n strings from source code.
#!/usr/bin/env _coffee
#
# Helper script to search all of our files for i18n strings and update our
# strings file. Helpful in case we missed a code path during testing.
#
# Specifically, searches for gettext `__()` calls in our checked-in files.
#
$ = require 'underscore'
echo = console.log
@powerumc
powerumc / remove-mono.sh
Last active May 7, 2024 10:57
Uninstalling Mono on Mac OS X
#!/bin/sh -x
#This script removes Mono from an OS X System. It must be run as root
rm -r /Library/Frameworks/Mono.framework
rm -r /Library/Receipts/MonoFramework-*
for dir in /usr/bin /usr/share/man/man1 /usr/share/man/man3 /usr/share/man/man5; do
(cd ${dir};