Skip to content

Instantly share code, notes, and snippets.

View shijij's full-sized avatar
🔔

S J shijij

🔔
  • Canada
View GitHub Profile
@shijij
shijij / .appendTo_apache2.conf
Last active March 6, 2023 14:55
Apache BasicAuth with MySQL (authn_dbd)
# Append to apache2.conf
# Dont forget to repalce [user] [password] [dbname] with you own info
# ref: https://httpd.apache.org/docs/2.4/mod/mod_dbd.html
# ref: https://httpd.apache.org/docs/2.4/mod/mod_authn_dbd.html
<IfModule mod_authn_dbd.c>
DBDriver mysql
DBDParams host=localhost,port=3306,user=apache,pass=apache,dbname=auth
DBDMin 2
DBDKeep 8
@shijij
shijij / gist:54c9b21f26c08a15a70c182f03cb15b4
Created November 14, 2017 12:31
Nginx ssl reverse proxy with SNI
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name yourdomain
ssl_certificate /etc/ssl/localcerts/yourdomain.crt;
ssl_certificate_key /etc/ssl/localcerts/yourdomain.key;
ssl_ecdh_curve prime256v1;
ssl_session_cache builtin:1000 shared:SSL:10m;
@shijij
shijij / WA_TAX_FOR_WC.csv
Created February 4, 2018 06:28
General Sales Tax Rate For Washington State, USA. Ready for Woocommerce Import
Country Code State ZipCode City Rate % Tax Name Priority Compound Shipping Tax Class
US WA 98001 KING COUNTY 10 US Sales Tax 1 1 1
US WA 98002 AUBURN (KING CO) 10 US Sales Tax 1 1 1
US WA 98003 FEDERAL WAY 10 US Sales Tax 1 1 1
US WA 98004 BELLEVUE 10 US Sales Tax 1 1 1
US WA 98005 BELLEVUE 10 US Sales Tax 1 1 1
US WA 98006 BELLEVUE 10 US Sales Tax 1 1 1
US WA 98007 BELLEVUE 10 US Sales Tax 1 1 1
US WA 98008 BELLEVUE 10 US Sales Tax 1 1 1
US WA 98009 BELLEVUE 10 US Sales Tax 1 1 1
@shijij
shijij / VerifyCsrfToken.php
Created July 25, 2019 05:08
Laravel skip/except CSRF verification by domain name (useful for multiple subdomains)
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
class VerifyCsrfToken extends Middleware
{
/**
* Indicates whether the XSRF-TOKEN cookie should be set on the response.
@shijij
shijij / _TLDR_no_comment_version.conf
Last active November 21, 2020 18:38
Apache 2.4. Map subdomain to directory with mod_rewrite
RewriteEngine On
RewriteMap lc int:tolower
RewriteCond %{HTTP_HOST} ^([^.]*)\.([^.]*)\.([^.]*)\.([^.]*)$
RewriteRule ^.*$ - [R=404,L]
RewriteCond %{REQUEST_URI} \/icons\/.*
RewriteRule ^.*$ - [L]
RewriteCond %{HTTP_HOST} ^([^.]*)\.([^.]*)\.([^.]*)$