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 --git a/djangoweb/settings.py b/djangoweb/settings.py | |
index f9cba67..fe0c8ac 100644 | |
--- a/djangoweb/settings.py | |
+++ b/djangoweb/settings.py | |
@@ -2,7 +2,7 @@ import os | |
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) | |
STATIC_PORT = 8000 | |
STOMP_PORT = 9999 | |
-INTERFACE = "localhost" | |
+INTERFACE = "0.0.0.0" |
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
Index: orbited/transports/base.py | |
=================================================================== | |
--- orbited/transports/base.py (revision 675) | |
+++ orbited/transports/base.py (working copy) | |
@@ -15,7 +15,7 @@ | |
self.packets = [] | |
self.request = request | |
self.opened() | |
-# self.request.notifiyFinish().addCallback(self.finished) | |
+ self.request.notifyFinish().addBoth(self.finished) |
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 smtplib | |
s = smtplib.SMTP("smtp.gmail.com") | |
s.ehlo() | |
s.starttls() | |
s.ehlo() | |
s.login("username", "password") | |
msg = "From: [email protected]\r\nTo: [email protected]\r\nSubject: Testing 1 2 3\r\n\r\n" | |
msg += "This is a test, only a test." | |
s.sendmail("[email protected]", "[email protected]", msg) |
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 --git a/codenode/frontend/notebook/models.py b/codenode/frontend/notebook/models.py | |
index 56a8ec3..2c55fff 100644 | |
--- a/codenode/frontend/notebook/models.py | |
+++ b/codenode/frontend/notebook/models.py | |
@@ -28,7 +28,7 @@ class Notebook(models.Model): | |
def save(self): | |
if not self.guid: | |
- self.guid = str(uuid.uuid4()).replace("-", "") | |
+ self.guid = unicode(uuid.uuid4()).replace("-", "") |
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
# 1) "gem install wirble" | |
# 2) create ~/.irbrc shown below | |
# 3) fire up 'irb'. see colors, use tab-complete. | |
require 'irb/completion' | |
require 'rubygems' | |
require 'wirble' | |
ARGV.concat [ "--readline", "--prompt-mode"] | |
Wirble.init |
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
#twisted_log_watcher.py from http://github.com/derfred/doord/tree | |
from twisted.internet.protocol import DatagramProtocol | |
from twisted.internet import reactor | |
from twisted.internet.defer import Deferred | |
from twisted.application import internet, service | |
from twisted.mail.smtp import ESMTPSenderFactory | |
from email.MIMEText import MIMEText | |
import re, StringIO, time, os |
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
sed -i "s/target/result/" some_file |
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
""" | |
'How to do basic authentication on twisted web', from here: | |
http://twistedmatrix.com/pipermail/twisted-python/2009-August/020236.html | |
Original Copyright (c) 2008 Twisted Matrix Laboratories. See LICENSE for details. | |
Which I modified to use Twisted's Application framework. | |
USAGE | |
----- | |
1) Make htpasswd file: |
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
adduser --gecos GECOS --disabled-password some_user |
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 | |
from whoosh import index | |
from whoosh import analysis | |
from whoosh.fields import Schema, STORED, ID, KEYWORD, TEXT | |
from whoosh.filedb.filestore import FileStorage | |
SEARCH_INDEX = "search_index" | |
SEARCH_SCHEMA = Schema( | |
guid=ID(stored=True), |