This file contains 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
io root local/etc/openldap 1 # grep '^root' slapd.conf | |
rootdn "cn=proger,dc=wilab,dc=org,dc=ua" | |
rootpw secret | |
io root local/etc/openldap 0 # /opt/local/bin/ldapadd -f schema/nis.ldif -x -D cn=proger,dc=wilab,dc=org,dc=ua -w secret | |
adding new entry "cn=nis,cn=schema,cn=config" | |
ldap_add: Insufficient access (50) |
This file contains 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
io root local/etc/openldap 0 # /opt/local/libexec/slapd -4d 9 -f ./slapd.conf | |
@(#) $OpenLDAP: slapd 2.4.21 (Apr 22 2010 23:59:52) $ | |
[email protected]:/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_databases_openldap/work/openldap-2.4.21/servers/slapd | |
daemon_init: listen on ldap:/// | |
daemon_init: 1 listeners to open... | |
ldap_url_parse_ext(ldap:///) | |
daemon: listener initialized ldap:/// | |
daemon_init: 1 listeners opened | |
ldap_create | |
slapd init: initiated server. |
This file contains 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
hw.machine=i386 | |
hw.model=Intel(R) Core(TM)2 CPU T5600 @ 1.83GHz ("GenuineIntel" 686-class) | |
hw.ncpu=2 | |
hw.byteorder=1234 | |
hw.pagesize=4096 | |
hw.disknames=sd0,sd1 | |
hw.diskcount=2 | |
hw.sensors.acpitz0.temp0=70.00 degC (zone temperature) | |
hw.sensors.acpitz1.temp0=78.00 degC (zone temperature) | |
hw.sensors.acpibat0.volt0=14.40 VDC (voltage) |
This file contains 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
error: call of overloaded 'TraverseStmtChildren(Function*&, clang::Stmt*&)' is ambiguous | |
note: candidates are: void TraverseStmtChildren(Function*, clang::Stmt*) | |
note: void current_namespace::TraverseStmtChildren(Function*, clang::Stmt*) |
This file contains 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
#include <signal.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#define NSAMPLES 64 | |
struct sample { | |
u_int64_t pre; | |
u_int64_t post; | |
u_int64_t cycles; |
This file contains 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
In [32]: k = [Q(**{'%s__icontains' % f: ' '}) for f in [f.name for f in MyModel._meta.fields if f.__class__ is db.models.TextField]] | |
In [33]: reduce(lambda all, q: all|q, k, Q()) | |
Out[33]: <db.models.query_utils.Q object at 0x162fe0630> | |
In [34]: MyModel.objects.filter(_) | |
[.....] |
This file contains 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
-- generate an infinite sequence of sign alternating numbers | |
-- how to make it really infinite so foldl doesn't take away the laziness of the evaluation? | |
alternating count = foldl (\x (a,b) -> x ++ [a,b]) [] $ take count [(x,y) | x <- [1..], let y = negate x] | |
-- out: | |
[1,-1,2,-2,3,-3,4,-4,5,-5,6,-6,7,-7,8,-8,9,-9,10,-10] | |
-- variants: |
This file contains 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 inspect | |
class Y(object): | |
def ymethod(self, x): | |
x.method() | |
class X(object): | |
def method(self): | |
frame = inspect.currentframe() | |
prev = frame.f_back |
This file contains 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 sys | |
import random | |
import struct | |
import time | |
packet = lambda *args: struct.pack('!HQBBBB', 0xbaba, *args) | |
seq = 1 | |
while True: | |
p = packet(seq, *[random.randint(1, 255) for i in xrange(4)]) |
OlderNewer