Skip to content

Instantly share code, notes, and snippets.

View jaymecd's full-sized avatar

Nikolai Zujev jaymecd

View GitHub Profile
@jaymecd
jaymecd / delete_all_object_versions.sh
Created June 18, 2018 15:10 — forked from weavenet/delete_all_object_versions.sh
Delete all versions of all files in s3 versioned bucket using AWS CLI and jq.
#!/bin/bash
bucket=$1
set -e
echo "Removing all versions from $bucket"
versions=`aws s3api list-object-versions --bucket $bucket |jq '.Versions'`
markers=`aws s3api list-object-versions --bucket $bucket |jq '.DeleteMarkers'`
import argparse
from mock import Mock
m = Mock()
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
query_group = subparsers.add_parser('query')
add_group = subparsers.add_parser('add')
@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 / magento.sh
Last active March 29, 2018 03:10 — forked from tonyoconnell/gist:2351492
Install Magento 1.x with sample data
#!/bin/sh
db_host=localhost
db_name=magento
db_user=root
db_pass=root
if [ ! -f ~/Downloads/magento-1.7.0.2.tar.gz ]; then
wget http://www.magentocommerce.com/downloads/assets/1.7.0.2/magento-1.7.0.2.tar.gz -O ~/Downloads/magento-1.7.0.2.tar.gz
wget http://www.magentocommerce.com/downloads/assets/1.6.1.0/magento-sample-data-1.6.1.0.tar.gz -O ~/Downloads/magento-sample-data-1.6.1.0.tar.gz
@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