Search Results: "ed"

30 December 2010

Jose Luis Rivas Contreras: snipmate.vim snippets

I m a long-time snipmate.vim user and I ve been adding occasionally some snippets to it, and today I want to share it to everyone who may be interested on using them. All of them are CSS3, Javascript and HTML5 related, plus 2 (or something) for PHP+WordPress. Anyway, if any of you use WordPress+PHP and use snippets please, let me know. I m working on WordPress these days and some snippets would help me a lot. You can download my snippets from my github, hope its useful for anyone.

Benjamin Drung: Debian Developer

Yesterday I became Debian Developer. I already used my new @debian.org mail address for uploading a vlc security fix to unstable and audacious & audacious-plugins 2.4.2-1 to experimental.

Jonathan McDowell: Why Linux? (Part 5: Flexibility)

(This is part of a series of posts on Why Linux?) I find Linux more flexible. Maybe that's the familiarity showing, maybe it's about the package management, but it's a powerful reason for me to use it. For example, a couple of years ago I wanted to try out some iSCSI stuff against a SAN. Of course I have test boxes available I can do this on, but this was just to try out a few bits and pieces rather than anything more concrete. So I installed open-iscsi on my desktop and was able to merrily do the tests I wanted with very little additional work. Or I wanted to try out some BitKeeper to git conversion work recently. I wasn't sure how much resource it would take on a build server, and didn't want to tie things up there. So I ran it on my desktop overnight, where I could easily setup the appropriate environment and wouldn't impact on anyone else's resources. Problems talking to dodgy hardware? Linux is much better about giving you some idea what's going on, without needing to install extra software. I had a workmate grappling with an old USB music player recently; hooking it up to her Windows laptop wasn't providing a lot of joy so I attached it to my Linux box and was able to see that it did identify ok, but was disconnecting randomly at times too. Want to script querying an AD server for the current employee list and displaying who's joined and who's left since the last time you did so? I found that easy enough with the common Linux LDAP tools. I'm sure it's doable under Windows too, but I'm not sure it would be quite so simple. For bonus points add graphviz into the mix for automatic organisation charts (modulo accuracy of the AD data). This flexibility is something that helps me do my job. Sure, as I mentioned above I do have access to test boxes that I can use for this, but being able to do it on my desktop can be useful - for example if I'm offline, or on a slow network connection, or just geographically distant from my test machines so network latency is higher than I'd like. (Also, it's something that makes a Linux box a really great test box. I'm lucky in that I have a mix of OSes available to me for testing, but the one that I use most often is the Debian box. Much easier to get and install decent diagnosis tools for it that can give me packet level dumps, or do really odd stuff that turns out to be really useful.)

Andrew Pollock: [debian] "A fine example of shit code in any language"

I just discovered that I'd been hit by #409864 since upgrading to Lenny. A very unfortunate bug that one. I'm surprised it hasn't been fixed in a point release.

Stefano Zacchiroli: how to contribute to Debian

... looking for an HOWTO? These days, possibly because it's holiday in several countries around the world, I'm receiving a higher number of "how can I help Debian?" mails than usual. This is good and makes me happy! Those mails show we have a community who cares about giving back to Free Software, in exchange of what they have received via Debian. Routinely, in my replies, I point people to the following list of documentation we have on how to contribute to Debian: Am I missing something? At the same time, it happens that I reply to people who clearly went through (at least some of) the above resources, but which are still blocked at the "what I do next?" step. I guess this is because some of the day to day practices of Debian life are not described in the documentation we have. For instance, I find scarce references to "cultural" aspects of Debian technical life such as: And I'm sure I'm missing quite some other cultural/folklore traits, which look obvious to longstanding members of the Debian community, but which are probably not so obvious to external people. So, dear lazyweb, have you started contributing to Debian and remember your experience? If so, I'd like to hear from you. In particular, I'd like to hear your suggestions on how we can improve our documentation on the matter (patches welcome, as usual!). Bonus point. Of the various pieces of documentation we have, it seems that a sufficiently detailed HOWTO-style document, covering both technical and cultural aspects, is missing. If you are into writing for Debian, that might be an experiment worth trying.

