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
| Copyright (c) 1992-2011 The FreeBSD Project. | |
| Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 | |
| The Regents of the University of California. All rights reserved. | |
| FreeBSD is a registered trademark of The FreeBSD Foundation. | |
| FreeBSD 8.2-RELEASE #0: Fri Feb 18 02:24:46 UTC 2011 | |
| root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 | |
| Timecounter "i8254" frequency 1193182 Hz quality 0 | |
| CPU: Intel(R) Celeron(R) CPU 420 @ 1.60GHz (1596.01-MHz 686-class CPU) | |
| Origin = "GenuineIntel" Id = 0x10661 Family = 6 Model = 16 Stepping = 1 | |
| Features=0xafebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,TM,PBE> |
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
| autoload -Uz vcs_info | |
| autoload -U colors && colors | |
| my_prompt_setup() { | |
| zstyle ':vcs_info:*' enable git | |
| zstyle ':vcs_info:git:*' check-for-changes true | |
| precmd() { | |
| vcs_info | |
| } | |
| PROMPT="%{$fg[blue]%}(%{$reset_color%}%{$fg[red]%}%m%{$reset_color%}%{$fg[yellow]%}:%{$reset_color%}%{$fg[green]%}%1d%{$reset_color%}%{$fg[blue]%})%{$reset_color%}%# " | |
| RPROMPT='${vcs_info_msg_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
| express = require 'express' | |
| app = module.exports = express.createServer() | |
| app.configure -> | |
| app.set 'views', __dirname + '/views' | |
| app.set 'view engine', 'jade' | |
| app.use express.bodyParser() | |
| app.use express.methodOverride() | |
| app.use app.router |
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
| (if (file-exists-p | |
| (concat (getenv "TMPDIR") "emacs" | |
| (number-to-string | |
| (user-real-uid)) "/server")) | |
| nil (server-start)) |
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 struct | |
| from Crypto.Cipher import AES | |
| def pkcspad(s, block_size=AES.block_size): | |
| """PKCS#5/#7 padding - return string the right length for a block cipher. | |
| # the output of pkcspad is 8 bit so use an md5 digest here in the | |
| # doctests to check output. | |
| >>> from hashlib import md5 | |
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
| if request.method == "POST": | |
| email_form = SendAnEmail(request.POST, prefix='emailform') | |
| if email_form.is_valid(): | |
| connection = DjangoBrokerConnection() | |
| publisher = Publisher(connection=connection, | |
| exchange="sendemail", | |
| routing_key="sendemail_emails") | |
| publisher.send(email_form.cleaned_data.get('email_address')) | |
| publisher.close() | |
| connection.close() |
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 datetime | |
| from collections import deque | |
| from functools import wraps | |
| from django.core.cache import cache | |
| def timed_task(f): | |
| @wraps(f) | |
| def wrapper(*args, **kwargs): | |
| """Simple decorator to cache previous 10 execution times |
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
| def hello(**kwargs): | |
| print ','.join(kwargs) |
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
| Helps a bit with verifying things are being cached properly and retrieved from cache by requests. | |
| sub vcl_deliver { | |
| if (obj.hits > 0) { | |
| set resp.http.X-Cache = "HIT"; | |
| set resp.http.X-Cache-Hits = obj.hits; | |
| } else { | |
| set resp.http.X-Cache = "MISS"; | |
| } |
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
| Jan 16 12:05:06 beardy upsmon[16391]: UPS smartups@localhost on battery | |
| Jan 16 12:05:56 beardy upsmon[16391]: UPS smartups@localhost on line power | |
| Jan 16 14:02:27 beardy upsmon[8713]: UPS SmartUPS@localhost on battery | |
| Jan 16 14:02:52 beardy upsmon[8713]: UPS SmartUPS@localhost on line power | |
| Jan 16 14:18:49 beardy upsmon[8713]: UPS SmartUPS@localhost on battery | |
| Jan 16 14:18:54 beardy upsmon[8713]: UPS SmartUPS@localhost on line power | |
| Jan 16 14:21:14 beardy upsmon[8713]: UPS SmartUPS@localhost on battery | |
| Jan 16 14:21:24 beardy upsmon[8713]: UPS SmartUPS@localhost on line power | |
| Jan 16 14:55:53 beardy upsmon[8713]: UPS SmartUPS@localhost on battery | |
| Jan 16 14:55:58 beardy upsmon[8713]: UPS SmartUPS@localhost on line power |