Skip to content

Instantly share code, notes, and snippets.

Both things have been introduced recently, and let you access even private ec2 instances

  1. Without VPN
  2. No open SSH port
  3. Authentication / Authorization is fully delegated to IAM
# Assumes valid AWS Credentials in ENV
@Maks3w
Maks3w / terraform_coding-style.yml
Created May 23, 2020 12:06
GitHub Action for Terraform Coding Style fixes automatization
name: Terraform Coding Style fixer
description: 'Terraform Coding Style fixer creates a Pull Request with the suggested Coding Style fixes'
on: push
jobs:
terraform-fmt:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
with:
@Maks3w
Maks3w / ssh.sh
Last active February 14, 2021 20:46
This script locate and SSH into an EC2 instance executing the given ECS service
#!/usr/bin/env bash
if [[ $# -lt 2 ]]; then
echo "Invalid arguments $0 <cluster> <service>"
exit 1
fi
cluster=$1
service=$2
import {Directive, forwardRef, Provider} from "angular2/core";
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from "angular2/common";
import {CONST_EXPR} from "angular2/src/facade/lang";
const FILE_VALUE_ACCESSOR = CONST_EXPR(
new Provider(NG_VALUE_ACCESSOR, {useExisting: forwardRef(() => FileControlValueAccessor), multi: true})
);
/**
* The accessor for listening to changes that is used by the
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace ZendTest\Serializer\Adapter;
use Zend\Json\Encoder;
@Maks3w
Maks3w / FailedValidation.php
Created October 8, 2015 12:37
Conditional require fields on Apigility
<?php
namespace Application\Problem;
use ZF\ApiProblem\ApiProblem;
/**
* Represent a Failed Validation API Problem.
*
* This Problem must be used only when the failure is specific to one or many fields.

Keybase proof

I hereby claim:

  • I am maks3w on github.
  • I am maks3w (https://keybase.io/maks3w) on keybase.
  • I have a public key whose fingerprint is ABE3 86A0 E299 AD22 50D9 3DF0 C194 028A D695 06E3

To claim this, I am signing this object:

@Maks3w
Maks3w / OAuth2ServerFactoryCryptoToken.php
Created April 30, 2015 22:12
ZF2 OAuth2 with JWT AcessToken response type
<?php
namespace FooOAuth2\Factory;
use FooOAuth2\Storage\ClientCredentialsStorage;
use OAuth2\GrantType\ClientCredentials;
use OAuth2\GrantType\UserCredentials;
use OAuth2\ResponseType\JwtAccessToken as JwtAccessTokenResponseType;
use OAuth2\Server as OAuth2Server;
use OAuth2\Storage\JwtAccessToken as JwtAccessTokenStorage;
Name: php-5.4
Cartridge-Short-Name: PHP
Display-Name: PHP 5.4.5
Description: "PHP is a general-purpose server-side scripting language originally designed for Web development to produce dynamic Web pages. The mod_php Apache module is used to execute PHP applications. Popular development frameworks include: CakePHP, Symfony, and Code Igniter. Popular applications include: Drupal, Wordpress, and Mediawiki."
Version: 5.4.5
Source-Url: https://github.com/nhymxu/openshift-origin-cartridge-php-5.4/archive/master.zip
License: "The PHP License, version 3.0"
License-Url: http://www.php.net/license/3_0.txt
Vendor: php.net
Cartridge-Vendor: getup
@Maks3w
Maks3w / ghgfk.html
Last active December 19, 2015 07:59
GitHub Git Flow Killer first stub
<!DOCTYPE html>
<html>
<head>
<title>Merge GitHub's PRs with Git Flow style</title>
<link rel="stylesheet" href="css/bootstrap.css"/>
<link rel="stylesheet" href="css/bootstrap-responsive.min.css"/>
</head>
<body>
<div class="container">