Skip to content

Instantly share code, notes, and snippets.

View glarrain's full-sized avatar
🤘
rockin'

Germán Larraín glarrain

🤘
rockin'
View GitHub Profile
@glarrain
glarrain / connect-heroku-app-to-postgres-rds-with-ssl.md
Last active January 4, 2023 14:01 — forked from jonyt/connect_heroku_to_amazon_rds
How to connect a Heroku application to an Amazon RDS PostgreSQL instance, forcing SSL and certificate chain verification

1 - Download the RDS certificates (root plus region-specific intermediate ones) bundle:

wget -O config/rds-combined-ca-bundle.pem https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem

2 - Add config/rds-combined-ca-bundle.pem to the repository and redeploy to Heroku.

3 - Update the DATABASE_URL env var:

# -*- coding: utf-8 -*-
import sys
import time
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
class Screenshot(QWebView):
def __init__(self):
self.app = QApplication(sys.argv)
#!/usr/bin/env python
# Librerias necesarias
import paramiko
import os
# Datos para la conexion SSH
ssh_servidor = '10.0.70.44'
ssh_usuario = 'tuusuario'
ssh_clave = 'tucontraseña'
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/python");</script>
sudo apt-get install build-essential libsqlite3-dev zlib1g-dev libncurses5-dev libgdbm-dev libbz2-dev libreadline5-dev libssl-dev
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar xz Python-2.7.3.tgz
cd Python-2.7.3
./configure
make
sudo make altinstall
python2.7
@glarrain
glarrain / MySQL-Chile:regiones-provincias-comunas
Created November 16, 2012 19:49 — forked from juque/MySQL-Chile:regiones-provincias-comunas
Chile: Regiones, Provincias, Comunas
/* Estructura y Datos de las Regiones, Provincias */
/* y Comunas de Chile. */
/* */
/* Fecha: Julio 2010 */
/* Autor: Juan Pablo Aqueveque - juque.cl */
--
-- Comunas
--
DROP TABLE IF EXISTS `comunas`;
@glarrain
glarrain / tweets.py
Created October 17, 2012 12:54
Retrieve a user's last tweets
from urllib2 import urlopen
from django.utils.simplejson import loads
from oauth2 import Token
from social_auth.backends.utils import build_consumer_oauth_request
from social_auth.backends.twitter import TwitterAuth
@glarrain
glarrain / are-domains-up.sh
Created October 17, 2012 12:42
Test whether each of the domains in the list is up or not
#!/usr/bin/env sh
# Uses curl to connect to www.isup.me, a website that checks if a given domain
# is up or not. The response will contain "It's just you" if the domain is up.
# If not, it will contain "It's not just you".
test $# -lt 1 && (echo "Usage: $0 domain [domain2] [domain3] ..."; exit 1;)
for domain in "$@"; do
echo -n "$domain: "