User Documentation nfdump & NfSen 
This is the combined documentation of nfdump & NfSen. Both tools are distributed under the BSD license and can be downloaded at

nfdump http://sourceforge.net/projects/nfdump/
nfsen http://sourceforge.net/projects/nfsen/

This documentation describes nfdump tool v1.5 and NfSen v1.2.3.


python wrapper for the nfdump cli application

http://www.ohloh.net/p/pynfdump


[ add comment ] ( 10 views )   |  [ 0 trackbacks ]   |  permalink
python: decorator example 
>>> def decorator(funct):
... def wrapped(*args, **kwargs):
... if x == True:
... return funct(*args, **kwargs)
... return wrapped
...
>>> @decorator
... def ahoj():
... print "ahoj:"
...

>>> x = True
>>> ahoj()
ahoj:

>>> x = False
>>> ahoj()
>>>


[ add comment ] ( 10 views )   |  [ 0 trackbacks ]   |  permalink
django: mkrange - create a range() inside a template 
I've found a nice snippet of code which adds a range capability for Django templating engine. Link in related links below.


Accepts the same arguments as the 'range' builtin and creates
a list containing the result of 'range'.

Syntax:
{% mkrange [start,] stop[, step] as context_name %}

For example:
{% mkrange 5 10 2 as some_range %}
{% for i in some_range %}
{{ i }}: Something I want to repeat\n
{% endfor %}

Produces:
5: Something I want to repeat
7: Something I want to repeat
9: Something I want to repeat


[ add comment ] ( 10 views )   |  [ 0 trackbacks ]   |  permalink  |  related link
d3.js: data visualization 


[ add comment ] ( 10 views )   |  [ 0 trackbacks ]   |  permalink  |  related link
django: geospatial data 


[ add comment ] ( 10 views )   |  [ 0 trackbacks ]   |  permalink  |  related link
Django: custom ModelManager for filtering, overriding default objects  
class MyModelManager(models.Manager):
def get_query_set(self):
return super(MyModelManager, self).get_query_set().filter(published=True)

class MyModel(models.Model):
# fields
# ...

objects = MyModelManager()


[ add comment ] ( 10 views )   |  [ 0 trackbacks ]   |  permalink  |  related link
apache debugging: mod_log_forensic 
The check_forensic script, which can be found in the distribution's support directory, may be helpful in evaluating the forensic log output

Syntax: ForensicLog filename|pipe
Context: server config, virtual host

filename:
A filename, relative to the ServerRoot.
pipe:
The pipe character "|", followed by the path to a program to receive the log information on its standard input. The program name can be specified relative to the ServerRoot directive.


[ add comment ] ( 10 views )   |  [ 0 trackbacks ]   |  permalink
apache debugging: dumpio_module  
LoadModule dumpio_module modules/mod_dumpio.so


DumpIOOutput On
DumpIOINput On
DumpIoLogLevel debug



[ add comment ] ( 11 views )   |  [ 0 trackbacks ]   |  permalink
pzthon: decorators. crazy 
>>> def outer():
... x = 1
... def inner():
... print x
... return inner
...
>>> outer()
<function inner at 0x7f7bd7ac5938>
>>> dis.dis(outer())
4 0 LOAD_DEREF 0 (x)
3 PRINT_ITEM
4 PRINT_NEWLINE
5 LOAD_CONST 0 (None)
8 RETURN_VALUE
>>> dis.dis(outer)
2 0 LOAD_CONST 1 (1)
3 STORE_DEREF 0 (x)

3 6 LOAD_CLOSURE 0 (x)
9 BUILD_TUPLE 1
12 LOAD_CONST 2 (<code object inner at 0x7f7bd7ab5300, file "<stdin>", line 3>)
15 MAKE_CLOSURE 0
18 STORE_FAST 0 (inner)

5 21 LOAD_FAST 0 (inner)
24 RETURN_VALUE





[ add comment ] ( 9 views )   |  [ 0 trackbacks ]   |  permalink  |  related link
git: get/download repository 
git clone git@github.com:USER/REPO.git


[ add comment ] ( 9 views )   |  [ 0 trackbacks ]   |  permalink

<<First <Back | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | Next> Last>>