ST (Suckless Terminal) sounds cool, but when I decided to give it a try it turned out that when combined with tmux, it is noticeably slower. Switching windows in tmux, whish is instantaneous in urxvt, visibly lags in st.
The workaround I've found at the moment is changing the value of the `termname` variable in config.h from "st-256color" to "xterm-256color".
Pretending to be xterm seems to pay off. So much for getting rid of xterm legacy!
Saturday, September 27, 2014
Thursday, May 15, 2014
Building Box2D on Linux
I wanted to build Box2D v2.3.1 on my Ubuntu 14.04 machine. It took me a lot of tweaking to do it, so I thought I'd document the process here.
First I tried the instructions I found here but I got these error messages:
First I tried the instructions I found here but I got these error messages:
CMake Error at CMakeLists.txt:29 (add_subdirectory):
add_subdirectory given source "freeglut" which is not an existing
directory.
CMake Error at CMakeLists.txt:30 (add_subdirectory):
add_subdirectory given source "glui" which is not an existing directory.
-- Configuring incomplete, errors occurred!
I searched a bit and found out that cmake is no longer supported on Box2D I had to use premake. I ran "premake gmake" in Box2D directory, but I got:
No Premake script found!
Okay. This was easy to fix. I needed premake4, not the older version in Ubuntu's repositories. I installed the latest stable version of premake from premake website. This time, running "premake4 gmake" got me this:
/path/to/box2d-2.3.1/Box2D/premake4.lua:26: attempt to call global 'vpaths' (a nil value)
A bit more searching, and I found out I need the latest version of premake, that is the beta version. All right I got premake4.4 (beta) and this time it ran successfully. I switched to Build/gmake directory and ran "make".
At first things seemed to be going smoothly until I got lots of errors regarding undefined symbols belonging to glfw and glew. But I had the development packages for both of those installed. A lot of poking around and I managed to fix it at last. This is what I did.
- Compile and install the latest version of glfw (3.0.4) from source.
- Change this line in Build/gmake/Testbed.make:
LIBS += $(LDDEPS) -lX11 -lGL -lGLU -lglut
into this:
LIBS += $(LDDEPS) -lX11 -lGL -lGLU -lglut -lGLEW -lglfw3 -lX11 -lXxf86vm -lpthread -lXrandr -lXi
And now, at last everything compiled correctly.
Tuesday, May 6, 2014
Transparently proxifying certain machines in the network
I use an Ubuntu box as a wifi access point/router in my home network. I wanted to transparently proxify certain machines on the network (mainly my Kindle paperwhite --long story!). I finally managed to do it like this:
I'm using iptables version 1.4.21 on Ubuntu 14.04, and squid version 2.7.
sudo iptables -t nat -A PREROUTING -m mac --mac-source "MAC-ADDRESS" -p tcp --dport 80 -j REDIRECT --to-port 33128In which MAC-ADDRESS is the mac address of the machine I want to proxify. A squid instance is listening on 33128. I had to change this line in my squid configuration:
http_port 33128to this:
http_port 33128 transparentso that squid handles transparent proxy-ing correctly.
I'm using iptables version 1.4.21 on Ubuntu 14.04, and squid version 2.7.
Monday, April 7, 2014
"Really" enabling CGI in apache
This was driving me crazy. No matter what I did, apache just did not run CGI scripts. I did all the things people had said on various websites, like adding "AddHandler cgi-script .cgi" or adding "+ExecCGI" to options, but it did not work.
And finally, after hours of searching and trying, I got a hint from a very old apache documentation page that mentioned modules being enabled. I looked at my /etc/apache2, found two suspicious mods-available and mods-enabled sub-directories, confirmed that there was nothing called cgi in mods-enabled, symlinked anything with "cgi" in it from mods-available in mods-enabled, and at last, at long last, I got bugzilla working. Phew!
And finally, after hours of searching and trying, I got a hint from a very old apache documentation page that mentioned modules being enabled. I looked at my /etc/apache2, found two suspicious mods-available and mods-enabled sub-directories, confirmed that there was nothing called cgi in mods-enabled, symlinked anything with "cgi" in it from mods-available in mods-enabled, and at last, at long last, I got bugzilla working. Phew!
Sunday, March 16, 2014
Using clang++ with waf
As far as I can see, the only way to make waf use clang C++ compiler is to run it like this:
$ CXX=clang++ ./waf configure
This makes waf use clang++ instead of g++ which seems to be the official way of doing this as it is mentioned in the documents here, except that the current documentation says to run it like this:
$ CXX=clang ./waf configure
$ CXX=clang++ ./waf configure
This makes waf use clang++ instead of g++ which seems to be the official way of doing this as it is mentioned in the documents here, except that the current documentation says to run it like this:
$ CXX=clang ./waf configure
which did not work for me. Apparently this causes the wrong standard library to be used.
Monday, May 21, 2012
Compiling PF_RING Intel Drivers
I've been meaning to play around with PF_RING but never really managed to get its patched drivers compiled. I'm running Arch Linux which has a 3.3 kernel at the moment. A while ago Luca Deri himself mentioned in a bug report of mine that the drivers are only meant to be compiled on 2.6.x kernels. So today I installed a Debian Squeeze which has a 2.6.32 kernel in VirtualBox and tried compiling the Intel drivers in there. Again I got an error but this time it was a different error message. Something like this:
Unfortunately, the only PF_RING aware NIC I currently have access to is a Broadcom-based one. I haven't managed to compile those drivers yet.
error: ‘struct dev_pm_info’ has no member named ‘runtime_auto’
I found this thread that suggested making with
make CFLAGS_EXTRA=-DDISABLE_PM
. I tried the suggestion and it worked.Unfortunately, the only PF_RING aware NIC I currently have access to is a Broadcom-based one. I haven't managed to compile those drivers yet.
Wednesday, April 25, 2012
Compiling "vomit"
I just needed to compile vomit (the man page is here) which is utility for converting G.711 data into a wave file. I ran into several problems (I'm using gcc 4.7.0, with libevent 2.0.18-1 from Arch's core repository, and libnet 1.1.5-2 from the community repo). In file pcapu.c, in function pcap_cb there is this line:
Then there are several references to struct
And finally, in vomit.c, there are references to event_gotsig and event_sigcb symbols which have been removed from libevent for some time. Again, since their use didn't seem too crucial to me, I commented them out.
Perhaps a little bit crude, but it worked for me!
There are several ways to fix this, but I shamelessly commented it out!fprintf(stderr, __FUNCTION__": ! add\n");
Then there are several references to struct
libnet_ip_hdr
, which does not exist in recent libnet versions. I simply changed them all to struct libnet_ipv4_hdr
.And finally, in vomit.c, there are references to event_gotsig and event_sigcb symbols which have been removed from libevent for some time. Again, since their use didn't seem too crucial to me, I commented them out.
Perhaps a little bit crude, but it worked for me!
Subscribe to:
Posts (Atom)