$ git svn clone -A authors --trunk=trunk/libclass-makemethods-perl \ --branches=branches/libclass-makemethods-perl/upstream \ --tags=tags/libclass-makemethods-perl --no-metadata \ file:///home/svn/debian libclass-makemethods-perl
clean-git-svn:#!/bin/sh -e tags= git branch -r egrep 'tags/[^@]+$' echo "$tags" perl -ne \ 'chomp($_); my $head = $_; s,\s+tags,debian,g; print "git tag $_ $head^\n"' for i in $tags ; do echo "git branch -r -d $i"; done upstream_tags= git branch -r egrep ' +[0-9][^@]+$' echo "$upstream_tags" perl -ne \ 'chomp($_); s,\s+,,g; print "git tag upstream/$_ $_^\n"' for i in $upstream_tags ; do echo "git branch -r -d $i"; done echo "git branch upstream current" echo "git branch -r -d current" echo "git branch -r -d trunk"
gitk to make sure this won't screw anything up. If your the part you're converting also came up from CVS, you'll probably have a bit of a mess on your hands that will need more manual cleanup. gitk is really an amazing visualization tool and can help a lot here. Once you're satisfied just pipe it into /bin/sh. Since git svn mostly can't track where you merged in your SVN repo, make sure you merge the upstream branch into master as soon as you can. It will save you a lot of conflicts later, trust me.svn is svn export. Does an equivalent command exist in git? You would think there would be an option you could pass to git clone to do this but I can't seem to find anything.
Hello, World!Using ld this can be read in as a plain binary blob, and then written as a standard relocatable ELF object.
ld -r -b binary -o foo.o foo.txtNow we have a standard ELF object with the data and some useful symbols defined. objdump will show you the contents.
$ objdump -x foo.o
foo.o: file format elf32-i386
Sections:
Idx Name Size VMA LMA File off Algn
0 .data 0000000d 00000000 00000000 00000034 2**0
CONTENTS, ALLOC, LOAD, DATA
SYMBOL TABLE:
00000000 l d .data 00000000 .data
0000000d g .data 00000000 _binary_foo_txt_end
0000000d g *ABS* 00000000 _binary_foo_txt_size
00000000 g .data 00000000 _binary_foo_txt_start
Here we see 13 bytes of data, and a symbol which contains the address of
the data. This is all we need to access it from a C program.
#include <stdio.h> extern char _binary_foo_txt_start[]; int main (void) puts (_binary_foo_txt_start); return 0;Now if we compile this and link it against the generated object, we'll have a binary.
$ gcc -o test test.c foo.o $ ./test Hello, World!Hooray! One small problem which alert people should have noticed: the string itself is in the .data section, which is read/write. For my use, I want it to be read-only data in the .rodata section so that it isn't copied for every instance of the application. As far as I know, this isn't possible with ld but objcopy will let us rename sections on the fly.
$ objcopy --rename-section .data=.rodata,alloc,load,readonly,data,contents foo.o foo.o $ objdump -h foo.o ... 0 .rodata 0000000d 00000000 00000000 00000034 2**0Excellent, problem solved. If you want to download this sample, I have a tarball. Many thanks to Daniel Jacobowitz for pointing out how to achieve this. Update: note that any data embedded in the binary like this won't be terminated with a NULL. This is obvious in hindsight, but due to luck my example still worked. There might be a way of asking objcopy to append a 0 to the end of the data, but if not always remember to use the start and end pointers or size instead of just the start, or append a NULL yourself before converting to an ELF. NP: (), Sigur Rós
IFACE=wifi0 # setup ingress filtering /sbin/tc qdisc add dev $IFACE handle ffff: ingress # local network is unrestricted /sbin/tc filter add dev $IFACE parent ffff: protocol ip \ prio 10 u32 match ip src 192.168.2.0/24 \ police conform-exceed ok/ok flowid :1 # incoming internet traffic is limited. /sbin/tc filter add dev $IFACE parent ffff: protocol ip \ prio 50 u32 match ip src 0.0.0.0/0 police \ rate 1500kbit burst 10k drop flowid :2 # outgoing traffic /sbin/tc qdisc add dev $IFACE root handle 1: htb default 30 # local network is unrestricted /sbin/tc class add dev $IFACE parent 1: classid 1:10 htb \ rate 54mbit burst 15k /sbin/tc qdisc add dev $IFACE parent 1:10 handle 10: sfq perturb 10 /sbin/tc filter add dev $IFACE parent 1:0 protocol ip \ prio 10 u32 match ip dst 192.168.2.0/24 flowid 1:10 # internet traffic is limited. /sbin/tc class add dev $IFACE parent 1: classid 1:20 htb \ rate 160kbit ceil 196kbit burst 15k /sbin/tc qdisc add dev $IFACE parent 1:20 handle 20: sfq perturb 10 /sbin/tc filter add dev $IFACE parent 1:0 protocol ip \ prio 50 u32 match ip src 0.0.0.0/0 flowid 1:20Long example, I know. The main reason is that I'm not limiting traffic to local computers. Furthermore, I'm also limiting my incoming traffic to use up at most 1.5 mbit of the 2 mbit connection, so my housemates will be able to use the internet as well (Debian mirrors send data fast - fast enough to kick them out of any online game they might be playing...).There is one important detail hidden in there: sfq. This stands for "stochastic fair queueing". It tells the network stack to basically send "one packet for each connection in turn". This way, the small packets needed for download or interactive SSH sessions will get out quickly even when doing a larger upload.It works great for me - I'm having a good download rate, using the 160 kBit upload limit completely (I don't want to completely fill up the 192k upload link either) and I'm actually writing this blog entry remotely via SSH. The lag when writing is okay, probably around 300ms. Without shaping, this wouldn't work this well.(And no: just using 'sfq' for your outgoing traffic is not enough, since the key scheduling is happening at the weakest link. So you have to limit your traffic shaping setup to be just below the actual weakest link.)
The phrase "rebel with rather too many causes" was a phrase originally directed at protest.net -- a event calendaring system for activists that I was briefly involved in over a summer during college. I like the phrase and use it frequently but I didn't want to take credit for it. Google indicates that it originates in NTK #53 I'm not at all surprised.
My parents worked as doctors in Kenya, Papa New Guinea, and elsewhere before they had children. This probably doesn't matter to anyone else but they worked with an organization that was like MSF in that it was a humanitarian organization that sent physicians around the world but it was not actually MSF as the article states. I don't think MSF had grown beyond French doctors when my parents were practicing overseas.
When LWN pointed to the article, and in the original was well, there a focus on some comments I make about non-profit organizations. Since in a context of talk about my political work I just want to clarify my comments in a little more depth here. I think that one problem that has stemmed form Open Source's emphasis on businesses and efficiency is that free/open source software people end up making arguments in business terms: you should use application X because it is more efficient and faster. For many of the folks who have built this whole movement though, and for most in the free software camp, it's about freedom, not efficiency. By targeting businesses, we encounter a skeptical audience. More importantly though, we end up making arguments that, while true, are not the ones that motivate us. I think that low-hanging fruit for free software activists might include groups that already support free software ideas of sharing and user empowerment and that are looking for ways to use free software already. Groups we don't need to be afraid about saying "freedom" around. Not so coincidentally, these are sometimes organizations that I have a lot in common with politically. But that's far from always the case. There's a big group of philosophically aligned organizations in the NGO/non-profit community and the problems keeping them away are often technical. This is good news, of course, since solving technical problems is the free software movement's core competency. This is something I've been thinking about for a long time: Debian-NP was one project I helped start that tried to address this issue. Now, many people involved in the FSF, including myself, have political convictions that go beyond software. I do not want these convictions, and my statements about philosophically aligned organization, to be interpreted as call for a political shift in the organization in mainstream political terms. I deeply respect the way that RMS has kept his political opinions separate from the Foundation's. Biella and I have ever written about the importance of this political demarcation to free software's success. It's certainly not something I would want to change.
case somevar
when 17
do_something_here()
end
Because, you know, if statements are for people who know how to
program, or something.
Next.