$ sudo pip install awscli (or: sudo apt-get install awscli)
$ aws configure
You'll need to fill the following settings:
from django.contrib.contenttypes.models import ContentType | |
from django.contrib.contenttypes.fields import GenericForeignKey | |
from django.db import models | |
class GenericModelMixin(models.Model): | |
model_id = models.PositiveIntegerField(blank=True, null=True, editable=False) | |
model_type = models.ForeignKey(ContentType, blank=True, null=True, editable=False) | |
model_object = models.GenericForeignKey('model_type', 'model_id') |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
VAGRANTFILE_API_VERSION = 2 | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
# The most common configuration options are documented and commented below. |
import sys | |
import time | |
import random | |
import string | |
def animate( | |
text, timing=0.05, shift=5, reverse=False, | |
decrypt=False, decrypt_key=1, chars=string.printable[:74]): |
name: datascience | |
dependencies: | |
- python=2.7.11 | |
- numpy | |
- llvmlite=0.9.0 | |
- numba=0.24.0 | |
- pip: | |
- ipdb==0.9.0 | |
- ipython==4.1.2 |
name: example | |
channels: | |
- javascript # required to install nodejs | |
dependencies: | |
- python=3.5.1 | |
- numpy=1.9.* | |
- nodejs=0.10.* | |
- django | |
- pip: | |
- python-iprofile |
class Scanner(object): | |
def __init__(self, rules, flags=0): | |
pattern = Pattern() | |
pattern.flags = flags | |
pattern.groups = len(rules) + 1 | |
self.rules = [name for name, _ in rules] | |
self._scanner = sre_compile(SubPattern(pattern, [ | |
(BRANCH, (None, [SubPattern(pattern, [ |
# A shortcut function that simplifies usage of xclip. | |
cb() { | |
local _scs_col="\e[0;32m"; local _wrn_col='\e[1;31m'; local _trn_col='\e[0;33m' | |
# Check that xclip is installed. | |
if ! type xclip > /dev/null 2>&1; then | |
echo -e "$_wrn_col""Install xclip with 'apt-get xclip'.\e[0m" | |
# Check user is not root (root doesn't have access to user xorg server) | |
elif [[ "$USER" == "root" ]]; then | |
echo -e "$_wrn_col""Must be regular user (not root) to copy a file to the clipboard.\e[0m" |
build: | |
@docker build -t webgoat . | |
run: | |
@docker run -d -ti --name webgoat -p 80:8080 webgoat | |
log: | |
@docker logs -f webgoat | |
stop: |
# variables | |
dbname=$1 | |
dumpfile=$2 | |
dbbk=$dbname"_bk" | |
# defaults | |
usebk=${3:-false} | |
host=${4:-localhost} | |
port=${5:-5432} | |
username=${6:-postgres} |