print('some string') # good
print 'some string' # bad
print()
has been moved to a function in Python 3 docs.
from django.core.exceptions import ObjectDoesNotExist | |
from django.template.loader import render_to_string | |
from django.conf import settings | |
from pprint import pprint | |
import requests | |
from xml.dom import minidom | |
from apps.donations.models import Donation | |
AUTH_URL = 'https://api.authorize.net/xml/v1/request.api' |
PATH="/usr/local/bin:$PATH" | |
[[ -s $HOME/.pythonbrew/etc/bashrc ]] && source $HOME/.pythonbrew/etc/bashrc | |
export WORKON_HOME=~/envs | |
export PROJECT_HOME=~/git | |
source ~/.pythonbrew/pythons/Python-2.7.2/bin/virtualenvwrapper.sh | |
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages' |
print('some string') # good
print 'some string' # bad
print()
has been moved to a function in Python 3 docs.
python package installer - look for packages on pypi
pip install package_name
- installs package from pypipip install -r requirements file
- installs packages from a requirements filepip uninstall package_name
- uninstalls packagepip freeze
- output packages to stdout in requirements format, can be piped to a file#!/bin/bash | |
# store the current dir | |
CUR_DIR=$(pwd) | |
# Let the person running the script know what's going on. | |
echo "--- Pulling in latest changes for all repositories... ---" | |
# Find all git repositories and update it to the master latest revision | |
for i in $(find . -name ".git" | cut -c 3-); do |
=begin
Example box JSON schema
{
:name => :name_of_vagrant_box, #REQUIRED
:ip => '10.0.0.11', #REQUIRED
:synced_folders => [
{ '.' => '/home/vagrant/myapp' }
],
:commands => [
#! /bin/bash | |
# Checks that your Github repos are up to date | |
DIRS=() | |
sync=$1 | |
for file in */ cookbooks/*; do | |
DIRS+=("`pwd`/${file}"); |
For the saltstack tutorial, just install the [latest vagrant](https://docs.vagrantup.com/v2/getting-started/index.html) and use the below Vagrantfile to build a new vagrant box: | |
`Vagrantfile` | |
``` | |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.provision "shell", inline: <<-SHELL |
#!/bin/bash | |
# Creates a host identity using host-factory and places it in /etc/conjur.identity | |
# Requires the Conjur CLI and host-factory plugin to be installed | |
# Usage: | |
# ./hostfactory_bootstrap.sh 92198eb129peh812ue9puihd891 mynewhost1 | |
hostfactory_token=$1 | |
host_name=$2 |