Bastian Venthur: Canon IXUS 130

Dear Lazyweb, Today I bought me a Canon IXUS 130 and was quite disappointed to see that it couldn t properly connect to my Debian/Sid machine via USB. Apparenty the camera is not recognized as a USB Mass Storage Device but utilizes PTP. I upgraded to libgphoto2 (2.4.10.1-3) from experimental and added a proper udev rule with vendor- and product-id but it did not help. Is there anything more I can try? Update: Accessing the camera actually works, even with ligbphoto2 (2.4.6) from unstable. I can access the camera with gphoto2 and download pictures (but not with KDE s filemanager). My problem was that I had rhythmbox running and the camera was automatically mounted by it as a media device. When KDE s filemanager or gphoto2 tried to access the camera I got an error like: ( Could not lock the device ): Camera is already in use., which is probably also a bug. Closing rhythmbox solved the issue and I was able to download images with gphoto2.

29 December 2010

Lars Wirzenius: Obnam 0.14 and btree 0.14

After several months of leisurely development (I've read through everything on the Internet several times, and notified everyone who was wrong), I have finally gotten obnam, my backup application, into a state where it successfully backs up my laptop's hard disk to a USB disk. I therefore declare it to be perfe... no, wait, I don't. It's slow. It's probably buggy in ways that will make you want to abandon computers forever. It's also slow. And buggy. Did I mention it is slow, making backups at only a few megabytes per second? Disclaimers aside, I am happy to have gotten obnam to this stage. It's not nearly ready, but it's getting along nicely. If you've been curious about obnam ever since I first mentioned it in 2007, now might be a good time to try it out. I would be very interested in hearing any feedback. Obnam is implemented using copy-on-write B-trees, and I've also released my B-tree implementation. See the NEWS file in each source tree for information for what's changed since the previous release. Links: I have made Debian packages of obnam, btree, and some of my other stuff that they need, for all, amd64, and i386 architectures. The repository is at http://code.liw.fi/debian/, so add this to your sources.list if you want to use that:
deb http://code.liw.fi/debian squeeze main
Note, however, that I do not guarantee that this repository will be in any useful state at any given time. I use it, and rely on it, and will fix things when they bother me, but that's all the guarantee I give. (Do you get the impression I've read too many contracts?) Once obnam is ready, and Debian squeeze is released, I'll upload it to Debian, and then you'll get it for any architecture Debian runs one. If anyone wants to help me maintain the packages for Debian, please e-mail me. If, on the other hand, you'd like to help make obnam faster, or better, the bug tracker has some pointers. Right now speed is perhaps the biggest problem. The B-tree library needs optimizing, as does obnam itself. And the LRU cache I use. The worst missing feature is encryption support. I do my backups to a local hard disk, which is full-disk encrypted, which is why I haven't cared about implementing encryption yet. Also, I need to design a good way to manage keys, etc. Help with that would be quite welcome.

Mike Hommey: Efficient way to get files off the page cache

There s this great feature in modern operating systems called the page cache. Simply put, it keeps in memory what normally is stored on disk and helps both read and write performance. While it s all nice for a day to day use, it often gets in the way when one wants to track performance issues with cold cache (when the files you need to access are not in the page cache yet). A commonly used command to flush the Linux page cache is the following:
# echo 3 > /proc/sys/vm/drop_caches
Unfortunately, its effect is broad, and it flushes the whole page cache. When working on cold startup performance of an application like Firefox, what you really want is to have your page cache in a state close to what it was before you started the application. One way to get in a better position than flushing the entire page cache is to reboot: the page cache will be filled with system and desktop environment libraries during the boot process, making the application startup closer to what you want. But it takes time. A whole lot of it. In one of my what if moments, I wondered what happens to the page cache when using posix_fadvise with the POSIX_FADV_DONTNEED hint. Guess what? It actually reliably flushes the page cache for the given range in the given file. At least it does so with Debian Squeeze s Linux kernel. Provided you have a list of files your application loads that aren t already in the page cache, you can flush these files and only these from the page cache. The following source code compiles to a tool to which you give a list of files as arguments, and that flushes these files:
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
int main(int argc, char *argv[])  
  int i, fd;
  for (i = 1; i < argc; i++)  
    if ((fd = open(argv[i], O_RDONLY)) != -1)  
      struct stat st;
      fstat(fd, &st);
      posix_fadvise(fd, 0, st.st_size, POSIX_FADV_DONTNEED);
      close(fd);
     
   
  return 0;
 
