Skip to content

Instantly share code, notes, and snippets.

View votaguz's full-sized avatar

Jose Molina votaguz

  • Bogotá, Colombia
View GitHub Profile
@votaguz
votaguz / clone_lambda.py
Created January 1, 2018 23:23
Script to clone lambda functions in AWS
import argparse
import os
import random
import string
import boto3
LAMBDA_CONFIG_TEMPLATE = ["TracingConfig", "FunctionName", "VpcConfig", "MemorySize", "Environment", "Handler", "Role", "Timeout", "Runtime", "Description"]
def clone_lambda(aws_client, name, code_zipfile_path):
@votaguz
votaguz / send_pdf_with_boto_ses.py
Created February 17, 2016 04:32 — forked from yosemitebandit/send_pdf_with_boto_ses.py
send PDF attachment with boto and SES
''' quick example showing how to attach a pdf to multipart messages
and then send them from SES via boto
'''
from email.mime.text import MIMEText
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
import boto
#!/bin/bash
set -e
cd /home/wayuu/apps/wayuu/wayuu
source /home/wayuu/apps/wayuu/bin/activate
exec ./manage.py runserver 0.0.0.0:9000
from tutorya.settings import *
print 'Usando local_settings'
DEBUG = True
#Auth User Model Information
# AUTH_USER_MODEL = 'profiles.User'
# EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
INTERNAL_IPS = ('127.0.0.1',)
from django.shortcuts import redirect
from social_auth.middleware import SocialAuthExceptionMiddleware
from social_auth.exceptions import AuthAlreadyAssociated
class CustomSocialAuthExceptionMiddleware(SocialAuthExceptionMiddleware):
def get_redirect_uri(self, request, exception):
if isinstance(exception, AuthAlreadyAssociated):
# Redirect this error to a custom page where the situation is
# The install script
# Adapted from https://gist.github.com/579814
echo '# Added by install script for node.js and npm in 30s' >> ~/.bashrc
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
echo 'export NODE_PATH=$HOME/local/lib/node_modules' >> ~/.bashrc
. ~/.bashrc
mkdir -p ~/local
mkdir -p ~/Downloads/node-latest-install
@votaguz
votaguz / gist:978309
Created May 18, 2011 09:57
Now Example Error
console@macbook : $ node helloworld_server.js
{ stack: [Getter/Setter],
arguments: undefined,
type: undefined,
message: 'EBADF, Bad file descriptor \'/Users/Votaguz/Downloads/Flotype-now-2879dfe/examples/helloworld_example/nowjs.json\'',
errno: 9,
code: 'EBADF',
path: '/Users/Votaguz/Downloads/Flotype-now-2879dfe/examples/helloworld_example/nowjs.json' }
Error: EBADF, Bad file descriptor '/Users/Votaguz/Downloads/Flotype-now-2879dfe/examples/helloworld_example/nowjs.json'
at Object.openSync (fs.js:200:18)
[{"retweet_count":0,"in_reply_to_status_id":null,"text":"miss ya (◕‿◕✿) yahaay #abaikan","created_at":"Mon May 16 05:50:12 +0000 2011","in_reply_to_screen_name":null,"in_reply_to_status_id_str":null,"contributors":null,"retweeted":false,"in_reply_to_user_id_str":null,"source":"<a href=\"http://m.ubersocial.com\" rel=\"nofollow\">ÜberSocial Mobile</a>","id_str":"70003091608576000","place":null,"coordinates":null,"geo":null,"in_reply_to_user_id":null,"truncated":false,"user":{"default_profile":true,"notifications":null,"created_at":"Mon Jan 17 11:54:32 +0000 2011","profile_sidebar_border_color":"C0DEED","following":null,"description":"I always learn to appreciate and love what i\\\\","default_profile_image":false,"profile_use_background_image":true,"profile_image_url":"http://a2.twimg.com/profile_images/1265561397/IMG03499-20110217-1330_normal.jpg","show_all_inline_media":false,"verified":false,"geo_enabled":false,"friends_count":93,"profile_background_color":"C0DEED","profile_background_image_url":"ht
events.js:129
throw new Error('removeListener only takes instances of Function');
^
Error: removeListener only takes instances of Function
at EventEmitter.removeListener (events.js:129:11)
at Object._onTimeout (/Users/Votaguz/Downloads/yiwang-node-tweet-5c9a1f5/tweet.js:61:18)
at Timer.callback (timers.js:62:39)