Search Results: "francois"

22 January 2010

Dirk Eddelbuettel: Rcpp 0.7.3

A quick nine days after release 0.7.2 of Rcpp, our R / C++ interface classes, Romain and I are happy to roll out a new version 0.7.3. It has been uploaded to CRAN and Debian, and mirrors should have the new versions shortly. As before, my local page is also available for downloads and some more details. This release combines a number of under-the-hood fixes and enhancements with one bug fix: As always, full details are in the ChangeLog on the Rcpp page which also leads to the downloads, the browseable doxygen docs and zip files of doxygen output for the standard formats. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page

13 January 2010

Dirk Eddelbuettel: Rcpp 0.7.2

Not even two weeks after the Rcpp 0.7.1 release, Romain and I have a new one to present: Rcpp 0.7.2. It has been uploaded to CRAN and Debian, and the respective package management systems should carry them around in the next few hours. As always, the local page is also available for download too. A lot of the momentum for the new API is continuing, thanks in large part to Romain. A number of new classes have been added, and existing ones have been enhanced. There are more unit tests than ever, and more documentation. We have better build support (with g++ version detection so that we can add some C++0x support where available) and a new examples sub-directory. We did take one toy away, though. The Doxygen-generated docs were getting so big that we decided to keep them out of the source tarball. (And arguably, they are also too volatile.) We still have the browseable html docs as well as the pdf version (now at over 300 pages!). And we added zip archives of the docs in html, latex, and man format for download. As always, full details are in the ChangeLog on the Rcpp page. Questions, comments etc: bring them to the rcpp-devel mailing list off the R-Forge page

3 January 2010

Dirk Eddelbuettel: Rcpp 0.7.1

Two weeks after the Rcpp 0.7.0 release, Romain and I are happy to announce release 0.7.1 of Rcpp. It is currently in the incoming section of CRAN and has been accepted into Debian. Mirrors will catch up over the next few days, in the meantime the local page is available for download too. A lot has changed under the hood since 0.7.0, and this is the first release that really reflects many of Romain's additions. Some of the changes are As before, fuller details are in the ChangeLog on the Rcpp page.

27 December 2009

Francois Marier: Ignoring files in git repositories

According to the man page, there are three ways to exclude files from being tracked by git.