It s actually a pretty scary feature, especially on multi-user environments, because any user can flush any file she can open, repeatedly, possibly hitting system performance. By the way, on systems using lxc (and maybe other containers, I don t know), running the echo 3 > /proc/sys/vm/drop_caches command from a root shell in a container does flush the host page cache, which could be dangerous for VPS hosting services using these solutions. Update: I have to revise my judgment, it appears posix_fadvise(,,,POSIX_FADV_DONTNEED) doesn t flush (parts of) files that are still in use by other processes, which still makes it very useful for my usecase, but also makes it less dangerous than I thought. The drop_cache problem is still real with lxc, though.

Jon Dowland: announcing RDiffFS

It gives me pleasure to announce RDiffFS, a virtual filesystem for browsing backups created by the rdiff-backup tool. Assuming that "/backup" is the location of a series of backups created using rdiff-backup, here is a usage example:
$ rdifffs /backup/dest/ /mnt
$ ls -l /mnt
total 5
drwxr-xr-x 4 jon jon 4096 Feb  7  2010 2010-09-04T16:38:10+01:00
drwxr-xr-x 4 jon jon 4096 Feb  7  2010 2010-12-29T10:51:50Z
drwxr-xr-x 4 jon jon 4096 Feb  7  2010 2010-12-29T10:52:30Z
lr-xr-xr-x 2 jon jon   11 Jan  1  1970 current -> 2010-12-29T10:52:30Z
$ for i in /mnt/*/a; do c=$(cat "$i"); printf "%32s:\t%s\n" "$i" "$c"; done
/mnt/2010-09-04T16:38:10+01:00/a:   foo
     /mnt/2010-12-29T10:51:50Z/a:   bar
     /mnt/2010-12-29T10:52:30Z/a:   baz
                  /mnt/current/a:   baz
I will write more about the creation of rdifffs at a later date: in particular my choice of implementation language, but I don't want to clutter up this announcement with all that. Suffice to say, I started writing a "quick tool" nearly a year ago, and I have become increasingly desperate to announce it. At present, rdifffs should be considered alpha quality software. It can browse my real-world backup, albeit slowly, and with several metadata bugs. This is more than archfs can manage. It can read files from the most recent backup, and most files from incremental backups, but not all.

Andrew McMillan: DAViCal 0.9.9.4 released

DAViCal 0.9.9.4 is now available, along with AWL 0.46. This is a recommended upgrade with a focus on stability and reliability. Release notes are on the wiki at http://wiki.davical.org/w/Release_Notes/0.9.9.4. Most of the changes are subtle: fixes to small bugs or adjustments to correctness in respect to standards. In particular there were some errors in handling of various requests for addressbook data, and the support for WebDAV synchronisation is updated to draft -04 of the specification. One notable addition is the new '/feed.php/username/calendar/' URL which will provide an Atom feed of the events added to a calendar. This is pretty experimental at present, but any problems with it won't affect the rest of DAViCal so I felt it safe to include in a stable release series. I've also created a DAViCal Announce mailing list which in the future will be the primary place that notifications like this are sent to, so those of you who are subscribed here but really only want to see announcements should subscribe to that list. In a few weeks time (well, when I remember, I guess :-) I want to move the DAViCal General mailing list to a lists.davical.org mailing list. As of today I've moved the DAViCal developers mailing list there already (pretty easy since it did not involve moving servers) but the old address for that one will continue to work indefinitely. Also, as of yesterday, the sourceforge.net project name for DAViCal finally got changed, so DAViCal is now at http://sourceforge.net/projects/davical - yay! At the end of January I will be presenting about Calendaring and Free Software at Linux.Conf.AU 2011 in Brisbane - I hope you've all got your tickets already, because there isn't much time left now :-)

Evgeni Golov: because people asked: my irssi advanced windowlist setup

As XTaran and uschebit asked yesterday at the 27C3 about my nice windowlist in irssi, here is what I use: adv_windowlist.pl. Download it, put it into you ~/.irssi/scripts and load it with /script load adv_windowlist. Now you have a list with all those window names in them, but it s still a bit ugly ;)First of all, get rid of the default Act list of irssi: /statusbar window remove actNow let s customize awl a bit:Done! Your irssi should look like this now:

Sandro Tosi: Re: Converting date to epoch

Alexander,did you even consider that I might need to convert a date to epoch in a python script? :)

Christoph Egger: Debian GNU/kFreeBSD

So when I was travveling to my parent's for christmas it looked like I'd have limited computer access. My Netbook is quite OK for reading mail but not really useable for any real hacking. And my trusty Thinkpad (Z61m) was oopsing when X was running so not much useable either. But as some Live CDs placed here were working well I decided that this would be fixed by an reinstall. And as I was reinstalling anyway I decided I could just choose kfreebsd-amd64. Turned out to be a quite entertaining decision with lots of stuff to hack away with wireless Bad news: there's no wireless support on Debian GNU/kFreeBSD at the moment. This problem is tracked as Bug #601803 so for wireless internet you will need a (plain) Freebsd chroot. Haven't tried this myself yet -- busy figuring other stuff out. SBCL Having a FreeBSD chroot I decided to give SBCL on GNU/kFreeBSD another try after having failed to get it working in a VM some time ago. With quite some help on SBCL's IRC channel I managed to build a patch that enables building (you need to force a :os-provides-dlopen to the feature list additionally). There's currently no multi-threading working so I hae a project for the rest of the hoidays (well lots of other stuff to do as well ;)) Audio Some more user-related stuff now. As it is this time of the year I wanted to listen to some 27c3 streams so I needed working audio. However there's no OSS device available. Turned out you just need to kldload the right module (here snd_hda) to get sound working. Volume was rather low although hardware controls of the soundcard where at max. As that's all OSS there's no point looking for alsamixer. Turns out aumix can do that here. IPv6 aiccu stuff Installing aiccu, copying the config in and starting did not work out as well. I already tried to do that from within the FreeBSD chroot already (which doesn't work for some reason) until I discovered just loading the if_tun kernel module solves the aiccu on Debian issue quite well. To get a default route up the last step was finding /lib/freebsd/route again -- /sbin/route is a wrapper around that abstracting differences in BSD route but not supporting IPv6.

28 December 2010

Alexander Wirt: Converting date to epoch

# date -d '2009-03-04' +%s
   1236121200
There is no need to harm python.

Steve Kemp: Minor success has been achieved in reimplimenting mod_rewrite

So yesterday I mentioned the mod_rewrite-compatible proxy server. Today I've spent several hours getting to grips with that. I've progressed far enough along that the trivial cases are handled, as the following test case shows:
void
TestParamteredMatch (CuTest * tc)
 
    /**
     * We pretend this came in via the network.
     */
    char *request = "GET /login/steve.kemp/secret#password HTTP/1.1\n\n";
    /**
     * This is the mod_rewrite rule we're going to test.
     */
    char *rule    = "RewriteRule
                       ^/login/(.*)/(.*)/*$
                         /cgi-bin/index.cgi?mode=login;lname=$1;lpass=$2";
    int res = 0;
    /* Parse the HTTP request */
    struct http_request *req = http_request_new (request);
    CuAssertPtrNotNull (tc, req);
    /* Ensure it looks sane. */
    CuAssertStrEquals(tc, "/login/steve.kemp/secret#password", req->path );
    /* Create the rewrite rule */
    struct rewrite_rule *r = rewrite_rule_new (rule);
    CuAssertPtrNotNull (tc, r);
    /* Assert it contains what we think it should. */
    CuAssertStrEquals(tc, "^/login/(.*)/(.*)/*$", r->pattern );
    /* Apply - expect success (==1) */
    res = rewrite_rule_apply( r, req );
    CuAssertIntEquals (tc, 1, res );
    /* Ensure path is updated. */
    CuAssertStrEquals(tc, "/cgi-bin/index.cgi?mode=login;lname=steve.kemp;lpass=secret#password", req->path );
    free_http_request (req);
    free_rewrite_rule (r);
 
