Skip to content

Instantly share code, notes, and snippets.

View jaymecd's full-sized avatar

Nikolai Zujev jaymecd

View GitHub Profile
@jaymecd
jaymecd / macapp.go
Created May 18, 2018 06:07 — forked from mholt/macapp.go
Distribute your Go program (or any single binary) as a native macOS application
// Package main is a sample macOS-app-bundling program to demonstrate how to
// automate the process described in this tutorial:
//
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5
//
// Bundling the .app is the first thing it does, and creating the DMG is the
// second. Making the DMG is optional, and is only done if you provide
// the template DMG file, which you have to create beforehand.
//
// Example use:
@jaymecd
jaymecd / .bash_profile
Last active March 15, 2018 15:12 — forked from giuliocalzolari/.bash_profile
aws cli helper
# Place following snippets into ~/.profile, ~/.bash_profile or other similar file.
# auto-mfa
complete -W "$(ls -1 ~/.aws/*.mfa | awk -F "/" '{print $NF}' | sed -e 's/\.mfa$//')" mfa mfa_token
function mfa_token () {
oathtool --base32 --totp "$(cat ~/.aws/$1.mfa)"
}
function mfa () {
mfa_token "$1" | pbcopy # OSX only
}
@jaymecd
jaymecd / deploy.py
Created February 3, 2018 20:40 — forked from cvuorinen/deploy.py
Deploy Button on Olimex A20-OLinuXino-LIME with Jenkins build status and capistrano deploy. More information here: http://cvuorinen.net/2015/10/building-a-deploy-button/
#!/usr/bin/env python
import os
import time
from pyA20Lime.gpio import gpio
from pyA20Lime.gpio import port
from autojenkins import Jenkins
### configration parameters
@jaymecd
jaymecd / php-fpm-cli
Created December 1, 2017 22:40 — forked from muhqu/php-fpm-cli
#!/bin/bash
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Mathias Leppich <mleppich@muhqu.de>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@jaymecd
jaymecd / reinvent.md
Created November 16, 2017 20:07 — forked from henrysher/reinvent.md
link for reinvent slides
@jaymecd
jaymecd / Makefile
Created October 13, 2017 08:43 — forked from mcastilho/Makefile
Makefile for Medium article
.PHONY: all tags clean test build install generate image release
REGISTRY_REPO = <..redacted..>
OK_COLOR=\033[32;01m
NO_COLOR=\033[0m
ERROR_COLOR=\033[31;01m
WARN_COLOR=\033[33;01m
# Build Flags
@jaymecd
jaymecd / README.md
Created September 22, 2017 10:29 — forked from brandt/README.md
Creates a loopback alias with IP 127.0.0.2 at startup on Mac OS X

Loopback Alias

Creates an alias on the loopback interface (lo0) with the IP 127.0.0.2 on macOS.

Installation

  1. Install the plist to: /Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
  2. Set mode: sudo chmod 0644 /Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
  3. Set owner: sudo chown root:wheel /Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
  4. Load: sudo launchctl load /Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
@jaymecd
jaymecd / gist:32903e1cc9ac1c8e9aa415b25f95c646
Created September 12, 2017 17:45 — forked from telent/gist:9742059
12 factor app configuration vs leaking environment variables
App configuration in environment variables: for and against
For (some of these as per the 12 factor principles)
1) they are are easy to change between deploys without changing any code
2) unlike config files, there is little chance of them being checked
into the code repo accidentally
3) unlike custom config files, or other config mechanisms such as Java
@jaymecd
jaymecd / bash-cheatsheet.sh
Created June 2, 2017 11:46 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@jaymecd
jaymecd / blog-semver
Created April 28, 2017 19:35 — forked from xenoscopic/blog-semver
Comparing Program Versions in POSIX Shell
http://havoc.io/blog/post/comparing-program-versions-in-posix-shell