This file contains hidden or 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 d5075664c8ed6ca24a4f020484d60b2e22040d11 Mon Sep 17 00:00:00 2001 | |
From: =?UTF-8?q?Chris=20=E2=80=9CKwpolska=E2=80=9D=20Warrick?= | |
<[email protected]> | |
Date: Thu, 23 Jan 2014 19:07:26 +0100 | |
Subject: [PATCH] Add an install_bs3 command for Debian. | |
MIME-Version: 1.0 | |
Content-Type: text/plain; charset=UTF-8 | |
Content-Transfer-Encoding: 8bit | |
Signed-off-by: Chris “Kwpolska” Warrick <[email protected]> |
This file contains hidden or 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 codecs | |
xmlfile = 'xml.xml' | |
with codecs.open('ancient', 'w', 'iso-8859-2') as finalxml: | |
with codecs.open(xmlfile, 'r', 'utf-8') as f: | |
for line in f: | |
result = robj.sub(lambda m: dict[m.group(0)], line) | |
result = '\t\t\t' + result | |
finalxml.write(result.encode('iso-8859-2')) |
This file contains hidden or 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
try: | |
with open('filename') as fh: | |
contents = fh.read() | |
except IOError as e: | |
print('stuff went wrong') | |
print(e) |
This file contains hidden or 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 53ee55296e2e23016f9229644bc8dd6a3c2eac92 Mon Sep 17 00:00:00 2001 | |
From: =?UTF-8?q?Chris=20=E2=80=9CKwpolska=E2=80=9D=20Warrick?= | |
<[email protected]> | |
Date: Thu, 23 Jan 2014 19:07:26 +0100 | |
Subject: [PATCH] Add an install_bs3 command for Debian. | |
MIME-Version: 1.0 | |
Content-Type: text/plain; charset=UTF-8 | |
Content-Transfer-Encoding: 8bit | |
Signed-off-by: Chris “Kwpolska” Warrick <[email protected]> |
This file contains hidden or 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
[uwsgi] | |
emperor = true | |
socket = 127.0.0.1:3031 | |
stats = 127.0.0.1:3130 | |
chdir = /var/flask/ | |
master = true | |
threads = 5 | |
binary-path = /var/flask/bin/uwsgi | |
virtualenv = /var/flask | |
module = %n |
This file contains hidden or 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
server { | |
listen 80; | |
server_name kwpolska.dyndns.org; | |
root /var/flask/kwlh; | |
location / { try_files $uri @kwlh; } | |
location @kwlh { | |
include uwsgi_params; | |
uwsgi_pass 127.0.0.1:3031; | |
} |
This file contains hidden or 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
diff -ur /home/kwpolska/git/nikola/tests/data/baseline/galleries/demo/rss.xml output/galleries/demo/rss.xml | |
--- /home/kwpolska/git/nikola/tests/data/baseline/galleries/demo/rss.xml 2014-03-11 17:11:11.768384495 +0100 | |
+++ output/galleries/demo/rss.xml 2014-03-11 17:13:17.564280131 +0100 | |
@@ -1,2 +1,2 @@ | |
<?xml version="1.0" encoding="utf-8"?> | |
-<rss version="2.0"><channel><title>Nikola Tesla</title><link>http://getnikola.com/galleries/demo/rss.xml</link><description></description><language>en</language><lastBuildDate>Wed, 01 Jan 2014 00:00:00 GMT</lastBuildDate><generator>http://getnikola.com/</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Tesla conducts lg</title><link>http://getnikola.com/galleries/demo/tesla_conducts_lg.jpg</link><enclosure url="http://getnikola.com/galleries/demo/tesla_conducts_lg.jpg" length="18755" type="image/jpeg"></enclosure><guid isPermaLink="false">galleries/demo/tesla_conducts_lg.jpg</guid><pubDate>Fri, 03 Jan 2014 16:19:12 GMT</pubDate></item> |
This file contains hidden or 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 os | |
import sys | |
import time | |
pid = os.fork() | |
if pid == 0: | |
print('This is the child.') | |
time.sleep(1) | |
print('Time to die!') |
This file contains hidden or 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
(nikola-py2)[kwpolska@kw-cassandra n]% pip install git+https://github.com/FedericoCeratto/shoebill.git /tmp/n 1 | |
Downloading/unpacking git+https://github.com/FedericoCeratto/shoebill.git | |
Cloning https://github.com/FedericoCeratto/shoebill.git to /tmp/pip-FAvqVQ-build | |
Running setup.py egg_info for package from git+https://github.com/FedericoCeratto/shoebill.git | |
Downloading/unpacking Beaker>=1.6.3 (from shoebill==0.1) | |
Downloading Beaker-1.6.4.tar.gz (54kB): 54kB downloaded | |
Running setup.py egg_info for package Beaker | |
Requirement already satisfied (use --upgrade to upgrade): Bottle>=0.10.11 in /home/kwpolska/virtualenvs/nikola-py2/lib/python2.7/site-packages (from shoebill==0.1) |
This file contains hidden or 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
[kwpolska@kw-cassandra /tmp]% virtualenv3 new-env /tmp 0 | |
Using base prefix '/usr' | |
New python executable in new-env/bin/python3 | |
Also creating executable in new-env/bin/python | |
Installing setuptools, pip...done. | |
[kwpolska@kw-cassandra /tmp]% cd new-env /tmp 0 | |
[kwpolska@kw-cassandra new-env]% source bin/activate /tmp/new-env 0 | |
(new-env)[kwpolska@kw-cassandra ~VIRTUAL_ENV]% python --version |