Skip to content

Instantly share code, notes, and snippets.

🐻
¿Cuál es la diferencia entre la participación y el compromiso?

Francisco Quintero cesc1989

🐻
¿Cuál es la diferencia entre la participación y el compromiso?
Block or report user

Report or block cesc1989

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cesc1989
cesc1989 / 001_position_args.sh
Created Oct 11, 2017
Different ways for declaring a function's arguments in Bash scripts
View 001_position_args.sh
#!/bin/bash -xe
function byPosition () {
echo "Variable in position 1: $1"
echo "Variable in position 2: $2"
}
byPosition hola mundo
@cesc1989
cesc1989 / wp-config.php
Created Oct 11, 2017 — forked from davejamesmiller/wp-config.php
Set WordPress site URL in the config file instead of the database
View wp-config.php
<?php
// WordPress stores the site URL in the database by default (which I have never
// understood), and it's a pain to have to type out the UPDATE SQL or search in
// phpMyAdmin to change it. This is a simple way to put the URL into
// wp-config.php instead.
// Note that you will still need to update any URLs that appear in the content,
// especially when you copy a database from a development site to production:
// https://gist.github.com/davejamesmiller/a8733a3fbb17e0ff0fb5
View deploy-aws-codedeploy.sh
#!/bin/bash -xe
#
# Deploy latest revision without going to the AWS web console (used for failed deployments)
#
# jq needs to be installed
# https://stedolan.github.io/jq/
aws --region us-west-2 \
deploy list-application-revisions \
--application-name staging \
@cesc1989
cesc1989 / sns_to_slack.js
Created Sep 22, 2017
Send Code Deploy deployment status to Slack via SNS using a Lambda function
View sns_to_slack.js
var https = require('https');
var util = require('util');
exports.handler = function(event, context){
console.log(JSON.stringify(event, null, 2));
console.log('From SNS:', event.Records[0].Sns.Message);
var postData = {
"channel": "#server-deploys",
"username": "AWS SNS via Lambda",
@cesc1989
cesc1989 / ubuntu_unattended_upgrades_gmail.md
Last active Mar 8, 2017 — forked from roybotnik/ubuntu_unattended_upgrades_gmail.markdown
Unattended upgrades on Ubuntu 14.04 with email notifications
View ubuntu_unattended_upgrades_gmail.md

Getting Started

Install unattended-upgrades:

$ sudo apt-get update && sudo apt-get install -y unattended-upgrades 

Frequency Configuration

@cesc1989
cesc1989 / multi-git.md
Last active Mar 20, 2019 — forked from rosswd/multi-git-win.md
Setting up a Github and Bitbucket account on the same computer.
View multi-git.md

Setting up a separate github and bitbucket account on the same computer

Github will be the main account and bitbucket the secondary.

Create SSH Keys

ssh-keygen -t rsa -C "github email"

Save keys to:

~/.ssh/id_rsa

@cesc1989
cesc1989 / http_status_codes.rb
Last active Feb 1, 2017 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
View http_status_codes.rb
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
2xx Success
200 :ok
201 :created
202 :accepted
203 :non_authoritative_information
@cesc1989
cesc1989 / code_deploy_role_policy.json
Last active Aug 30, 2016
Jenkins + CodeDeploy Setup: Roles created as Amazon EC2 type roles
View code_deploy_role_policy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"autoscaling:PutLifecycleHook",
"autoscaling:DeleteLifecycleHook",
"autoscaling:RecordLifecycleActionHeartbeat",
"autoscaling:CompleteLifecycleAction",
"autoscaling:DescribeAutoscalingGroups",
@cesc1989
cesc1989 / README.md
Last active Oct 11, 2017 — forked from bsodmike/gist:1369419
Subdomain Routing with Rails 3.1
View README.md

Implement Routing for Subdomains

Rails 3.0 introduced support for routing constrained by subdomains.

A subdomain can be specified explicitly, like this:

match '/' => 'home#index', :constraints => { :subdomain => 'www' } 
@cesc1989
cesc1989 / deploy_fe.sh
Last active Jul 18, 2016
Bash script for deploying frontend app
View deploy_fe.sh
#!/bin/bash
function move_to_staging(){
echo "Backup frontend/"$1"/dist"
cd frontend/"$1"/dist
tar -zcf backup_"$bkpdate".tar.gz .
echo "Mover backup a frontend/"$1"/backups"
mv backup_* ../backups
You can’t perform that action at this time.