So all is good? Sadly not. I was expecting to handle a linked list of simple rules, but I've now realised that this isn't sufficient. Consider the following two (real) examples:
#
#  If the path is /robots.txt and the hostname isn't repository.steve.org.uk
# then redirect to the master one.
#
RewriteCond % http_host  !^repository\.steve\.org\.uk
RewriteRule /robots.txt$  http://repository.steve.org.uk/robots.txt [R=permanent,L]
#
#  Request for :  http://foo.repository.steve.org.uk 
#  becomes:  http://repository.steve.org.uk/cgi-bin/hgwebdir.cgi/foo/file/tip
#
RewriteCond % http_host  .
RewriteCond % http_host  !^repository.steve.org.uk [NC]
RewriteCond % http_host  ^([^.]+)\.repository.steve.org.uk [NC]
RewriteRule ^/$ http://repository.steve.org.uk/cgi-bin/hgwebdir.cgi/%1/file/tip [QSA,L]
So rather than having a simple linked list of rules for each domain I need to have a list of rules - each of which might in turn contain sub-rules. In terms of parsing this is harder than I'd like because it means I need to maintain state to marry up the RewriteCond & RewriteRules. Still the problem isn't insurmountable and I'm pleased with the progress I've made. Currently I can implement enough of mod_rewrite that I could handle all of my existing sites except the single site I have with the complex rule demonstrated above. (In all honesty I guess I could simplify my setup by dropping the wildcard hostname handling for the repository.steve.org.uk name, but I do kinda like it, and it makes for simple canonical mercurial repositories.) ObQuote: - 300

