Skip to content

Instantly share code, notes, and snippets.

View Luis-Palacios's full-sized avatar
🎯
Focusing

Luis Palacios Luis-Palacios

🎯
Focusing
View GitHub Profile
@quiver
quiver / athena.py
Last active August 19, 2022 11:19
query SQL to Amazon Athena and save its results from Amazon S3 Raw
#!/usr/bin/env python
# vim: set fileencoding=utf8 :
```
$ pip install -U boto3 retrying
$ export AWS_DEFAULT_PROFILE=test
$ cat foo.sql
select count(*)
from bar
$ python athena.py foo.sql
$ ls -1
@Luis-Palacios
Luis-Palacios / 1.python_dependencies.bash
Last active October 8, 2015 03:49
Installing and configuring ubuntu server for django application
#You will probably need root privilegies so use sudo before any command or login as root
#Lets update everything before we go
apt-get update
apt-get upgrade
#Now for the python dependencies
#You need all of this in order for python to compile with full power
@aaugustin
aaugustin / admin.py
Last active August 7, 2022 19:39
Read-only ModelAdmin for Django
from django.contrib import admin
class ReadOnlyModelAdmin(admin.ModelAdmin):
"""
ModelAdmin class that prevents modifications through the admin.
The changelist and the detail view work, but a 403 is returned
if one actually tries to edit an object.