Skip to content

Instantly share code, notes, and snippets.

View KennedyTedesco's full-sized avatar

Kennedy Tedesco KennedyTedesco

View GitHub Profile
@rummykhan
rummykhan / nginx.conf
Created April 24, 2021 21:11
Nginx + Supervisor conf for Octane
server {
listen 80;
server_name app.rehanmanzoor.me;
charset utf-8;
client_max_body_size 1M;
location / {
proxy_pass http://127.0.0.1:8001;
proxy_http_version 1.1;
@rubnet
rubnet / nginx_compile_install.sh
Last active September 27, 2019 10:57
Building nginx with ngx_brotli, openssl and pagespeed from Sources
#!/bin/bash
#PS_NGX_EXTRA_FLAGS="--with-cc=/opt/rh/devtoolset-2/root/usr/bin/gcc"
PS_NGX_EXTRA_FLAGS=""
DOWNTMP=/data/
#[check the https://www.modpagespeed.com/doc/release_notes for the latest version]
NPS_VERSION=1.13.35.2-stable
cd $DOWNTMP
wget https://github.com/apache/incubator-pagespeed-ngx/archive/v${NPS_VERSION}.zip
@bradwestfall
bradwestfall / S3-Static-Sites.md
Last active May 22, 2024 13:44
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

⚠ This post is fairly old. I don't keep it up to date. Be sure to see comments where some people have posted updates

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation
@reinink
reinink / in-memory-sqlite-database.php
Created September 26, 2017 00:13
Give users completely safe sandboxed raw SQL reporting abilities
<?php
// Create in-memory SQLite database
$sqlite = new PDO('sqlite::memory:');
// Generate schema (for whatever tables you want)
$sqlite->prepare('CREATE TABLE users(id, family_id, first_name, last_name, email)')->execute();
$sqlite->prepare('CREATE TABLE families(id, name, phone, address)')->execute();
// Insert pre-defined data
@abstractart
abstractart / books.md
Last active June 18, 2024 16:10
Free Programming Ebooks - O'Reilly Media. Codeship free ebooks here - https://bit.ly/2oQ0knQ
@srmds
srmds / Installing wkhtmltopdf 0.12.6, 0.12.5, 0.12.4 - Ubuntu 22.06 , 18.04, 16.04 x64, 0.12.6 - MacOS Ventura 13.6.md
Last active June 14, 2024 13:47
Installing wkhtmltopdf 0.12.4, 0.12.5 0.12.6 - Ubuntu 22.04 - 0.12.6, 16.04 x64, 0.12.5 - Ubuntu 18.04 x64 - 0.12.5 - macOS Ventura -13.6
@mdemblani
mdemblani / Mysql Character Set conversion - Latin1 to UTF-8(utf8mb4).md
Last active June 20, 2023 08:03
Mysql Character Set conversion - Latin1 to UTF-8(utf8mb4)
  1. Make sure mysql-client is installed. If not, then :
    sudo apt install mysql-client
	or
    sudo apt-get install mysql-client
  1. Open php.ini

; PHP's default character set is set to UTF-8.

@atoponce
atoponce / gist:07d8d4c833873be2f68c34f9afc5a78a
Last active June 26, 2024 09:36 — forked from tqbf/gist:be58d2d39690c3b366ad
Cryptographic Best Practices

Cryptographic Best Practices

Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.

The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from

@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active April 15, 2024 02:19
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@bmhatfield
bmhatfield / .profile
Last active June 18, 2024 09:38
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else