Sandro Tosi: Convert a date to epoch

it seems like an easy quest, ain't it? well, it took me far too long to get it done, so let just write it down, so that maybe I won't forget in 2 seconds:
>>> import time
>>> str = '2009-03-04'
>>> format = '%Y-%m-%d'
>>> time.mktime(time.strptime(str, format))
1236121200.0
>>> int(_)
1236121200
and here you have your epoch (if you just need seconds, use int()).

Jose Luis Rivas Contreras: Follow-up[2]: pino-0.3+librest (and not cmake, at all)

So, after having troubles while trying to compile pino-0.3 it turns out is has nothing to do with cmake, nor with librest not shipping gir files but with vala bindings and incompability between those bindings from rest-0.6 and rest-0.7. So if I really want to compile pino-0.3 I have two options: use rest-0.6 or update rest.vapi for vala and send a patch for pino-0.3 to get a working code with rest-0.7 and it s new vala bindings But there s not enough free time for me this holidays so, maybe next time :-/ Anyway, thanks to all those who helped :)

Wouter Verhelst: Wanted: a "DAS keyboard" with ISO mechanical layout

Some people claim that AZERTY is a crime against humanity. I claim that if you're going to point and laugh at one layout in defense of another, you should have that other be something actually better, like the dvorak or Turkish F layout, not QWERTY. One additional reason: the mechanical layout of a US QWERTY keyboard (the ANSI layout) is inferior to the mechanical layout of the AZERTY keyboards. This is a mathematical fact the ISO layout has 102 keys, the ANSI one has only 101 of them. In that light, I find it highly disappointing that Thinkgeek.com's Das Keyboard uses the ANSI mechanical layout, and that there is no ISO version of the same thing. If there were, I'd have bought one years ago. (Yes, that's meant as a hint, in case you didn't catch that) Update: apparently it exists, it's just that ThinkGeek doesn't have it. For those who want one, it's available here, amongst others.

Matthew Garrett: More Android source code

Telechips also appear to have released the source for their TCC89XX devices, which ought to provide at least some level of support for the Augen devices.

(I promise that I will talk about things that aren't GPL-related in the near future)

Alexander Sack: ntrack 011 heading for experimental

ntrack 011 heading for experimental: I added a ntrack-libnl binary package, for the libnl backend so it s in NEW queue for now.

Next.

Previous.