Skip to content

Instantly share code, notes, and snippets.

[jonathan.stoppani@eifrwse00397 opsys2_lab3_stoppani]$ make
gcc -o consumer consumer.o buffer.o common.o monitor.o shared.o condition.o
buffer.o: In function `buffer_destroy':
/home/i2_0910/jonathan.stoppani/opsys2_lab3_stoppani/buffer.c:79: undefined reference to `shm_unlink'
monitor.o: In function `monitor_create':
/home/i2_0910/jonathan.stoppani/opsys2_lab3_stoppani/monitor.c:29: undefined reference to `sem_open'
/home/i2_0910/jonathan.stoppani/opsys2_lab3_stoppani/monitor.c:36: undefined reference to `sem_open'
monitor.o: In function `monitor_close':
/home/i2_0910/jonathan.stoppani/opsys2_lab3_stoppani/monitor.c:47: undefined reference to `sem_close'
/home/i2_0910/jonathan.stoppani/opsys2_lab3_stoppani/monitor.c:52: undefined reference to `sem_close'
# ...
# Add dummy packages to allow the documentation builds to pass on systems
# not providing all requirements.
class dummy(object):
def __init__(self, *dummy):
self.dummy = set(dummy)
sys.meta_path.append(self)
Thread 5 (Thread 0xb6772b70 (LWP 11775)):
#0 0x007b2422 in __kernel_vsyscall ()
#1 0x00472342 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0
#2 0x003a9a34 in pthread_cond_timedwait () from /lib/tls/i686/cmov/libc.so.6
#3 0x009a4e23 in ?? () from /usr/lib/openoffice/program/../basis-link/ure-link/lib/libuno_sal.so.3
#4 0x0046d96e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#5 0x0039ca4e in clone () from /lib/tls/i686/cmov/libc.so.6
Thread 4 (Thread 0xb50cdb70 (LWP 11776)):
@GaretJax
GaretJax / backtrace from command line
Created February 10, 2011 23:07
strace output when spawning from the command line
Thread 5 (Thread 0xb6772b70 (LWP 11775)):
#0 0x007b2422 in __kernel_vsyscall ()
#1 0x00472342 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0
#2 0x003a9a34 in pthread_cond_timedwait () from /lib/tls/i686/cmov/libc.so.6
#3 0x009a4e23 in ?? () from /usr/lib/openoffice/program/../basis-link/ure-link/lib/libuno_sal.so.3
#4 0x0046d96e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#5 0x0039ca4e in clone () from /lib/tls/i686/cmov/libc.so.6
Thread 4 (Thread 0xb50cdb70 (LWP 11776)):
@GaretJax
GaretJax / fileredir.py
Created March 12, 2011 14:57
A simple context manager to redirect output written to given file object to another one or to discard the data entirely.
import os
class _FileRedirect(object):
"""
A simple context manager to redirect output written to given file object
to another one or to discard the data entirely.
It works at OS level to allow to redirect/discard output from libraries
written in C too. This means that only file-like objects working on real
file descriptors are supported (sys.stdout, sys.stderr or any file opened
class Graph(object):
def __init__(self):
self.nodes = {}
"""
self.nodes is a mapping between a node and a mapping of nodes that
can be reached with a set of possible source nodes:
self.nodes = {
'fromNodeA': {
'toNodeB': set(['ifComingFromC', 'ifComingFromD', ...]),
"""Beautiful Soup
Elixir and Tonic
"The Screen-Scraper's Friend"
http://www.crummy.com/software/BeautifulSoup/
Beautiful Soup parses a (possibly invalid) XML or HTML document into a
tree representation. It provides methods and Pythonic idioms that make
it easy to navigate, search, and modify the tree.
A well-formed XML/HTML document yields a well-formed data
"""Beautiful Soup
Elixir and Tonic
"The Screen-Scraper's Friend"
http://www.crummy.com/software/BeautifulSoup/
Beautiful Soup parses a (possibly invalid) XML or HTML document into a
tree representation. It provides methods and Pythonic idioms that make
it easy to navigate, search, and modify the tree.
A well-formed XML/HTML document yields a well-formed data
import inspect
def NameAwareClassType():
frameInfo = inspect.getouterframes(inspect.currentframe())[1]
codeContext = frameInfo[4][0]
className = codeContext.split(' ', 1)[1].split('(', 1)[0]
g = globals()
@GaretJax
GaretJax / gist:1093873
Created July 19, 2011 22:13
PostgreSQL installation log on FreeBSD 7.4
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by PostgreSQL configure 9.0.4, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ ./configure --with-libraries=/usr/local/lib --with-includes=/usr/local/include --enable-thread-safety --with-openssl --with-libxml --enable-nls --without-gssapi --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/ --build=i386-portbld-freebsd7.4
## --------- ##
## Platform. ##