Skip to content

Instantly share code, notes, and snippets.

@dvl
dvl / install_cancer.sh
Created November 18, 2013 13:24
Every time when I need Java I never remember how install it without pain.
add-apt-repository ppa:webupd8team/java
apt-get update
apt-get install oracle-jdk7-installer
#!/bin/bash
#
# Install Postgres 9.3, PostGIS and create PostGIS template on an Ubuntu 12.04 Server
cd /tmp
# add official postgresql.org ubuntu repos (http://wiki.postgresql.org/wiki/Apt)
# Create /etc/apt/sources.list.d/pgdg.list. The distributions are called codename-pgdg.
echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
@dvl
dvl / newbox.sh
Last active December 27, 2015 23:28
add-apt-repository ppa:xubuntu-dev/xfce-4.10 -y
add-apt-repository ppa:xubuntu-dev/xfce-4.12 -y
echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
apt-get update -y
apt-get install build-essential -y
apt-get install python-dev python-pip python-setuptools -y
apt-get install vim curl git -y
apt-get install postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3 libpq-dev postgresql-server-dev-9.3 pgadmin3 -y
@dvl
dvl / FIle.sublime-settings.json
Last active December 21, 2015 18:09 — forked from etrepat/FIle.sublime-settings.json
My sublime text options
{
"auto_complete": true,
"auto_complete_delay": 50,
"auto_complete_selector": "source - comment",
"auto_complete_size_limit": 4194304,
"auto_complete_triggers":
[
{
"characters": "<",
"selector": "text.html"
@dvl
dvl / bobp-python.md
Created November 13, 2015 20:03 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@dvl
dvl / README.md
Last active November 5, 2015 06:13 — forked from magnetikonline/README.md
IE 7/8/9/10/11/Edge Virtual machines from Microsoft - Linux w/VirtualBox installation notes.
# Pure
# by Sindre Sorhus
# https://github.com/sindresorhus/pure
# MIT License
# For my own and others sanity
# git:
# %b => current branch
# %a => current action (rebase/merge)
# prompt:
class DummyStorage(FileSystemStorage):
def _open(self, name, mode='rb'):
try:
return File(open(self.path(name), mode))
except IOError:
name = '/home/andre/Imagens/placeholder.jpg'
return File(open(name), mode)
DEFAULT_FILE_STORAGE = 'geral.custom_settings.DummyStorage'
@dvl
dvl / fabfile.py
Last active September 9, 2015 17:23
# -*- coding: utf-8 -*-
from fabric.api import (
env,
serial,
settings,
sudo,
task,
warn_only,
)
@dvl
dvl / akamai.py
Last active August 29, 2015 14:27
# -*- coding: utf-8 -*-
import time
from Crypto.Hash import HMAC, SHA256
class AkamaiSecureToken(object):
"""
Gera um assinatura para ser utilizada junto com o Akamai, para autenticar