A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
| # Load Json into a Python object | |
| import urllib2 | |
| import json | |
| req = urllib2.Request("http://localhost:81/sensors/temperature.json") | |
| opener = urllib2.build_opener() | |
| f = opener.open(req) | |
| json = json.loads(f.read()) | |
| print json | |
| print json['unit'] |
| # -*- coding: utf-8 -*- | |
| from bottle import route, run | |
| @route('/') | |
| def index(): | |
| return '<h1>Hello World/h1>' | |
| run(host='localhost', port=8000) |
| import unittest, os, os.path, sys, urllib | |
| import tornado.database | |
| import tornado.options | |
| from tornado.options import options | |
| from tornado.testing import AsyncHTTPTestCase | |
| # add application root to sys.path | |
| APP_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) | |
| sys.path.append(os.path.join(APP_ROOT, '..')) |
In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.
The following table presents the MySQL/Oracle executables and the corresponding MongoDB executables.
| =verified all libs through ipc 20180919 version are included in this list, not that we have all these headers= | |
| == Visual Studio 2005 (DO NOT COPY THIS LINE) == | |
| Microsoft Visual Studio Solution File, Format Version 9.00 | |
| # Visual Studio 2005 | |
| == Visual Studio 2010 (DO NOT COPY THIS LINE) == | |
| Microsoft Visual Studio Solution File, Format Version 11.00 |
| # -- coding: utf-8 -- | |
| from win32api import * | |
| from win32gui import * | |
| import win32con | |
| import sys, os | |
| import struct | |
| import time | |
| class WindowsBalloonTip: |
Services declared as oneshot are expected to take some action and exit immediatelly (thus, they are not really services,
no running processes remain). A common pattern for these type of service is to be defined by a setup and a teardown action.
Let's create a example foo service that when started creates a file, and when stopped it deletes it.
Create executable file /opt/foo/setup-foo.sh:
| urlencode() { | |
| # urlencode <string> | |
| old_lc_collate=$LC_COLLATE | |
| LC_COLLATE=C | |
| local length="${#1}" | |
| for (( i = 0; i < length; i++ )); do | |
| local c="${1:i:1}" | |
| case $c in | |
| [a-zA-Z0-9.~_-]) printf "$c" ;; |
DevOps started out as "Agile Systems Administration". In 2008, Andrew Shafer did a talk called "Agile Infrastucture" addressing issues around involving more of the company in the same disciplines as programmers.
In 2009, Patrick Debois created "DevOpsDays" conference to help to bring it to light. However, it wouldn't begin to trend until about 2010, when people would begin to describe it as a standalone discipline.
Today, DevOps goes beyond just developers, systems administration and infrastructure, its about [dev, ops, agile, cloud