This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def post_list(self, request, **kwargs): | |
deserialized = self.deserialize(request, | |
request.raw_post_data, | |
format=request.META.get('CONTENT_TYPE', | |
'application/json')) | |
bundle = self.build_bundle(data=dict_strip_unicode_keys(deserialized)) | |
self.is_valid(bundle, request) | |
updated_bundle = self.obj_create(bundle, request=request) | |
resp = self.create_response(request, | |
self.full_dehydrate(updated_bundle.obj)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from oauth2 import Error | |
from django.utils.translation import ugettext as _ | |
from tastypie.authentication import Authentication | |
from oauth_provider.utils import initialize_server_request, send_oauth_error, get_oauth_request | |
from oauth_provider.consts import OAUTH_PARAMETERS_NAMES | |
from oauth_provider.store import store, InvalidTokenError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
usage: | |
fab -f distkeys.py set_hosts:/path/to/hosts_file add_key:/path/to/key | |
Use --password and --user options as necessary | |
Inspired by shell script at http://github.com/mlbright/mybin/raw/master/distkeys.sh | |
Fabric recipe to distribute your ssh key to large number of hosts. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "What should the Application be called (no spaces allowed e.g. GCal)?" | |
read inputline | |
name="$inputline" | |
echo "What is the url (e.g. https://www.google.com/calendar/render)?" | |
read inputline | |
url="$inputline" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- this usually goes in <project-root>/templates/uni_form/field.html --> | |
{% if field.is_hidden %} | |
{{ field }} | |
{% else %} | |
<div class="clearfix {% if field.errors %}error{% endif %}"> | |
<label for="{{ field.auto_id }}" {% if field.field.required %}class="requiredField"{% endif %}> | |
{{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %} | |
</label> | |
<div class="input"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
knife cookbook upload apt | |
knife cookbook upload yum | |
knife cookbook upload build-essential | |
knife cookbook upload ucspi-tcp | |
knife cookbook upload erlang | |
knife cookbook upload runit | |
knife cookbook upload bluepill | |
knife cookbook upload daemontools | |
knife cookbook upload couchdb | |
knife cookbook upload apache2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user = ENV['OPSCODE_USER'] || ENV['USER'] | |
base_box = ENV['VAGRANT_BOX'] || 'centos-5.5-x86_64' | |
Vagrant::Config.run do |config| | |
config.vm.define :web do |web_config| | |
web_config.vm.box = base_box | |
web_config.vm.forward_port("http", 80, 8080) | |
web_config.vm.provision :chef_client do |chef| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This allows you to import Django modules into a Salt module | |
""" | |
import logging | |
import sys | |
import os | |
log = logging.getLogger(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include: | |
- apt | |
# our custom sources | |
/etc/apt/sources.list.d/fatbox.list: | |
file: | |
- managed | |
- source: salt://fatbox/debian/apt/fatbox.list | |
- owner: root | |
- group: root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% macro postconf(key, value) -%} | |
postconf-{{ key }}: | |
cmd: | |
- run | |
- name: | |
- postconf -e {{ key }}='{{ value }}' | |
- unless: test "x$(postconf -h {{ key }} )" = 'x{{ value }}' | |
- require: | |
- pkg: postfix |
OlderNewer