Skip to content

Instantly share code, notes, and snippets.

View noinarisak's full-sized avatar
🏠
Working from home

Noi Narisak noinarisak

🏠
Working from home
View GitHub Profile

Apache Cheat Sheet

Setup a Virtual Domain

NameVirtualHost *

<VirtualHost *>
  DocumentRoot /web/example.com/www
  ServerName www.example.com
  ServerAlias example.com
 CustomLog /web/example.com/logs/access.log combined
@noinarisak
noinarisak / README.md
Last active November 29, 2020 00:50
Bash Shell Boilerplate

Bash Shell Boilerplate

Boilerplate for bash cli with arguesments.

@noinarisak
noinarisak / audit_mixin.py
Created January 29, 2019 15:12 — forked from mjhea0/audit_mixin.py
Useful SQLAlchemy Mixins
from datetime import datetime
from sqlalchemy import Column, Integer, DateTime, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declared_attr
from flask_security import current_user
class AuditMixin(object):
created_at = Column(DateTime, default=datetime.now)
updated_at = Column(DateTime, default=datetime.now, onupdate=datetime.now)
@noinarisak
noinarisak / audit_mixin.py
Created January 29, 2019 15:13 — forked from techniq/audit_mixin.py
Useful SQLAlchemy Mixins
from datetime import datetime
from sqlalchemy import Column, Integer, DateTime, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declared_attr
from flask_security import current_user
class AuditMixin(object):
created_at = Column(DateTime, default=datetime.now)
updated_at = Column(DateTime, default=datetime.now, onupdate=datetime.now)

Makefile Base Boilerplate

Contains boilerplate Makefile for development work.

Setup Okta Org Custom Domain with Let's Encypt

Table of Content

  • Requirements (#requirements)

Requirements

  • Okta Tenant. Get one here
  • Docker (My example is Docker for Mac)
  • Domain Name that you control. (Need to add DNS records so both Okta and Let's Encypt can validate your domain)
@noinarisak
noinarisak / README.md
Last active February 14, 2020 16:19
Okta Postman Environment JSON File.

Okta Postman Environment JSON Template.

Use to setup the environments for Okta API calls.

# //BUG: There is bug in the '-e'. Maybe have to two sed calls to the same log file?
function scrub_log() {
sed -i -e 's/^Authorization: SSWS.*/Authorization: SSWS not_real_base64_token/g' -e 's/^Authorization: Bearer.*/Authorization: Bearer not_real_base64_token/g' @{1}
}
@noinarisak
noinarisak / README.md
Last active April 26, 2020 23:09
Makefile Python Boilerplate

Makefile Python Boilerplate

Contains boilerplate Makefile for Python development work.

Quick start

$ make

# Output...