Skip to content

Instantly share code, notes, and snippets.

Aswa Paul giantas

Block or report user

Report or block giantas

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
jasonrdsouza /
Created Jan 25, 2012
Python script to access a gmail account and download particular emails
import email, getpass, imaplib, os
detach_dir = '.' # directory where to save attachments (default: current)
user = raw_input("Enter your GMail username:")
pwd = getpass.getpass("Enter your password: ")
# connecting to the gmail imap server
m = imaplib.IMAP4_SSL("")
m.login(user,pwd)"cs2043") # here you a can choose a mail box like INBOX instead
micho / nginx.conf
Last active Oct 17, 2019 — forked from unixcharles/nginx.conf
nginx config for http/https proxy to localhost:3000
View nginx.conf
First, install nginx for mac with "brew install nginx".
Then follow homebrew's instructions to know where the config file is.
1. To use https you will need a self-signed certificate:
2. Copy it somewhere (use full path in the example below for server.* files)
3. sudo nginx -s reload
4. Access https://localhost/
Edit /usr/local/etc/nginx/nginx.conf:
ibeex / foo.log
Created Aug 4, 2012
Flask logging example
View foo.log
A warning occurred (42 apples)
An error occurred
pmdarrow / gist:3427827
Created Aug 22, 2012
How to compile wkhtmltopdf static binary on Ubuntu 12.04
View gist:3427827
# These instructions were tested on Ubuntu 12.04 64bit
# Be prepared to wait a while...
sudo apt-get install openssl build-essential xorg libssl-dev libxrender-dev libxext-dev libpq-dev libx11-dev
git clone git://
git clone git:// wkhtmltopdf-qt
cd wkhtmltopdf
mkdir static-build
ln -s ../wkhtmltopdf-qt static-build/qt
vadviktor /
Created Aug 30, 2012
Python: move files to creation date named directories
import os, time, shutil, sys
dir = sys.argv[1]
for f in os.listdir('.'):
ftime = time.gmtime(os.path.getmtime(f))
ctime_dir = str(ftime.tm_year) '-' str(ftime.tm_mon) '-' str(ftime.tm_mday)
if not os.path.isdir(ctime_dir):
Atem18 / gist:4696071
Last active Nov 5, 2019 — forked from evildmp/gist:3094281
Tutorial to seting up a django website in production.
View gist:4696071

Set up Django, Nginx and Gunicorn in a Virtualenv controled by Supervisor

Steps with explanations to set up a server using:

  • Virtualenv
  • Virtualenvwrapper
  • Django
  • Gunicorn
macieksk /
Created Jul 2, 2014
A simple Python module to upload files to Google Drive file upload. Needs a file 'client_secrets.json' in the directory . The file can be obtained from -- under APIs&Auth/Credentials/Create Client ID for native application
## Simple Python module to upload files to Google Drive
# Needs a file 'client_secrets.json' in the directory
# The file can be obtained from
# under APIs&Auth/Credentials/Create Client ID for native application
# To test usage:
# import google_drive_util
# google_drive_util.login()
# google_drive_util.test()
nagyv / 0 - odoo logs to sentry
Last active Dec 5, 2018 — forked from avoine/gist:2912777
Script to send rsyslog message of OpenERP to Sentry
View 0 - odoo logs to sentry
This gist provides a simple setup to add Sentry logging to OpenERP/Odoo.
As Odoo's logging setup is rather limited, I'm using syslog to collect and forward logs to Sentry.
These scripts should run without any modification on an Ubuntu based server, assuming the paths and user names for openerp match with the ones in the `supervisord.conf` file.
To have rsyslog2sentry run fine, you'll need some python pagkages installed
$ pip install raven loggerglue
View RedisSessionStore
class RedisSessionStore(SessionStore):
def __init__(self, expire = 1800, key_prefix=''):
self.redis = redis.Redis(tools.config.get('redis_host', 'localhost'),
int(tools.config.get('redis_port', 6379)),
int(tools.config.get('redis_dbindex', 1)),
password=tools.config.get('redis_pass', None))
self.path = session_path()
self.expire = expire
self.key_prefix = key_prefix


When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
You can’t perform that action at this time.