I've been trying to understand how to setup systems from
the ground up on Ubuntu. I just installed redis
onto
the box and here's how I did it and some things to look
out for.
To install:
worker_processes 2; | |
error_log /var/log/nginx/error.log; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
use epoll; | |
} |
>>> import base64 | |
>>> import hashlib | |
>>> base64.b64encode(hashlib.sha1("test").digest()) | |
'qUqP5cyxm6YcTAhz05Hph5gvu9M=' |
all: test libtest.so testmodule | |
libtest.so: libtest.c | |
$(CC) -Wall -g -fPIC -shared -o $@ $? -lc | |
test: test_main.c libtest.o | |
$(CC) -o $@ $? | |
testmodule: testmodule.c | |
python setup.py build |
from tornado import ioloop | |
from tornado import iostream | |
import socket | |
class Envelope(object): | |
def __init__(self, sender, rcpt, body, callback): | |
self.sender = sender | |
self.rcpt = rcpt[:] | |
self.body = body | |
self.callback = callback |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Upload your files</title> | |
</head> | |
<body> | |
<form enctype="multipart/form-data" action="upload.php" method="POST"> | |
<p>Upload your file</p> | |
<input type="file" name="uploaded_file"></input><br /> | |
<input type="submit" value="Upload"></input> |
To run this, you can try:
curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh
chmod +x ./uninstall-node.sh
./uninstall-node.sh
rm uninstall-node.sh
//http://superuser.com/questions/203707/how-to-uninstall-homebrew-osx-package-manager | |
Here's how they recommend doing it: | |
cd `brew --prefix` | |
rm -rf Cellar | |
brew prune | |
rm -rf Library .git .gitignore bin/brew README.md share/man/man1/brew | |
rm -rf ~/Library/Caches/Homebrew | |
This should also revert your /usr/local folder to its pre-Homebrew days. See the Homebrew installation wiki for more information. |
""" | |
This generic view displays a list of objects and a simple ModelForm to add a new | |
object to the list. | |
Just subclass this view and override the attributes and methods that you need. You | |
will probably need to override at least 'model', 'form_class' and 'success_url'. | |
See the documentation of the used mixins and ProcessFormView in | |
https://docs.djangoproject.com/en/1.4/ref/class-based-views/ | |
""" | |
from django.views.generic.list import MultipleObjectMixin, MultipleObjectTemplateResponseMixin | |
from django.views.generic.edit import ModelFormMixin, ProcessFormView |