Skip to content

Instantly share code, notes, and snippets.

View giorgiofellipe's full-sized avatar
🏛️
Helping people build great business

Giorgio Fellipe giorgiofellipe

🏛️
Helping people build great business
View GitHub Profile
@duluca
duluca / awc-ecs-access-to-aws-efs.md
Last active December 9, 2023 11:36
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:

@duluca
duluca / aws-ecs-deploy-permissions.md
Last active April 14, 2021 06:44
npm scripts for AWS ECS (Blue-Green Deployment)

AWS ECS Deploy Permissions

In order to be able to deploy using the scripts provided by npm scripts for AWS ECS make sure your user is part of an IAM Group that has the following inline policy applied to it.

Note: This may not be complete.

{
    "Version": "2012-10-17",
    "Statement": [
@giorgiofellipe
giorgiofellipe / instructions.md
Last active July 31, 2020 08:55
How to deploy MEAN app to AWS EC2
  1. Generate a key pair
  2. Create an AWS EC2 Instance
  3. Edit Security Group network rules
  4. Add Elastic IP and associate it to EC2 Instance
  5. Install Node
  • sudo yum install gcc-c++ openssl-devel make
  • wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
  • close ssh connection or terminal
  • nvm install [version]
  • node --version
@Bhavdip
Bhavdip / sketch-never-ending.md
Created October 6, 2016 15:53
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com

@toddmotto
toddmotto / *.md
Last active April 25, 2023 09:06
Component versus Directive in AngularJS

Component versus Directive in AngularJS

.component()

Components are not "helper" methods, they are the best change in Angular 1.x since I've been using it.

What is the role of .component()?

  • Declares new HTML via a template or templateUrl
  • Should be used to create Components as part of a Component architecture
@giorgiofellipe
giorgiofellipe / text_format.js
Last active March 22, 2016 03:15
Text format
var yourString = "The quick brown fox jumps over the lazy dog"; //replace with your string.
var finalString = "";
var maxLength = 16 // maximum number of characters to extract
var count = 0;
var maxTries = ((yourString.length / maxLength) * 2);
while (yourString.length > maxLength) {
count++;
if (count > maxTries) {
break;
@giorgiofellipe
giorgiofellipe / macbook_projector_fix
Last active August 29, 2015 14:21
Macbook does not recognize the projector
Normal way:
- Click on the Apple Menu in the top left corner of your screen
- Select System Preferences from the drop-down menu
- Select the Displays icon
- When the Displays window appears, select the Arrangement tab within the menu bar
- Check the Mirror Displays box in the lower left-hand corner of the window (Note: After checking this box, please wait several seconds. Once the displays are mirrored, you should see the same image on both your projector and computer.)
First, reset what is called the Power Management Unit (PMU) using these steps:
- Shut down the computer.
- Connect it to AC power.
@colllin
colllin / _affixWithinContainer.md
Last active November 29, 2020 17:13
ion-list sticky headers

What this does:

Within an <ion-scroll>, this directive creates sticky item headers that get bumped out of the way by the next item.

Demo: http://cl.ly/2u2X390s0H1a

Requirements:

  • Needs UnderscoreJS for its _.throttle utility.
  • Must be used within an or
@giorgiofellipe
giorgiofellipe / install_psql_php.sh
Last active October 10, 2021 05:58 — forked from doole/install_psql_php.sh
Install PHP PGSQL extensions on Mac OS X Yosemite (change PHP_VER with your PHP version)
PHP_VER="5.5.14"
# Check if extension exists first
php -m | grep pgsql
# Update brew and install requirements
brew update
brew install autoconf
# Download PHP source and extract
@szydan
szydan / gist:11225256
Created April 23, 2014 17:31
modify jar war content
jar xf my.war
rm my.war
change something in some file
jar cf ../my.war *