Skip to content

Instantly share code, notes, and snippets.

View marcoslopes's full-sized avatar

Marcos Antonio Lopes marcoslopes

  • Brisbane, Australia
  • 23:39 (UTC +10:00)
View GitHub Profile
@marcoslopes
marcoslopes / ssh_key.tf
Created September 24, 2018 10:29 — forked from irvingpop/ssh_key.tf
Terraform external data source example - dynamic SSH key generation
# ssh key generator data source expects the below 3 inputs, and produces 3 outputs for use:
# "${data.external.ssh_key_generator.result.public_key}" (contents)
# "${data.external.ssh_key_generator.result.private_key}" (contents)
# "${data.external.ssh_key_generator.result.private_key_file}" (path)
data "external" "ssh_key_generator" {
program = ["bash", "${path.root}/../ssh_key_generator.sh"]
query = {
customer_name = "${var.customer_name}"
customer_group = "${var.customer_group}"
@marcoslopes
marcoslopes / osx_install.sh
Created June 11, 2018 15:23 — forked from t-io/osx_install.sh
Install most of my Apps with homebrew & cask
#!/bin/sh
echo Install all AppStore Apps at first!
# no solution to automate AppStore installs
read -p "Press any key to continue... " -n1 -s
echo '\n'
echo Install and Set San Francisco as System Font
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)"
echo Install Homebrew, Postgres, wget and cask
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@marcoslopes
marcoslopes / MethodParamsInjectionTest.java
Created February 8, 2018 17:40 — forked from psamsotha/MethodParamsInjectionTest.java
Custom method parameter injection with Jersey 2
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.logging.Logger;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import javax.ws.rs.GET;
import javax.ws.rs.POST;

Principles of Adult Behavior

  1. Be patient. No matter what.
  2. Don’t badmouth: Assign responsibility, not blame. Say nothing of another you wouldn’t say to him.
  3. Never assume the motives of others are, to them, less noble than yours are to you.
  4. Expand your sense of the possible.
  5. Don’t trouble yourself with matters you truly cannot change.
  6. Expect no more of anyone than you can deliver yourself.
  7. Tolerate ambiguity.
  8. Laugh at yourself frequently.
@marcoslopes
marcoslopes / Between Battles
Created July 27, 2017 13:10 — forked from kilbot/Between Battles
product.json
{
"product": {
"title": "Between Battles",
"id": 27540,
"created_at": "2015-06-12T00:59:52Z",
"updated_at": "2015-06-12T01:08:11Z",
"type": "variable",
"status": "publish",
"downloadable": false,
"virtual": false,
@marcoslopes
marcoslopes / Between Battles
Created July 27, 2017 13:10 — forked from kilbot/Between Battles
product.json
{
"product": {
"title": "Between Battles",
"id": 27540,
"created_at": "2015-06-12T00:59:52Z",
"updated_at": "2015-06-12T01:08:11Z",
"type": "variable",
"status": "publish",
"downloadable": false,
"virtual": false,
@marcoslopes
marcoslopes / iterm2.zsh
Created September 15, 2016 01:14 — forked from wadey/iterm2.zsh
Change iTerm2 tab color when using SSH
# Usage:
# source iterm2.zsh
# iTerm2 window/tab color commands
# Requires iTerm2 >= Build 1.0.0.20110804
# http://code.google.com/p/iterm2/wiki/ProprietaryEscapeCodes
tab-color() {
echo -ne "\033]6;1;bg;red;brightness;$1\a"
echo -ne "\033]6;1;bg;green;brightness;$2\a"
echo -ne "\033]6;1;bg;blue;brightness;$3\a"
# see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/
# core
brew install coreutils
# key commands
brew install binutils
brew install diffutils
brew install ed --default-names
brew install findutils --with-default-names
@marcoslopes
marcoslopes / submodule-pull.sh
Created April 29, 2016 10:37 — forked from stephenparish/submodule-pull.sh
Update submodules in a git repository to the latest, but exclude one..
git submodule foreach '[ "$path" == "submodule-to-exclude" ] || git pull origin master'