Debconf issue

If you have this: debconf: DbDriver "config": mkdir :No such file or directory You might just have deleted /var/cache/debconf. Solving this is easy: mkdir -f /var/cache/debconf apt-get -f install

May 18, 2013 · Florent Clairambault

Valgrind might be wrong

Sometimes valgrind can report the right problem with the wrong stack trace: make && sudo valgrind --db-attach=yes --leak-check=full --track-origins=yes --show-reachable=yes ./dist/Debug/cbadaemon ==4423== Memcheck, a memory error detector ==4423== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al. ==4423== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info ==4423== Command: ./dist/Debug/cbadaemon ==4423== ==4423== Conditional jump or move depends on uninitialised value(s) ==4423== at 0x4922C47: __pthread_mutex_unlock_usercnt (pthread_mutex_unlock.c:38) ==4423== by 0x804E91A: ServerContext::ServerContext() (ServerContext.cpp:11) ==4423== by 0x804EB92: ServerCore::ServerCore(int, char**) (ServerCore.cpp:15) ==4423== by 0x804F627: main (main.cpp:57) ==4423== Uninitialised value was created by a heap allocation ==4423== at 0x48D273C: operator new(unsigned int) (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so) ==4423== by 0x804F60F: main (main.cpp:57) ==4423== ==4423== ==4423== ---- Attach to debugger ? --- [Return/N/n/Y/y/C/c] ---- y (gdb) bt #0 0x04922c47 in __pthread_mutex_unlock_usercnt (mutex=0x75e80d8, decr=1) at pthread_mutex_unlock.c:38 #1 0x0805d15b in RequestManager::RequestManager (this=0x75e8030) at src/transac/RequestManager.cpp:27 #2 0x0804e91b in ServerContext::ServerContext (this=0x75e802c) at src/server/ServerContext.cpp:11 #3 0x0804eb93 in ServerCore::ServerCore (this=0x75e8028, argc=1, argv=0xfef79b94) at src/server/ServerCore.cpp:15 #4 0x0804f628 in main (argc=1, argv=0xfef79b94) at src/main.cpp:57 (gdb) q And it’s not an optimization problem as it was compiled with: ...

April 24, 2013 · Florent Clairambault

SFR fibre

Latencies are really good :) --- www.google.fr ping statistics --- 10 packets transmitted, 10 received, 0% packet loss, time 9013ms rtt min/avg/max/mdev = 2.185/2.799/3.635/0.456 ms But I received an hadopi later. And still wish I knew why (there could be so many reasons).

March 10, 2013 · Florent Clairambault

Plex

Plex is great piece of software. It’s a “complete media solution”. I installed it on my laptop (free) without editing a single file, I tested it on my iPad (it’s a paid app) and it was just working instantly. Then I also tested it on my Nexus 7 (paid app on play store as well) and it’s also working perfectly. Then I discovered it can also do streaming through it’s web based interface, so it can stream to anything it doesn’t yet support. We could stop here but no: It can be installed on Debian stable hosts as well (which I love because they are easy to maintain [no daily updates and still pretty updated]). ...

February 25, 2013 · Florent Clairambault

Some good reasons for learning python

President Obama thinks required programming language learning in high school is a great idea. So do I, and I think we should all start with python. Writing code with it is very fast. When software engineers tell you “I can do it in 10 minutes”, in C/C++ they mean 4h, in java they mean 2h and in python they mean it. You can really do anything. I’ve done some serial communication, bit level manipulation, network level event-based servers, multithreading, webservice providing and consuming, SQL and cassandra client faster than what I’ve been doing in any other language. It’s easy to learn. You can start your first program right now and be good at it in 2 weeks. It comes “batteries included”. You don’t have to install third-party libraries. Contrary to ruby, you don’t have to choose between the thousands of gems available, there’s almost always one official way to do things. Which leads to the next point: It’s simple to read someone else’s code. This is because it’s high level language and you quickly know all the librairies. It now has some IDEs. I know some people like to code in vi, but this is ugly and unproductive. Pydev is simple to install and supports a pretty good (or not so bad) auto-completion. This leads me to two opposing ideas (but you’ll understand where I stand): ...

February 21, 2013 · Florent Clairambault

Linux: restart when hung

When a Linux system crashes (usually because of a driver issue), you should make sure at least it restarts. These are the lines you should add to /etc/sysctl.conf: # Reboot time(s) after panic kernel.panic = 20 # Panic if a hung task was found kernel.hung_task_panic = 1 # Setup timeout for hung tasks to 30 seconds kernel.hung_task_timeout_secs = 30

November 26, 2012 · Florent Clairambault

Opensourcing the content of this blog

Hi everyone, During the last years, I launched the javacint google group which now has grown out to be a good community of professionnals working around the Cinterion (java enabled) chips. I also created a TC65 development document. And all the questions and feedbacks you gave me on the development around these chips helped me a lot to improve (what was) my document and (what was) my FAQ. You helped me so much indeed that I believe this content should know be open to everyone to modify. That’s why I created the javacint wiki. ...

August 6, 2012 · Florent Clairambault

xrdp and the ulimits / nofile issue

You might have noticed for xrdp on Debian (but quite possibly with a lot of other Linux tools and other Linux distributions) the user limits (described in /etc/security/limits.conf) are not enforced. Which meant in my case that any session open with xrdp was opened with a max number of open files (nofile) set to 1024. To fix this, edit the file /etc/pam.d/common-session and add the following line: session required pam_limits.so

June 11, 2012 · Florent Clairambault

Limiting number of connections per IP with ufw

This is a personal reminder post. The easiest attack one can perform on a web server is opening all the connections and do nothing with it. iptables fortunately has a “connlimit” module to avoid this. If you’re using ufw like me you will want to keep your good integration with it. In the `/etc/ufw/before.rules file, after these lines: # Don't delete these required lines, otherwise there will be errors *filter :ufw-before-input - [:] :ufw-before-output - [:] :ufw-before-forward - [:] :ufw-not-local - [:] # End of required lines You can add this to limit the number of concurrent connections: ...

June 2, 2012 · Florent Clairambault

Cassandra as registry

One of the biggest issue with distributed database is to find the right model to store your data. On a recent project, I decided to use a registry model. The registry idea The idea behind writing a registry is to have an easy way to both store and view data. For a given device that has a {UUID} id: I will access “/device/{UUID}/”. Any properties will be stored in “/device/{UUID}/properties/”. Deletion of the device will delete all the contents this device contains. Classical column-families to index data The problem comes with the data we need to index. We can store everything in a registry manner like having a path “/device/by-owner/{UUID}”:["{UUID1}","{UUID2}"]. But it’s just easier to use cassandra secondary indexes have each property of each entity written to the indexed columns of the column family. ...

June 1, 2012 · Florent Clairambault