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
@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 / README.md
Last active November 29, 2020 00:50
Bash Shell Boilerplate

Bash Shell Boilerplate

Boilerplate for bash cli with arguesments.

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
USER=rentzsch
PASS=mypassword
REPO=mogenerator
# Delete default labels
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/bug"
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/duplicate"
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/enhancement"
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/invalid"
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/question"
@noinarisak
noinarisak / Vagrantfile
Created November 9, 2016 19:29
Vagrantfile + Tomcat/Maven/Java6/CVS
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.box = "centos/6"

Notes

CentOS-7 out of the box does ssh PasswordAuthenication=No, you have to update /etc/ssh/sshd_config to enable if you are not using ssh_keys with ansible.

# Thanks to: https://gist.github.com/jdbartlett/444295
# ref blog: https://marcjenkins.co.uk/a-wordpress-git-workflow/
# Ignore everything in the root except the "wp-content" directory.
/*
!.gitignore
!wp-content/
# Ignore everything in the "wp-content" directory, except the "plugins" and "themes" directories.
wp-content/*
#!/bin/sh
# Provision help for MongoDB on C9.io.
#
# Copyright 2016 Narisak Inc.
# Written by:
# Noi Narisak <[email protected]>
#
# c9.io setup script for MongoDB
# ===============================
@noinarisak
noinarisak / Makefile
Last active August 29, 2015 14:15 — forked from pwenzel/Makefile
.PHONY: install
install: clean wordpress phpunit wp-cli
git submodule init;
@echo "\n\nNOTICE: You may need to configure a MySQL database for your Wordpress installation. Just run:"
@echo " mysql -u root -p;"
@echo " CREATE DATABASE example_site; \n"
wordpress: latest.tar.gz
tar -zxvf latest.tar.gz;