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 fabric.api import local | |
import pip | |
def freeze (): | |
local("pip freeze > requirements.txt") | |
local("git add requirements.txt") | |
local("git commit -v") | |
def upgrade (): | |
for dist in pip.get_installed_distributions(): |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
# Every Vagrant virtual environment requires a box to build off of. | |
config.vm.box = "precise64" | |
# The url from where the 'config.vm.box' box will be fetched if it | |
# doesn't already exist on the user's system. | |
config.vm.box_url = "http://files.vagrantup.com/precise64.box" |
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
// Add Honeypot protection. | |
if (module_exists('honeypot')) { | |
honeypot_add_form_protection($form, $form_state, array('honeypot', 'time_restriction')); | |
} |
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
@deferred | |
def deferred_check_missing(node, kw): | |
try: | |
json_request = kw.get("request").json_body | |
except ValueError: | |
raise Invalid(node, "Malformed JSON provided") | |
if "mail" not in json_request and "uuid" not in json_request: | |
raise Invalid(node, "Both mail and uuid are missing") |
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
import re | |
import collections | |
def get_current_mounts(): | |
""" Get the currently mounted filesystems. """ | |
# Reading from /proc/mounts is only consistent within a single read(3) | |
# call. Unfortunately, the maximum amount of data you can get from | |
# this file in a single call is hardcoded by the kernel to PAGE_SIZE | |
# (4096 bytes on x86). As a consequence, there is no way to read |
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
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAvzMU1f2mRAMTSSJmLp3QFfnZIk4AGlZQggSO1OuMEn9sqvmHSEyckW516A4eoqBvukFod4bBjl72bNZBMSCXjgELmiGxNvr0iDeuefSR4vHKBqgUp9HhDakSNGz6eBjV5XN0iyhzwe/0N4PHq0wlwwETAE1QzHGia9RiIfpo6jYUPehzUi7CKXJLmmtaOTRm6zRNdrj1P97ZBw/5CbPT2yOYPQlnl1A/FQqxocODKTSCGQSvrOZ1Y0qCmg0Fl63PcpH2KDZW5FIcIA8yPWE07xT7zfQOe+wu3IZ+aK38hUGdoZmzYPlGo49vf03/KOo6vwBUzeY2SEbZ/Nflu+F80Q== |
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
eval $(ls /dev/drbd* | sed 's/\/dev\/drbd//g' | awk '{print "drbdsetup " $1 " down;"}' ) ; lvremove -f /dev/platform_test/*-0 ; lvremove -f /dev/platform_test/*-1 |
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
systemctl stop squid.service | |
rm -rf /var/spool/squid | |
mkdir -p /var/spool/squid | |
chown proxy: /var/spool/squid | |
squid -z | |
systemctl start squid.service |
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
; -*-conf-*- | |
api = 2 | |
core = 7.x | |
; Commerce kickstart. | |
projects[commerce_kickstart][type] = core | |
; Be2Bill needed modules. | |
projects[commerce_cardonfile] = "2.0-beta2" | |
projects[commerce_be2bill] = "1.x-dev" |
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
import pkg_resources | |
for pkg in pkg_resources.working_set: | |
if pkg.requires(): | |
print '{} => {}'.format(pkg.key, ', '.join(req.project_name for req in pkg.requires())) | |
else: | |
print pkg.key |