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/bash -xe | |
HOSTNAME=`hostname | sed 's/.managed.contegix.com//' | sed 's/apture-//'` | |
REMOTE_PATH="/home/csar/logs/spawning/${HOSTNAME}/" | |
DESTINATION="csar@apture-stat01" | |
cd /var/log/spawning | |
echo "Syncing to ${DESTINATION}:${REMOTE_PATH}" |
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
exec { 'applydaemontoolspatch': | |
require => File['daemontoolspatch'], | |
path => $path, | |
command => 'patch < daemontools-0.76.errno.patch', | |
cwd => '/package/admin/daemontools-0.76/src', | |
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
% dsh -a -- lsb_release -i -r | |
Distributor ID: RedHatEnterpriseServer | |
Release: 5.6 | |
Distributor ID: RedHatEnterpriseServer | |
Release: 5.6 | |
Distributor ID: RedHatEnterpriseServer | |
Release: 5.6 | |
Distributor ID: RedHatEnterpriseServer | |
Release: 5.6 | |
Distributor ID: RedHatEnterpriseServer |
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
WARN [main] 2011-10-10 16:43:07,216 CLibrary.java (line 125) Unknown mlockall error 0 | |
WARN [main] 2011-10-10 16:48:48,067 CLibrary.java (line 125) Unknown mlockall error 0 |
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 parseDisambiguation(self, introtext, categories): | |
''' | |
Some Disambiguation Pages use a category to denote their purpose, | |
while some just use "Title may refer to:" with hardcoded lists | |
''' | |
if self._match_categories(categories, ('disambiguation',)): | |
return True | |
title = self.article.decode('utf8') | |
if introtext.startswith('%s may refer to:' % title): | |
return True |
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
parentHash = unicode(hash(richResult)) | |
# If for whatever reason we don't have a proper parentHash, we'll | |
# try to salvage the original (raw) item and bail out | |
if not parentHash: | |
logResult(item.rawItem) | |
yield item.rawItem | |
return |
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 apture.main.util import wikipedia | |
>>> article = wikipedia.wikipediaItemFromTitle('Barack Obama') | |
>>> dir(article) | |
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_isNSFW', '_itemFields', '_props', 'acceptableImageExtensions', 'category', 'data', 'full', 'hash', 'iconPos', 'id', 'introText', 'isNSFW', 'jsClassName', 'jsClassNames', 'jsProperties', 'key', 'name', 'newFromJSSerializedProperties', 'newFromSerializedProperties', 'parentHash', 'posterImage', 'prettySource', 'promote', 'rank', 'rawItem', 'sanitizeInput', 'serializedProperties', 'sourceIndex', 'statsCategory'] | |
>>> dir(article.rawItem) | |
['DoesNotExist', 'IGNORED_PREFIXES', 'MEDIAWIKI_URL', 'Meta', 'VERSION', '__class__', '__contains__', '__delattr__', '__delitem__', '__dict__', '__doc__', '__eq__', '__format__', '__getattribute__', '__getite |
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
apture.make("RichWikipediaArticle", { | |
"iconPos": [3, 0], | |
"full": false, | |
"hash": "906446685", | |
"title": "Barack Obama", | |
"parentHash": "-1528330559", | |
"prettySource": "Wikipedia", | |
"posterImage": ["http://commons.wikimedia.org/w/thumb.php?w=160&f=Official_portrait_of_Barack_Obama.jpg", "http://en.wikipedia.org/w/thumb.php?w=160&f=Official_portrait_of_Barack_Obama.jpg", "http://www.freebase.com/api/trans/image_thumb/guid/9202a8c04000641f800000000029c277?maxwidth=160&maxheight=1000&onfail=http://cdn.apture.com/missingimage"], | |
"rank": 10, | |
"rawItem": apture.make("WikipediaArticle", { |
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
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
File "/home/jason/src/apture/main/util/wikipedia.py", line 3, in <module> | |
from apture.main.apis import all as apis | |
File "/home/jason/src/apture/main/apis/all.py", line 33, in <module> | |
import previousposts | |
ImportError: No module named previousposts |
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
class WikipediaArticle(wiki.MediaWikiArticle): | |
sectionType = WikipediaSection | |
classNameProp = 'sub' | |
lang = 'en' | |
refSectionHeader = "References" | |
extLinkSectionHeader = "External link" | |
title = item.StoredField(setHook=wiki.encodeUTF8, key=True) | |
# XXX: This is a performance hit! |
NewerOlder