Skip to content

Instantly share code, notes, and snippets.

@catchdave
catchdave / replace_synology_ssl_certs.sh
Last active July 12, 2025 17:11
CLI script to programmatically replace SSL certs on Synology NAS
# MOVED to public repo: https://github.com/catchdave/ssl-certs/blob/main/replace_synology_ssl_certs.sh
@paydro
paydro / default-config-postgres-updated.sql
Last active August 7, 2020 14:19
A postgres configuration for RDS and self-managed postgres databases. Based on my guide (https://tightlycoupled.io/goto-postgres-configuration-for-rds-and-self-managed-postgres/)
-- Copy/paste this file or execute with `psql -f thisfile.sql`
CREATE ROLE owner CREATEDB LOGIN ENCRYPTED PASSWORD 'secret' CONNECTION LIMIT 3;
ALTER ROLE owner SET statement_timeout = 20000;
ALTER ROLE owner SET lock_timeout = 3000;
ALTER ROLE owner SET idle_in_transaction_session_timeout = 3000; -- v9.6+
CREATE ROLE readwrite_users NOLOGIN;
CREATE ROLE readonly_users NOLOGIN;
@brysontyrrell
brysontyrrell / jamfpro-template.yaml
Last active March 26, 2022 21:52
Deploy Jamf Pro using Fargate and Aurora Serverless (non production)
AWSTemplateFormatVersion: 2010-09-09
Parameters:
AvailabilityZone1:
Type: String
Default: a
AvailabilityZone2:
Type: String
@drmalex07
drmalex07 / README-fail2ban-keycloak.md
Last active October 9, 2025 09:11
Use fail2ban to block brute-force attacks to keycloak server. #keycloak #fail2ban #brute-force-attack

Add regular-expression filter under /etc/fail2ban/filter.d/keycloak.conf:

[INCLUDES]

before = common.conf

[Definition]

_threadName = [a-z][-_0-9a-z]*(\s[a-z][-_0-9a-z]*)*
_userId = (null|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})
@aackerman
aackerman / gist:93d86b780ef7e951b59351dcc99af1b1
Last active April 15, 2021 07:45
Parameter Store Config
'use strict'
const EventEmitter = require('events')
// default expiry 3 mins
const DEFAULT_EXPIRY = 3 * 60 * 1000
const create = ({ keys, ssm, keyPrefix = '', expiryMs = DEFAULT_EXPIRY }) => {
let isRefreshing = false
if (!keys || !Array.isArray(keys) || keys.length === 0) {
throw new Error('Provide a non-empty array of config keys')
@abenedek
abenedek / README.md
Last active November 2, 2020 15:30
BuzzFeed's README Template

name of the service

An explanation of what the service is doing and why. Any high level business logic should be mentioned here to give the reader an understanding of why the service exists in the first place.

List important endpoints/URLs and explain what they are responsible for.

Point of contact and Slack channel

@zoellner
zoellner / deleteTaskDefinition.js
Last active February 19, 2019 19:48
Delete AWS ECS Task Definition for Task Family
'use strict';
const AWS = require('aws-sdk');
const _h = require('highland');
const ecs = new AWS.ECS({region: process.env.AWS_REGION || 'us-east-1'});
let familyPrefix = null;
if (process.argv.length >= 3){
@triblondon
triblondon / auth.js
Created June 30, 2017 21:02
Vary middleware
'use strict';
const USER_ID_HEADER = 'Fastly-Auth-UserID';
const RANK_HEADER = 'Fastly-Auth-Rank';
const TOKEN_HEADER = 'Fastly-Auth-Token';
module.exports = () => {
return (req, res, next) => {
const uid = req.get(USER_ID_HEADER);
const rank = req.get(RANK_HEADER);
@sapessi
sapessi / README.md
Last active October 26, 2021 10:48
Continuous deployment of React websites to Amazon S3

Continuous deployment of React websites to Amazon S3

This sample includes a continuous deployment pipiline for websites built with React. We use AWS CodePipeline, CodeBuild, and SAM to deploy the application. To deploy the application to S3 using SAM we use a custom CloudFormation resource.

Files included

  • buildspec.yml: YAML configuration for CodeBuild, this file should be in the root of your code repository
  • configure.js: Script executed in the build step to generate a config.json file for the application, this is used to include values exported by other CloudFormation stacks (separate services of the same application).
  • index.js: Custom CloudFormation resource that publishes the website to an S3 bucket. As you can see from the buildspec and SAM template, this function is located in a s3-deployment-custom-resource sub-folder of the repo
  • app-sam.yaml: Serverless Application model YAML file. This configures the S3 bucket and the cu
@iamakulov
iamakulov / index.md
Last active May 22, 2020 15:28
Fixing babel-plugin-add-module-exports in Webpack 2

babel-plugin-add-module-exports generates an incorrect bundle if you use ES modules in the latest versions of Webpack 2 (at least in 2.1.0-beta.27 and .28). Here’s what to do.

1. Remove the plugin:

{
  "plugins": [
-   "add-module-exports"
  ]
}