Skip to content

Instantly share code, notes, and snippets.

@realshadow
realshadow / iam-jdbc-driver-guide.md
Last active June 16, 2020 18:12
How to setup IAM JDBC driver in Datagrip

Build the driver

Add the driver to Datagrip

  • open database tool window
  • add new or edit existing data source
  • under Drivers section, duplicate the PostgreSQL driver, name it PostgreSQL IAM
@realshadow
realshadow / awc-ecs-access-to-aws-efs.md
Created March 17, 2018 23:59 — forked from duluca/awc-ecs-access-to-aws-efs.md
Step-by-step Instructions to Setup an AWS ECS Cluster

Configuring AWS ECS to have access to AWS EFS

If you would like to persist data from your ECS containers, i.e. hosting databases like MySQL or MongoDB with Docker, you need to ensure that you can mount the data directory of the database in the container to volume that's not going to dissappear when your container or worse yet, the EC2 instance that hosts your containers, is restarted or scaled up or down for any reason.

Don't know how to create your own AWS ECS Cluster? Go here!

New Cluster

Sadly the EC2 provisioning process doesn't allow you to configure EFS during the initial config. After your create your cluster, follow the guide below.

New Task Definition for Web App

If you're using an Alpine-based Node server like duluca/minimal-node-web-server follow this guide:

@realshadow
realshadow / test.js
Last active April 19, 2017 15:34
Postman - automatically set global variable depending on response
var response = JSON.parse(responseBody);
postman.setEnvironmentVariable("authorization_token", response.data.oauth.access_token);
@realshadow
realshadow / contacts.php
Last active March 14, 2017 14:07
Get iCould contacts in PHP; this is just a very quick proof of concept (no error handling, vcard parsing, etc.)
<?php
/**
*
* Only dependency required is "guzzlehttp/guzzle": "~6.0"
*
*/
include 'vendor/autoload.php';
$username = '*****@****.com';
<?php
$this->app->make(\Dingo\Api\Auth\Auth::class)->extend('oauth', function (Application $app) {
$provider = new PassportProvider(
$app->make(ResourceServer::class),
$app->make(TokenRepository::class)
);
$provider->setClientResolver(function (Token $token) {
return $token->client_id;
@realshadow
realshadow / .gitconfig
Last active December 12, 2017 18:11
Git aliases - for mercurial users
[alias]
# -- git ff {source} into {destination}; e.g. git ff dev test
ff = !sh -c 'git checkout $2 && git merge "$1" && git checkout "$1"' -
su = submodule update --init --recursive
co = checkout
ci = commit
st = status
graph = !sh -c 'git log --graph --decorate --oneline -n "$1"' -
# -- moves all changes to a newly created branch (which means it can not exist locally)
rb = !sh -c 'git checkout -b $1' -