Skip to content

Instantly share code, notes, and snippets.

Avatar

Al w0rldart

View GitHub Profile
@w0rldart
w0rldart / scroll-meetup-messages.user.js
Last active Mar 12, 2020
Scroll to the last message on Meetup
View scroll-meetup-messages.user.js
// ==UserScript==
// @name Scroll Meetup Messages
// @namespace https://meetup.net/
// @version 0.2
// @description Script to scroll to the last message in your Inbox, and last member on a Meetup Group
// @author Alex B
// @match https://secure.meetup.com/messages/*
// @match https://www.meetup.com/*/members/
// @grant none
// @require http://code.jquery.com/jquery-latest.js
@w0rldart
w0rldart / app.js
Last active Nov 25, 2019
NodeJS Lambda with DynamoDB setup for dev environment
View app.js
const AWS = require('aws-sdk')
const IS_OFFLINE = process.env.NODE_ENV !== 'production'
let options = {}
// connect to local DB if running offline
if (IS_OFFLINE) {
const DYNAMO_ENDPOINT = process.env.DYNAMO_ENDPOINT
options = {
View gist:a1e30177a603bb5711a547b9af861a29
* alicloud_ess_alarm.alarm_up: CreateAlarm got an error: &errors.ServerError{httpStatus:400, requestId:"xxxx-xxxx",
hostId:"ess.eu-central-1.aliyuncs.com", errorCode:"InvalidParameter", recommend:"",
message:"The specified value of parameter \"MetricName\" is not valid.", comment:""}.
@w0rldart
w0rldart / trick.md
Created Jul 18, 2018
wp cli with increased memory_limit
View trick.md

If you get the following error when running wp command

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 12288 bytes) in ....

You can overcome that the following way

php -d memory_limit=256M /usr/bin/wp
@w0rldart
w0rldart / Chef.md
Last active Jul 14, 2021
Chef cluster recovery notes
View Chef.md

Intro

Chef High Availability: Backend Cluster and its not so common problems list.

Notes:

  • In my case, Chef HA setup is entirely on AWS but this can be translated to other vendors too
  • chef-backend-ctl commands are for backend nodes
  • chef-server-ctl commands are for frontend nodes

Index

@w0rldart
w0rldart / docker-compose.yaml
Last active Nov 15, 2021
MariaDB docker-compose with UTF8 Collation
View docker-compose.yaml
version: '3.1'
services:
db:
image: mariadb
restart: always
command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci --init-connect='SET NAMES UTF8;' --innodb-flush-log-at-trx-commit=0
ports:
- 3306:3306
@w0rldart
w0rldart / README.md
Last active Jan 29, 2018
Useful aws cli commands
View README.md

Compilation of useful AWS CLI commands that I accumulate over time

Don't forget to export AWS_DEFAULT_PROFILE=MyMagicalAWSProfile :)

@w0rldart
w0rldart / docker-compose.yml
Created Jan 23, 2017
Docker + MySQL + Traefik
View docker-compose.yml
version: '2'
services:
traefik:
image: traefik
container_name: "traefik_site"
command: --web --docker --docker.domain=docker.localhost --logLevel=DEBUG
ports:
- "80:80"
- "8080:8080"
@w0rldart
w0rldart / swarm.sh
Created Jan 20, 2017
Create a cluster of Docker Engines, a.k.a a swarm
View swarm.sh
#!/bin/sh
###
## Virtual box options
###
export VIRTUALBOX_CPU_COUNT='1'
export VIRTUALBOX_DISK_SIZE='10000'
export VIRTUALBOX_MEMORY_SIZE='512'
swarm_workers=2