Skip to content

Instantly share code, notes, and snippets.

@stympy
stympy / app-models-application_record.rb
Created July 16, 2020 20:39
Simple change tracking for Rails models. It also works for non-database-backed models with optional change tracking.
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
include ActivityLogger
end
@checco
checco / rw_ro_access.sql
Last active March 20, 2025 09:36 — forked from oinopion/read-access.sql
How to create a read only user in AWS RDS PostgreSQL and a user with superuser privileges on AWS RDS PostgreSQL
--
-- Read only
--
-- Create a group
CREATE ROLE postgres_ro_group;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO postgres_ro_group;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO postgres_ro_group;
@sawanoboly
sawanoboly / fluentd.sample.conf
Last active April 24, 2025 10:07
postfix log status line regexp for fluentd(ruby)
<source>
type tail
# format /(?<time>[\w]+\s+[\d]+\s[\d:]+)\s+(?<host>[\w]+)\s+(?<process>[\w\/]+)\[(?<pid>[\d]+)\]\:\s(?<queue_id>[\w]{11}):\s(?<data>.+)/
format /(?<time>[\w]+\s+[\d]+\s[\d:]+)\s+(?<data>.+)/
time_format %b %d %H:%M:%S
path /var/log/mail.log
pos_file /opt/fluentd/tmp/mail.log.pos2
tag raw.postfix.result
</source>
@mderazon
mderazon / mongo-dump-csv.sh
Last active November 3, 2022 16:18
Export all of Mongodb collections as csv without the need to specify fields
OIFS=$IFS;
IFS=",";
# fill in your details here
dbname=DBNAME
user=USERNAME
pass=PASSWORD
host=HOSTNAME:PORT
# first get all collections in the database
@PWSdelta
PWSdelta / 42-things.md
Last active May 13, 2022 07:32 — forked from xdite/42-things.md
42 Sweet, sweet things Rails (and Ruby) can do. Wonderful reference.
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active March 20, 2025 17:17
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