Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

M. Peter mpneuried

🏠
Working from home
View GitHub Profile
View optolink.yaml
@rstanley75
rstanley75 / mosquitto
Last active Aug 12, 2019
mosquitto init file for openrc on Alpine Linux
View mosquitto
#!/sbin/openrc-run
: ${MOSQUITTO_USER:=mosquitto}
: ${MOSQUITTO_GROUP:=mqtt}
: ${MOSQUITTO_CONF:=/etc/mosquitto/mosquitto.conf}
: ${MOSQUITTO_PIDDIR:=/run/mosquitto}
: ${MOSQUITTO_PIDFILE:=${MOSQUITTO_PIDDIR}/${SVCNAME}.pid}
: ${MOSQUITTO_LOGDIR:=/var/log/mosquitto}
: ${MOSQUITTO_PERSISTDIR:=/var/lib/mosquitto}
: ${MOSQUITTO_BINARY:=/usr/sbin/mosquitto}
@nikneroz
nikneroz / Guardian JWT.md
Last active May 31, 2021
Elixir + Phoenix Framework + Guardian + JWT. This is tutorial and step by step installation guide.
View Guardian JWT.md

Elixir + Phoenix Framework + Guardian + JWT + Comeonin

Preparing environment

We need to generate secret key for development environment.

mix phoenix.gen.secret
# ednkXywWll1d2svDEpbA39R5kfkc9l96j0+u7A8MgKM+pbwbeDsuYB8MP2WUW1hf

Let's generate User model and controller.

@mpneuried
mpneuried / Makefile
Last active Jun 17, 2021
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
View Makefile
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
View how-to-setup-lambda-to-talk-to-internet-and-vpc.md

How to setup AWS lambda function to talk to the internet and VPC

I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.

So it might be really unintuitive at first but lambda functions have three states.

  1. No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
  2. VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
  3. VPC with NAT, The best of both worlds, AWS services and web.
@selaromi
selaromi / make-flashlight-work-on.yosemite.md
Last active Oct 28, 2018
Steps to make Flashlight work on 10.10.4 (doesn't work for El Capitan)
View make-flashlight-work-on.yosemite.md

Make Flashlight work on 10.10.4

  1. Install SIMBL http://culater.net/software/SIMBL/SIMBL.php
  2. Copy SpotlightSIMBL.bundle to /Library/Application Support/SIMBL/Plugins/ (a)
  3. Copy Flashlight.osax to ~/Library/ScriptingAdditions/ (b)
  4. Disable Flashlight
  5. Enable Flashlight
  6. Open Script Editor on your Mac (look for "Script Editor In Spotlight") and paste the following code (don't change Snow Leopard for Yosemite)
tell application "Spotlight" to inject SIMBL into Snow Leopard
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active Jun 21, 2021
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)
View iterm2-solarized.md

Default

Default

Powerlevel10k

Powerlevel10k

View create_and_trust_cert.sh
openssl genrsa 2048 > host.key
openssl req -new -x509 -nodes -sha1 -days 3650 -key host.key > host.cert
#[enter *.localhost.dev for the Common Name]
openssl x509 -noout -fingerprint -text < host.cert > host.info
cat host.cert host.key > host.pem
Trust cert
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain host.cert
@mzabriskie
mzabriskie / README.md
Last active May 2, 2021
Check git status of multiple repos
View README.md

If you're like me you have a dir like ~/Workspace/Github where all your git repos live. I often find myself making a change in a repo, getting side tracked and ending up in another repo, or off doing something else all together. After a while I end up with several repos with modifications. This script helps me pick up where I left off by checking the status of all my repos, instead of having to check each one individually.

Usage:

git-status [directory]

This will run git status on each repo under the directory specified. If called with no directory provided it will default to the current directory.

@dergachev
dergachev / GIF-Screencast-OSX.md
Last active Jun 21, 2021
OS X Screencast to animated GIF
View GIF-Screencast-OSX.md

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: