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
#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
# 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
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
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
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
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
server { | |
listen 80; | |
server_name foo.bar.org; | |
access_log /var/log/nginx/pads/access.log; | |
location /static { | |
alias /var/www/pads; | |
} |
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 here: http://pastebin.com/GZ5UdEDZ | |
from twisted.web import server, resource | |
from twisted.application import service, internet | |
from twisted.internet import reactor | |
from twisted.internet.defer import Deferred | |
from twisted.python import log, logfile | |
from twisted.python.log import ILogObserver | |
import psyco | |
psyco.full() |
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
# use this: http://codysoyland.com/2009/sep/6/introduction-surlex/ for URL->Regex mapping | |
# interesting: http://github.com/simonw/djangode | |
import copy | |
from twisted.web.server import Site | |
from twisted.web.resource import Resource | |
from twisted.internet import reactor | |
class ViewResource(Resource): |