Skip to content

Instantly share code, notes, and snippets.

View lamnk's full-sized avatar

lamnk lamnk

View GitHub Profile
default/deps/libeio/eio_1.o: In function `eio__sync_file_range':
/home/lamnk/builds/node/build/../deps/libeio/eio.c:874: undefined reference to `sync_file_range'
/home/lamnk/builds/node/build/../deps/libeio/eio.c:874: undefined reference to `sync_file_range'
default/deps/libev/ev_1.o: In function `ev_signal_stop':
/home/lamnk/builds/node/build/../deps/libev/ev.c:2801: undefined reference to `signalfd'
default/deps/libev/ev_1.o: In function `evpipe_init':
/home/lamnk/builds/node/build/../deps/libev/ev.c:1197: undefined reference to `eventfd'
/home/lamnk/builds/node/build/../deps/libev/ev.c:1199: undefined reference to `eventfd'
default/deps/libev/ev_1.o: In function `ev_signal_start':
/home/lamnk/builds/node/build/../deps/libev/ev.c:2740: undefined reference to `signalfd'
# Should we better use sanitize library for this ?
require 'cgi'
def html2text html
text = html.
gsub(/( |\n|\s)+/im, ' ').squeeze(' ').strip.
gsub(/<([^\s]+)[^>]*(src|href)=\s*(.?)([^>\s]*)\3[^>]*>\4<\/\1>/i,
'\4')
links = []
@lamnk
lamnk / Nodejs failed to built with python3 on Archlinux
Created November 6, 2010 03:32
Nodejs failed to built with python3 on Archlinux
[51/72] libv8.a: deps/v8/SConstruct -> build/default/libv8.a
python "/home/lamnk/builds/node/tools/scons/scons.py" -j 1 -C "/home/lamnk/builds/node/build/default/" -Y "/home/lamnk/builds/node/deps/v8" visibility=default mode=release arch=x64 library=static snapshot=on
Traceback (most recent call last):
File "/home/lamnk/builds/node/tools/scons/scons.py", line 128, in <module>
temp.extend(map(lambda x: os.path.join(x,
AttributeError: 'map' object has no attribute 'extend'
Waf: Leaving directory `/home/lamnk/builds/node/build'
Build failed: -> task failed (err #1):
{task: libv8.a SConstruct -> libv8.a}
make: *** [all] Error 1
@lamnk
lamnk / gist:950904
Created May 1, 2011 21:40
Mplayer options for playing HD videos on weak computers
mplayer -fs -zoom -quiet -vo xv -lavdopts threads=2:fast:skiploopfilter=all -sws 0
This should help a little bit (IMO 5-10%)
@lamnk
lamnk / collectd.conf
Created May 16, 2011 20:45
collectd configuration file
Hostname "archimedes"
FQDNLookup false
BaseDir "/usr/local/Cellar/collectd/5.0.0/var/lib/collectd"
PIDFile "/usr/local/Cellar/collectd/5.0.0/var/run/collectd.pid"
PluginDir "/usr/local/Cellar/collectd/5.0.0/lib/collectd"
TypesDB "/usr/local/Cellar/collectd/5.0.0/share/collectd/types.db"
Interval 2
Timeout 2
ReadThreads 5
@lamnk
lamnk / studyfail.tex
Created July 15, 2011 13:59
Study = Fail
% Small break after pumping out words and equations as if my life depends on them.
% Actually it does.
%
% http://img.skitch.com/20110715-e6x7ecruf6pw693455621iy8i7.png
\documentclass{article}
\usepackage[normalem]{ulem}
\begin{document}
\renewcommand{\arraystretch}{1.5}
\renewcommand{\tabcolsep}{0.2cm}
@lamnk
lamnk / updatevim.rb
Last active September 27, 2015 21:28
Use Pathogen to update vim plugins
#!/usr/bin/env ruby
# runtime bundle/vim-pathogen/autoload/pathogen.vim
# Insert the above line to .vimrc for pathogen to work
# Pathongen is included in this script so that it will be auto-updated
# Sparkup need manual treatment
# git://github.com/kogakure/vim-sparkup.git
# https://bitbucket.org/ns9tks/vim-fuzzyfinder/
# https://bitbucket.org/ns9tks/vim-autocomplpop/
@lamnk
lamnk / pypy_symlink.sh
Created December 12, 2011 00:17
Some symlinks needed to run pypy on CentOS 5.7 x64
@lamnk
lamnk / rbx-head-gem
Created May 4, 2012 01:26
rbx-head error with gem
% gem
An exception occurred running /home/lamnk/.rvm/rubies/rbx-head/lib/bin/gem.rb
Missing or uninitialized constant: Psych::Parser (NameError)
Backtrace:
Module#const_missing at kernel/common/module.rb:468
Psych::Nodes::Stream.__class_init__ (Stream) at .rvm/rubies/rbx-head/lib/19
/psych/nodes/stream.rb:12
Psych::Nodes.__module_init__ (Nodes) at .rvm/rubies/rbx-head/lib/19/psych/nodes
/stream.rb:7
@lamnk
lamnk / csf
Created May 4, 2012 01:59
Csf on a Xen VPS - Centos
[root@apache3]/etc/csf# lsmod
Module Size Used by
[root@apache3]/etc/csf# modprobe ip_tables
FATAL: Could not load /lib/modules/2.6.18-274.7.1.el5.028stab095.1PAE/modules.dep: No such file or directory
[root@apache3]/etc/csf# csf -s
Flushing chain `INPUT'
Flushing chain `FORWARD'
Flushing chain `OUTPUT'