Shared list of files to ignore The most well-known way of preventing files from being part of a git branch is to add such files in .gitignore. (This is analogous to CVS' .cvsignore files.)

Here's an example:
*.generated.html
/config.php
The above ignore list will prevent automatically generated HTML files from being committed by mistake to the repository. Because this is useful to all developers on the project, .gitignore is a good place for this.

The next line prevents the local configuration file from being tracked by git, something else that all developers will want to have.

One thing to note here is the use of a leading slash character with config.php. This is to specifically match the config file in the same directory as the .gitignore file (in this case, the root directory of the repository) but no other. Without this slash, the following files would also be ignored by git:
/app/config.php
/plugins/address/config.php
/module/config.php

Local list (specific to one project)For those custom files that you don't want version controlled but that others probably don't have or don't want to automatically ignore, git provides a second facility: .git/info/exclude

It works the same way as .gitignore but be aware that this list is only stored locally and only applies to the repository in which it lives.

(I can't think of a good example for when you'd want to use this one because I don't really use it. Feel free to leave a comment if you do use it though, I'm curious to know what others do with it.)

Local list (common to all projects)Should you wish to automatically ignore file patterns in all of your projects, you will need to use the third gitignore method: core.excludesfile

Put this line in your ~/.gitconfig:
[core]
excludesfile = /home/username/.gitexcludes
(you need to put the absolute path to your home directory, ~/ will not work here unless you use git 1.6.6 or later)

and then put the patterns to ignore in ~/.gitexcludes. For example, this will ignore the automatic backups made by emacs when you save a file:
*~
This is the ideal place to put anything that is generated by your development tools and that doesn't need to appear in your project repositories.

20 December 2009

Romain Francoise: Defining evil

How exactly are these packages DFSG-free? (via, via)

Francois Marier: Debugging logcheck rule files

logcheck is a neat little log file monitoring tool I use on all of my machines.

I recently noticed however that I hadn't received any logcheck messages in a while from one of my servers. Either that was a sign that things were going really well or, more likely, that logcheck wasn't producing any output anymore.

Manually logging an error to syslogHere's what I did to force a message to be printed to the logs:
logger -p kern.error This is a test
Which I would expect to produce this logcheck notice:
Dec 20 15:34:08 hostname username: This is a test
Unfortunately, that didn't happen on the next scheduled run.

Forcing a logcheck runTo rule out the following:
I ran logcheck manually:
sudo -u logcheck /usr/sbin/logcheck -o -d >& logcheck.out
Looking at the output file however, my test message still wasn't there. Either logcheck was broken or one of my rule files was swallowing everything.

Finding the broken rule fileTo find the broken rule, I started by ignoring rules defined in /etc/logcheck/ignore.d.server/ and /etc/logcheck/ignore.d.workstation/ by running logcheck in paranoid mode:
logger -p kern.error This is a test
sudo -u logcheck /usr/sbin/logcheck -o -d -p >& logcheck.out
This worked, so I then ran logcheck in server mode:
logger -p kern.error This is a test
sudo -u logcheck /usr/sbin/logcheck -o -d -s >& logcheck.out
Given that this also worked, it meant that the offending rule file was in /etc/logcheck/ignore.d.workstation/. So I moved all of my custom local-* rule files out of the way and ran logcheck in workstation mode:
logger -p kern.error This is a test
sudo -u logcheck /usr/sbin/logcheck -o -d -w >& logcheck.out
Once I verified that this worked, I started to put my local files back one by one until it broke again. Then slowly removed lines from the offending file until it worked.

Solution to my problemIt turns out that one of my rule files had a line like this:
path != NULL   column != NULL
Escaping the pipe symbols with backslashes solved the problem:
path != NULL \ \  column != NULL

Maybe I should periodically print a message to syslog to make sure that logcheck is still working...

22 November 2009

Julien Valroff: Converted my packages to 3.0 (quilt) source format

I have now finished converted most of the packages I maintain (part of the official archive or not) to the new 3.0 (quilt) source format. I first had to switch from dpatch or cdbs simple-patchsys to quilt, which was easy thanks to Romain Francoise s old blog post. Also note this quick adaptation for cdbs:
for i in $(ls debian/patches/*.patch); do \
    I=$(basename $i   sed 's/.patch$//'); \
    quilt import -P $I.diff $i; \
done
The rest was much easier than what I thought, thanks to the related page on the wiki. I have already tried uploading a package to my personal repository, and reprepro just worked as expected.

9 November 2009

Dirk Eddelbuettel: Rcpp 0.6.7

Version 0.6.7 of the Rcpp package---a set of C++ classes making it easier to glue C/C++ code to R---is now on CRAN and Debian. This is a fairly incremental release that contains just a few small changes that arose since the previous release in August. One change is that a new type RcppList was added which allows us to build R 'list' types in C++. In particular, this makes it possible to have data structures of different types and dimensions. We had not previously accomodated this as our data structures where more regularised (i.e. think matrices or vectors of various types). The need for this came out of the work with the recently started RProtoBuf package which interfaces the Google ProtoBuf library. The incredible Romain Fran ois has joined the project and added a number of nice tricks; this will need another blogpost sooner rather than later. In the meantime, check out the RProtoBuf pages at R-Forge. Another small change was the addition of a self-contained example of a function callback from C++ into R which wasn't all that well documented before; this was in response to a user request. Finally, I started RcppList as a first step in reorganising the code a little better and split the class header and body off into separate files. This required changes to the infrastrucure files Makevars, cleanup, ... and I promptly forgot the Makevars.win Windoze variant which will require a 0.6.8 release real soon.

7 November 2009

Romain Francoise: Zeya: your music, anywhere


The 0.3 release of Zeya is now available in unstable. If you haven't heard of it, Zeya is a web music player that brings your music to any <audio>-capable browser like Iceweasel/Firefox or Google Chrome, turning your collection into a personal online streaming service, using only Free Software (Zeya is licensed under the Affero GPLv3).

Phil has more details about this release, as you can see I contributed a few new features like a search function (100% client-side) and some performance improvements. It's been great fun hacking on Zeya in this cycle and there's plenty of interesting new stuff to add in the near future; feel free to join the team if you want to contribute!

3 October 2009

Francois Marier: Keeping track of what others are saying about your project

There are a few ways to easily keep track of what others are saying about your Free Software project. In a very popular project, you may already have enough feedback from its busy forum or mailing list, but in new and small projects, you often have to actively seek feedback/comments from end-users.

Here are a few ways to find out what people are saying online about your project.

RSS FeedsFirst of all, here are the RSS feeds I subscribe to for one of my projects (safe-rm):
Google AlertsI have also signed up for the following Google Alert:
Search terms:link:safe-rm.org.nz
Type:Comprehensive
Deliver to:Email
How often:as-it-happens
which emails me anytime someone links to my project's homepage in one of the resources indexed by Google.

Backtype AlertsFinally, these Backtype Alerts notify me anytime safe-rm features in a blog comment:

Anything else I should subscribe to or follow?

27 September 2009

Francois Marier: OpenStreetMap/OpenLayers and Privoxy

I have been meaning to switch to OpenStreetMap for a while now, but the fact that it didn't work with Privoxy was holding me back. I don't enjoy surfing the web without protection and Privoxy is one of the most convenient ways of enhancing one's browsing experience on Debian and Ubuntu.

So I decided to spend some time trying to figure out what was wrong. If you want to skip the details and just get the fix, scroll down to the bottom of this post for the solution.

Finding all affected URLsIn order to get a list of all of the URLs that Privoxy filters when one visits the front page of OpenStreetMap, I did the following:

Comparing the filesArmed with the list of all affected URLs, I downloaded them through Privoxy using wget into a privoxy/ directory:
$ http_proxy=localhost:8118 wget URL
Then I downloaded the same URLs without Privoxy into a noproxy/ directory:
$ http_proxy= wget URL
To find identical files, I ran md5sums in each directory:
md5sum *
After deleting all identical files, I was left with:
index.html
OpenLayers.js?1251388304
Which I diff'ed together:
colordiff -u noproxy/FILE privoxy/FILE
The first file, index.html did not have any relevant changes, but I noticed in the second one that a few of these
this.moveTo(this.position)
were replaced with
''.concat(this.position)
Searching for "concat" in /etc/privoxy/, I found that the "jumping-windows" filter was the culprit. After disabling it, all of the problems went away.

I have filed a bug upstream.

The SolutionHere's what you need to put in your /etc/privoxy/user.action:
 -filter jumping-windows 
.openstreetmap.org

22 September 2009

Francois Marier: grub on a bootable USB rescue stick

If you've got a cheap USB key lying around which is too small to be useful, follow these instructions to create a rescue "stick" in case your boot loader stops working.

(This is based on these instructions but simplified and updated for grub 2.)

Before you start, make sure you've got both the parted and the grub-pc packages installed.
Make the USB stick bootablePlug in your USB stick and replace the device name and capacity with the appropriate values. (You can find the total capacity of the stick by typing print inside parted.)
$ sudo parted /dev/sda
(parted) rm 1
(parted) mkpart primary 1MB 4009MB
(parted) mkfs 1 fat32
(parted) toggle 1 boot
(parted) quit
Install grubAgain, substitute sda with the correct device name.
mount /dev/sda /mnt

mkdir -p /mnt/boot/grub
cp /usr/lib/grub/i386-pc/* /mnt/boot/grub/
echo '(hd0) /dev/sda' > /mnt/boot/grub/device.map
sudo grub-install --root-directory=/mnt /dev/sda

umount /mnt
That's it, now all you have to do is reboot with the stick plugged in and test booting your box manually with it.

9 September 2009

Francois Marier: Twitter tracking clicks to external sites

Lately, while using the Twitter web interface with Javascript turned on, I've been redirected to a Privoxy error page whenever I click on an external link:
Request for blocked URL

Your request for http://twitter.com/link_click_count?url=http%3A%2F%2Fexample.com&linkType=web&tweetId=1234567890&userId=12345678&authenticity_token=f5920ebf56bfa111c54bb9f86814cafa76de00fa was blocked.

Block reason: Path matches generic block pattern.
Looking a little closer at the blocked URL, I noticed that for every external link you click, Twitter logs the destination URL, the originating tweet and your user ID.

So what can you do to opt out of this tracking?
Disable JavascriptThis is by far the easiest solution. You can simply install an extension like Noscript and use Twitter with Javascript turned off. That's what I do most of the time since the website is mostly usable without it.

A very fortunate side-effect of using Twitter without Javascript is that you can avoid a number of the worms which propagate through that service from time to time.
Use Privoxy to disable the link counterFor those times when I have to enable Javascript on the site, I use Privoxy, a great privacy-enhancing web proxy, to alter the Javascript code executed when clicking on external links. This effectively disables the extra tracking and takes me directly to the intended URL.

First of all, make sure you have this line in your /etc/privoxy/config:
filterfile user.filter
then, add this filter to /etc/privoxy/user.filter:
FILTER: twitter-link-count Disable the Twitter link tracker
s@twttr\.countClick=function@twttr.dsbldCountClick=function@Uig
and finally turn this filter on for the affected URLs (/etc/privoxy/user.action):
  +force-text-mode +filter twitter-link-count   
.twimg.com/.*/javascripts/twitter.js
Switch to IdenticaIf you want to avoid similar privacy problems in the future, you can also switch to an Open platform which respects your basic freedoms.

The main contestant in this space is Identica. It's a great alternative to Twitter and has a lot of interesting features (like groups and XMPP integration) which are not yet available on Twitter.

The StatusNet developers have kindly released their source code under the AGPL and their goal is to build the most open micro-blogging system out there.

So go over there now and claim your username!

7 June 2009

Francois Marier: Reinstalling grub on an unbootable Debian system

Fixing an unbootable computer after a failed grub installation can be a bit tricky. Here's what I ended up doing.

First of all, boot the machine up and get access to the root partition:
  1. Get a Debian installation CD for the same architecture (i.e. don't use an i386 CD if your root partition is amd64). The distro version doesn't matter too much: a lenny CD will boot squeeze/sid just fine.
  2. Boot the install CD and select Rescue mode under Advanced options.
  3. Answer the language, keyboard and network questions any way you want and provide the decryption passphrases for any of the encrypted partitions you need to mount.
  4. When prompted, request a shell on the root partition.
If you need to upgrade the version of the grub package (for example if this problem was caused by a bug which is now fixed):
  1. Make sure that the network interface is up (ifup eth0).
  2. Make sure that /etc/resolv.conf has at least one nameserver line, otherwise add one.
  3. Install the latest version using apt-get or dpkg.
Now that you have the right grub version, run the following (with the right device name for your machine):
grub-mkdevicemap
grub-install /dev/hda
update-grub
Finally, reboot and cross your fingers :)

30 May 2009

Francois Marier: Troubleshooting Postgres Performance Problems

There are great resources to help tune PostgresQL for performance, but say you've got a Postgres database which suddenly becomes very slow. How can you figure out what's going on?
General system stateA slow database server will typically be running out of:
So the first thing you should do is to get an overview of the system state using common UNIX tools such as:
If you notice that memory is exhausted, you could play with the following postgresql.conf settings:
shared_buffers
work_mem
effective_cache_size
If you see a lot of I/O, then try adjusting these settings:
checkpoint_segments
autovacuum_naptime
wal_buffers
Finding slow queries
On the database side, start by determining whether:
To do this, make sure that the following setting is turned on in your postgresql.conf:
stats_command_string = on
Then fire up psql dbname and look at the currently executing queries:
SELECT usename, current_query, query_start
FROM pg_stat_activity;
(You can also add the procid column to the query if you want to map a query to the process ID you see in top.)

If you can't get anything useful out of pg_stat_activity, you may want to enable slow query logging by adding this to your postgresql.conf:
log_min_duration_statement = 100
(All queries which take more than 100 ms to execute will be printed to the main Postgres log file.)
Examining a particular queryOnce you have identified a slow query, you can time it by running this command before executing the query manually:
\timing
To get an idea of where Postgres spends its time when executing that query, look at the query plan:
EXPLAIN your_query;
The numbers you see there are estimates. To run the query and get actual numbers, use this instead:
EXPLAIN ANALYZE your_query;
If you still can't figure out why a certain query takes so long, have a look at the ratio between live and dead rows in the relevant tables:
ANALYZE VERBOSE tablename;
Having too many dead rows is often a sign of insufficient vacuuming. You might want to turn autovacuum on if it isn't already, or to make it a bit more aggressive by tweaking these settings:
autovacuum_vacuum_scale_factor
autovacuum_analyze_scale_factor

Troubleshooting database performance is a bit of a black art, many thanks to Mark Kirkwood for sharing his Postgres wisdom with me.

If there's anything else you have successfully used to find the cause of your performance woes, please feel free to leave a comment.

21 May 2009

Romain Francoise: My contribution to dpkg 1.15

So, the first thing I do when I boot up my laptop is to dist-upgrade it, and I was getting a little tired of staring at the (Reading database ... message you get when dpkg is busy reading its file database (laptop disk + dm-crypt + cold cache = slow). To preserve my sanity, I contributed a minimal patch to add a progress report, which Guillem turned into a generic facility in libdpkg and is now in the new dpkg in unstable (1.15.1).

It doesn't make dpkg any faster, but at least now I know how slowly it's really going. :)

1 April 2009

Francois Marier: Safer synergy setup for laptop-desktop keyboard sharing

Synergy is a very useful piece of software for anybody wanting to share a mouse and keyboard between two networked computers.

Here is the setup I use to:
  • encrypt the key presses sent over the network from the synergy client to the server and
  • automatically restart the synergy client when it crashes.

First of all, I've got the following ~/.synergy.conf on both of my laptop and desktop machines:
section: screens
mylaptop:
mydesktop:
end
section: links
mylaptop:
right = mydesktop
mydesktop:
left = mylaptop
end
section: options
keystroke(alt+shift+space) = switchInDirection(left)
keystroke(alt+space) = switchInDirection(right)
end

With this, I am ready to start the server on my desktop machine:
synergys -a localhost
Now, in order to encrypt the synergy client/server traffic, I create an ssh tunnel between the two machines:
ssh -f -N -L localhost:24800:localhost:24800 mydesktop
Then I start the synergy client on my laptop. However, some recent problems have convinced me to have a more robust alternative to simply starting the client like this:
synergyc localhost
As recommended by a few helpful people on #debian-devel, I decided to use the supervise tool (part of the daemontools package) to automatically restart the synergy client if it crashes. Here is how I do it:
supervise ~/.synergyc &
This command refers to a ~/.synergyc directory containing a single run script. That shell script consists of:
#!/bin/sh
xset r rate 500 30
/usr/bin/synergyc --no-daemon localhost

(The xset call is necessary since synergyc crashes seem to reset the repeat flag of X for some reason...)

The only problem I still need to fix in my setup is the potential password leak in the next few seconds after the synergy client crashes. Such a crash has already caused me to accidentally type my laptop password into a desktop IRC window the other day :(

Ideally, I would like the synergy server to swallow the first second or two of keyboard input after its client suddenly drops out. This could eliminate quite a few embarrassing wrong windows.

25 March 2009

Francois Marier: Promoting your Free Software Project

After spending a considerable amount of time releasing your Free Software project to the public, you will probably want to make sure that it reaches as many of the people it could be useful to as possible. Here are a few tips to get you started.
Homepage: Is this software for me?The first thing you will probably think about is to create a homepage promoting your project. There are a lot of good tips on how to create an effective homepage, but I will focus here on the contents that you should include.

Screenshots are one of the most important elements you can include on your homepage. First-time visitors will only spend a few seconds on your site before deciding whether or not the information is relevant to them. You need to be able to summarize in a few pictures what your project is all about.

Would you be willing to read long white papers or to go through long build instructions just to find out that this software isn't going to be useful to you after all? Probably not. Make sure you can help users figure this out in a few seconds, even if your software lacks a graphical user interface.

Of course you will also want to describe the project in a few words and provide links to the source code and other services you may have available.
Hosting ChoicesWhere to put your contents is somewhat of a personal choice but there are a few things to keep in mind.

First of all, depending on the size of your project and its related data, the hosting site should may need a significant amount of storage and bandwidth. Furthermore, you should check whether download statistics are collected by your hosting provider. While not strictly necessary, it can be very motivating to watch these numbers go up!

Free Software hosting sites like Google Code, Source Forge and LaunchPad also provide different services like bug trackers and source control repositories.

Some people prefer a distributed approach to source control and issue tracking to avoid trusting their master copy of the data to a third party. Setting up a separate code repository on sites like Github or Gitorious is an option to consider.

All of these hosting providers promote the software they host to varying degrees. Have a look around before deciding where you should park your project.
Announcing your ReleaseFinally, what would a website be without other sites linking to it? The obvious place to start would be the main search engines, but that in itself is unlikely to bring much traffic in the early days of your project.

Sites dedicated to Free Software are more likely to bring visitors to your shiny new project. The most famous place for Free Software release news is Freshmeat. Whether or not you visit this site regularly, you should know that its contents is widely read and syndicated and you should not pass on this great opportunity to let people know about your software.

Other directories that may be of interest include the Free Software Foundation Directory and Ohloh (especially if you offer a publicly available source code repository).

Now that the word is getting out, it's time to start thinking about supporting these new users!

23 March 2009

Francois Marier: Using Wikia Search in Firefox and vimperator

Wikia search is a new project from Jimmy Wales, founder of Wikipedia. As discussed on the second autonomo.us podcast, his objective is to create a Free Network Service for Web search: an alternative search engine compatible with the Franklin Street Statement.

To add Wikia Search to your Firefox search bar:
If you use vimperator to reduce the amount of mousing involved in your daily web browsing, put this in your ~/.vimperatorrc to make Wikia your default search plugin:
:set defsearch=wikia
Please let me know if this stops working, I'll update the search extension.

10 March 2009

Francois Marier: Handling security bugs in your Free Software project

If you are managing a Free Software project, you may eventually be confronted with a security vulnerability. Normally bugs in the Open Source world are discussed in a transparent way on public forums. In the case of security bugs however, there are benefits to temporarily withholding these details from the public.

Some people describe this approach as responsible disclosure. It boils down to this:
if the vulnerability is not publicly known, warn the vendors first and give them some time to fix it before making the details public.
If the vulnerability is already public knowledge, then you can focus on fixing it as soon as possible and maybe let reporters know about a better way to report their findings.
Sample Security PolicyHere's the procedure we now follow in the Mahara project for security bugs we found ourselves or which have been privately disclosed to us through security@mahara.org:
  1. Figure out the extent of the problem: which versions of Mahara are affected by this problem?
  2. Fix the problem on all supported branches of the project in a private source control repository.
  3. Share the vulnerability information with vendor-sec and request a CVE identifier.
  4. Prepare release tarballs and packages.
  5. Draft a security advisory for the Security forum.
  6. Wait until the embargo date to push the release out.
Emails to vendor-sec should include:
  • a description of the problem
  • any proof of concept code demonstrating the vulnerability
  • the list of affected versions
  • any patches you have prepared
  • a proposed embargo date
Benefits of properly handling security bugs
First and foremost, it protects end-users by giving them a chance to download and install fixed versions of your software before widespread exploitation of the security flaws.

Secondly, it may increase your project credibility. While you are admitting that your software has flaws, you are also demonstrating that your project is committed to dealing with the most serious ones promptly and in a responsible manner.

Finally, sharing security flaws and having your fixes reviewed by a select group of experts may reveal extra vulnerabilities you missed while preparing your patches. This gives you an opportunity to improve your fixes before they are released and to avoid having to issue yet another security advisory a few days later.

Big thanks to Steffen Joeris for his help in shaping the Mahara policy!

Next.

Previous.