Skip to content

Instantly share code, notes, and snippets.

View shekodn's full-sized avatar

Sergio Díaz shekodn

  • MX
View GitHub Profile
@claudioc
claudioc / gist:aed152ceebdc8936dd0f4a0009893cdc
Created January 7, 2021 18:56
Fastest way to create an EC2 machine with Amazon provided SSL certificates (?)
Since you can only use ACM provided certificates from (A/N/E)LB or CloudFormation, I think this
could be the easiest way (using ALB).
- (EC2) Create a security group that only accepts HTTPS
- (EC2) Create a security group that only accepts HTTP connection from the security group above
- (EC2) Create the EC2 instance and bind it to the the security group above
- (EC2) Create a Target Group and use the above EC2 as the target inside it
- (ACM) Create the SSL certificate in ACM (hint: you can create it directly from Route53)
- (EC2) Create an Application Load Balancer in the same EC2's AZs using the above target group and the SSL certificate
- (Route53) Edit your DNS zone to add the LB A record (use its Alias and autocomplete)
@ultim8k
ultim8k / git_retag
Last active June 7, 2024 13:28 — forked from lucijafrkovic/git_retag
Retagging on git
1. list all remote tags
git ls-remote --tags
2. delete local tag
git tag -d v1.0.1
3. push tag deletion to remote
git push origin :refs/tags/v1.0.1
4. tag local branch again
@nantsou
nantsou / AesCbc.py
Created March 6, 2019 15:48
AES/CBC/PKCS5PADDING in python
# -*- coding: utf-8 -*-
from Crypto.Cipher import AES
import base64
import re
DEFAULT_KEY = 'anrxvpAAa9x5kEUm'
class AesCbc:
@nbigot
nbigot / ansible_playbook-aws-install-docker.yml
Last active April 8, 2024 19:30
Ansible playbook AWS - install docker
# Ansible playbook AWS - install docker
---
- name: "AWS - Install docker"
hosts: aws-docker-vms
become: yes
tasks:
- name: Update all packages
yum:
name: '*'
state: latest
@diegozr1
diegozr1 / fintech_api_list.md
Last active December 20, 2023 17:51
Curated list of Mexican Fintech APIs
@flox1an
flox1an / default.conf
Last active September 1, 2023 07:26
nginx config that uses the oauth2-proxy (via auth_request) to authenticate against gitlab and then proxies all requests to a backend service while setting the auth headers X-User and X-Email
server {
listen 80;
server_name localhost;
location /oauth2/ {
proxy_pass http://oauth-proxy:4180;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Auth-Request-Redirect $request_uri;
@davydany
davydany / IPTABLES-CHEATSHEET.md
Last active July 18, 2024 16:24
IP Tables (iptables) Cheat Sheet

IP Tables (iptables) Cheat Sheet

IPTables is the Firewall service that is available in a lot of different Linux Distributions. While modifiying it might seem daunting at first, this Cheat Sheet should be able to show you just how easy it is to use and how quickly you can be on your way mucking around with your firewall.

Resources

The following list is a great set of documentation for iptables. I used them to compile this documentation.

@belgoros
belgoros / AWS S3-Paperclip5-Heroku.md
Created November 3, 2016 21:43
Setup Rails app with Paperclip 5, Amazon S3 and Heroku

Setting Amazon S3 for Paperclip and Heroku

The latest Paperclip release 5.1.0 has changed a little bit the way to set it up with Amazon S3 service (Amazon Simple Storage Service). Moreover, after googling a lot here and there, we could see many solutions and settings, some of them being outdated, some - often different and did not work well. So I decided to summarize in one replace all the steps needed to set up your Rails application deployed on Heroku and be able to use it with Paperclip 5 and Amazon S3 service.

In case you don't know, Heroku does not allow your Rails application to write and offers read only access. What means that you can't use Paperclip and save your files to Heroku's file system.

So you will have to find a way to upload/store/read your files. As stated in Paperclip documentation, Paperclip ships with 3 storage adapters:

_ _ _ ____ _ _
| | | | __ _ ___| | __ | __ ) __ _ ___| | _| |
| |_| |/ _` |/ __| |/ / | _ \ / _` |/ __| |/ / |
| _ | (_| | (__| < | |_) | (_| | (__| <|_|
|_| |_|\__,_|\___|_|\_\ |____/ \__,_|\___|_|\_(_)
A DIY Guide
@Daenyth
Daenyth / debug_requests.py
Created August 27, 2015 14:35
Enable debug logging for python requests
import requests
import logging
import httplib
# Debug logging
httplib.HTTPConnection.debuglevel = 1
logging.basicConfig()
logging.getLogger().setLevel(logging.DEBUG)
req_log = logging.getLogger('requests.packages.urllib3')
req_log.setLevel(logging.DEBUG)