Search Results: "duck"

10 January 2008

Jordi Mallach: FOSDEM 2008

As part of a sad trend that pulls me away from my healthy travel habits, I just booked plane tickets to Brussels for February 22nd. Note this is 1.5 months of planning ahead. madduck, your turn! Additionally, two weeks ago I got tickets for a one week long trip around parts of Germany at the end of the month. The travel plan is totally undefined, so I don't know what cities I'll be visiting yet. Fun!

9 January 2008

Martin F. Krafft: Down and up and down and up

You are probably using DHCP on the machine currently in front of you. The Dynamic Host Configuration Protocol is a way for your computer to obtain an Internet address from a pool of available addresses, and to return it to the pool when you no longer need it. Basically every Internet service provider uses DHCP, or something similar. As a network operating system, Linux has DHCP support (and had it for ages). In true Unix fashion, Debian sports at least four DHCP clients. Debian s default is dhcp3-client, also known as dhclient. The theory is that the client requests an address lease from the server and periodically renews it. This process yields a number of events, to which the operating system can react. For instance, initially, the client issues a PREINIT event to get the interface into a state where it can talk on the network, and a BOUND event as soon as it acquired a lease, or FAIL if it, uh, failed. After a certain period of time, the client tries to renew the lease. If it succeeds, it issues a RENEW event; if it fails, it yields EXPIRE. So much for the theory. It seems that dhclient is rather stupid, which I tried to document in bug #459813 it does things differently: given a lease, after a certain period of time, it just issues an EXPIRE event, which causes the operating system to deconfigure the interface and take down connectivity. Then, the client spits out a PREINIT event, followed by BOUND or FAIL, as appropriate. I have not quite investigated what all this means, but this much is for sure: periodically, your machine goes offline, only to come back online a second later. If this were Windows, one would probably knock on wood and be glad that it works at all. But we re on Linux here, Debian even, so this cannot be. I d love to be proven wrong, so if you have a minute, please try to verify. One way of doing so is to insert
echo "$(date) got $reason" >> /tmp/dhclient-script.reasons

towards the top of /sbin/dhclient-script and monitor the output file. Once your client renews, it should read:
Wed Jan  9 11:53:27 CET 2008 got RENEW

but instead you ll see
Wed Jan  9 11:53:27 CET 2008 got EXPIRE
Wed Jan  9 11:53:28 CET 2008 got PREINIT
Wed Jan  9 11:53:33 CET 2008 got BOUND

and if you look closely enough, your interface will be unconfigured those seconds between EXPIRE and BOUND. I only spent about 2 hours with dhclient last night, as part of my efforts on netconf, but I already found bug #459813 and bug #459818, two bugs which don t suggest that dhclient is quality software. If I find more, I ll have to consider a different client, hoping that there are others which separate the DHCP client from the operating system calls in a similar way as dhclient does. NP: The Flower Kings: @Live Recording, Uppsala City Theatre, Sweden, 10 February 2003

6 January 2008

Martin F. Krafft: New blog software and Ikiwiki templates

Every time I read a blog post about a blog having moved or a redesign , I swear to myself, again and again, that I would never do alike. And yet, having just finished the migration of all my posts from PyBloxsom to Ikiwiki, I feel uneasy and may have overlooked an issue or two. Thus, I am asking my readers this way to report any problems to me. But there s more to this post. I switched to using Ikiwiki because I ve had major problems in the past, drawing the lines between blog posts, wiki notes, and pages to be published on a home page. In fact, for the past years, I never had a home page and instead published information intended for posterity on my blog. Ikiwiki is mainly a wiki compiler, but it can be used to generate blog feeds as well, so it is, for me, the ideal tool to fuse the three into one. The result, http://madduck.net, is still far from done and looks quite awful. The blog works (as far as I can tell), but I ran out of time for the rest. Specifically, I need to work on the layout and design. The Gopher-like, plain Ikiwiki style is usable, but I find it too cluttered and unappealing. Unfortunately, Ikiwiki does not (yet) make it easy to amend the underlying templates in a consistent way, nor does it allow the use of different templates for different parts of the site. It is to specify a different template to be used on a page-by-page basis, but such a template cannot reuse an existing template, making it quite hard to achieve a consistent look across sites incorporating different components, such as blog, home page, and wiki. I postulate that the Template Toolkit would solve a number of problems because of the wrapper directive, which makes template reuse quite trivial. Please refer to my wishlist request for more information. Another problem I encounter on Ikiwiki sites is with tags. Tags are mainly specific to the object to which they re stuck. However, I often use them the other way around, too: as concepts. And sometimes I d like to see all pages related to a given concept ( tagged with a given tag ). The only way to do this with Ikiwiki is to instantiate a page for each tag and slap a map on it. This is quite tedious and I d really love to see Ikiwiki do so by default for all tags. Fortunately, Ikiwiki is well maintained and growing, so my hopes are up. If it weren t written in Perl, I d have already taken a stab at it, but as it stands, I ll have to wait for someone else to do it, or for a rainy weekend when I am not afraid to get my hands dirty.

21 December 2007

Brett Parker: More on rss2maildir.py...

Just to confirm, yes, I do know of rss2email - it has the unfortunate side effect of needing an MTA configured to process the rss feeds and seperate them in to seperate maildirs, basically I wanted something that would write straight to the maildir for me because then I don't have to think about the config for the MTA on each machine that I want to use it on. Thanks to Martin for the suggestion of pandoc, I'll take a look at that over the next few days to see if it'll make the "plain text" generation slightly neater than the current HTMLParser based code.

18 December 2007

Martin F. Krafft: bugscripts and rng

Yes, Bastian, there is a way to do what you want. I believe I told you from the very start: refactor reportbug and implement reportbug-ng on top of the existing code. But no, you chose to reimplement everything (a typical thing to do for GUI programmers) and now you are asking us maintainers to change the way we've been doing things for years? You also make presumptuous statements about how we deal with bug reports. If you personally hate how certain packages prepare bug reports, then maybe you should personally suck it up and use different software? Seems like a more logical and less intrusive way forward, then expecting others to "send a friendly mail" to ask for more information on a bug report. Maybe you have all the time in the world, but I don't. I can work on e.g. mdadm (which uses an interactive bug script) only on rare occasions, and then I'd rather fix and close bugs than to indulge in another iteration of bug submitter ping-pong. You are also personally annoyed by long pre-subject texts, which you doubt anyone reads? I don't even bother to challenge that, but let me say that pre-subject texts are there to prevent stupid bug reports, or bug reports filed in the wrong place, and to take load off the maintainer. So you chose to ignore them? Given the projected user-base of your tool, I'd say you should rather force people to read them by asking them to transcribe the text. If you don't want to pop up a terminal, well, why the heck didn't you integrate debconf properly, while reusing reportbug, and taking a step forward to provide a proper interface for bug scripts? Why do you even bother to whine about interface issues at this point? Feel free to take over my packages, which make use of interactive bug scripts. I see zero reason to change them, and I will not. NP: The Flower Kings: Paradox Hotel

Martin F. Krafft: Taxes and wars

I was considering importing my car to Switzerland. When I moved in 2002, I asked the customs office about the process and was told that I'd need to pay taxes and fees, so I postponed the import until Day Unknown. Today, a very friendly customs official told me that this is not true and that I could have imported my car duty-free if I had done so as part of my move. Slightly annoyed, I went on to discover what those duties would be today. I found out that there are seven different types of fees I'll have to pay, and tried to understand the reason for these fees:
  1. To import a car, you need a form 11.010, downloadable from the Swiss Customs Office. Because each download causes extra work for the administrator, they charge a nominal fee of CHF 0.70 to get the PDF file.

  2. I take that form to the customs office. There, the officials will assemble around the car and attempt to lift it. I don't know why they do that, but they charge you between CHF 12 and CHF 15 per 100kg of weight. I think it must be recompensation for the hard physical labour. Also, each customs official can lift 100kg, which explains those figures they seemed a bit arbitrary at first.

  3. Next, they'll ask 4% of the estimated value of the car as a car tax. They do this because the value of a car is directly related to the area it covers, and since Switzerland is so small, you effectively have to buy a couple of square metres for the car. It's not quite as easy as that though: once I bought the area under my car, I have to move the car away, because I cannot park my car on the area I just bought. I have to buy parking space for that. If I don't want to buy a parking space, I have to keep the car moving. In order to keep the car moving I need to fork over CHF 40 per year for a permit to drive the car on Swiss highways.

  4. Now, I pay 7.6% value-added tax. It makes no difference that the car isn't new, that I am not selling or buying it, nor that I have already paid 16% VAT in Germany when I bought it. Since I am about to "consume" the car in Switzerland, I have to pay consumer tax. Since I also consume the physical labour the officials put into the car lifting exercise, as well as the area under the car I bought, I pay VAT for (car value + lifting tax + area under car). Unfortunately, the European Union will not pay back the consumer tax I previously paid as part of the export, since I already consumed the car there.

  5. I then get a report about the import. This costs CHF 20. I don't need this report, but I have to buy it. The reason is that the computer admins are so overworked serving PDF files to future importers that they have not had time to stop the computers from printing this report, and the special paper and toner used by all administrative offices in Switzerland costs about CHF 20 per page. An alternative explanation is that CHF 20 is the smallest bit of "money" in Switzerland, everything else is "change".

  6. I will also have to pay annual taxes for possession of a car, the value to be determined by the custom officials. Since I already paid for the area under the car while moving and while stationary, I think the annual car tax is levied for environmental reasons. A lot of people drive through Switzerland to get from Germany to Italy or from Austria to France, pumping a lot of exhaust gas into the Swiss air. This makes them guilty, just like inhabitants of Switzerland who own a car are guilty. Due to legal reasons, the Swiss government can only punish Swiss people for those sins, so the annual car tax is a little higher to cover for all environmental damage. It is doubtful where the money goes, though. I also have to continue paying taxes in Germany, because I still have a residence with my parents.

  7. Finally, I have to purchase a car insurance. That insurance does not insure the car, it insures the others on the road. Actually, it is a driver-car-dependent insurance, meaning that the others are insured only if I am the driver of my car. If I drive another car, or someone else drives my car, the others will not be insured. unless I pay higher insurance fees. Because cars with a larger area under them and those that require more people to lift them are more dangerous, the insurance fee is proportional to the car density. At least I can give up my German insurance and be covered by the Swiss insurance. However, I cannot keep my German insurance and be covered in Switzerland. I think this is because the head of customs department and the CEO of the insurance company have sex with each other.

It's been a great day, given how much I learnt. I finally understand why people have fought wars over taxes. I think I may leave the car in Germany. PS: Yes, this post may be considered hyperbole. NP: The Pineapple Thief: 8 Days Later

14 December 2007

Martin F. Krafft: Surveys on the console

As part of my research, I may have to conduct a survey among Debian contributors. The word "survey" usually elicits frowns because surveys are often misconducted. MJ has taken the time to draft up some advice to surveyors. Problems with surveys generally fall into one of two categories: content and presentation. I'll refrain from making statements about content (Wikipedia has some stuff on questionaire construction) and instead concentrate on presentation in the following. Commonly in the digital age, surveys are administered via a web page or e-mail. In my recent Ph.D. transfer report, I identified a number of shortcomings with these approaches: Asking Debian contributors to click radio buttons on a web page is a bit like expecting a mountain biking champion to ride a tricycle across a paddock: painful, if not offensive. Furthermore, web surveys can only be taken while on-line, when most of us have better things to do. E-mail surveys address some of these problems, but create new ones: answers cannot be constrained to a domain (think multiple-choice), character set and formatting issues make evaluation difficult, and it's impossible to prevent users from attaching comments or modifying responses. In thinking about the issue, I came up with a third means to administer a survey: a console tool. Think of a Debian package which provides a console application controlled by a study-specific data file. The data file specifies the questions and their answer domains, and the tool presents those to the participant. Since most of Debian happens on the console anyway, such an approach to surveys seems more appropriate. Interaction with the survey tool would be as easy as pressing the 2 or 4 keys to select one of the multiple choices, and the tool would immediately move on to the next question (and not wait for the user to hit enter). Obviously, n and p should allow navigation back and forth across the set, and c would spawn a text editor to give the user a chance to attach a comment to his/her current response, in which s/he might criticise the question or provide additional information. Finally, the tool should be able to pick up where it left off, should the user chose to exit/suspend the survey for now. Integration with debconf or another interface abstraction is also worth consideration. There is more to it: people change their minds and should thus be able to amend responses. With their consent, it might be valuable to track such changes and inquire about their motivations. As I was thinking about how to realise this, I suddenly arrived at version control: use Git as a backend storage. The set of cool features this would enable seems to be endless: it works off-line and can be used to track aforementioned changes, but also offers the possibility to create a squashed result in case the participant prefers to submit only the final result. Furthermore, it's a trivial change between anonymous submissions, and submissions authenticated by a GPG signature. In addition, the survey tool should be able to display questions according to previous responses (control flow). For instance, if the survey determines that a given user is a contributor to the bug tracking system, but not a project member, it wouldn't make sense to ask when s/he received his/her Debian account. Furthermore, questions could be dynamically creatable from context, so that the survey can drill into depth depending on previous responses, rather than asking the same questions to all participants. I am currently applying for funding to outsource the development of such a tool. If you are interested in coding it up and getting paid for it, speak to me. Here are some more specifications to keep in mind before jumping on: These are likely to be incomplete, but should convey the basic picture. Feedback is always welcome! NP: Oceansize: Frames Update: James Andrewartha pointed me to purity, which asks multiple-choice questions on the console. It has the kind of interface which I envision. Also, Chris Lamb suggested this personality survey as a base line. Well, actually he just suggested I look into it.

Martin F. Krafft: Finally on the right track

It's now three weeks since I am officially a Ph.D. student at the University of Limerick, but I've been too busy to do anything about it. Today, I finally updated my research webpage and sat down to tell you the tale of how I successfully defended my research, but failed to leave the country the next day. As is customary in the British system, I initially enrolled at UL as a Master student. In October, I then applied for a transfer to the Ph.D. track, submitted a transfer report and prepared for a live defence, according to the UL code of practice. On 23 November, I presented my research to my examiners, Dr. P r gerfalk and Patrick Healy, who found my work to be at Ph.D. level and approved of my transfer. I was moderately nervous going into the presentation, not really knowing what was expected of me. In the end, however, the presentation went well and the ensuing discussion provided valuable feedback. Thank you, P r and Paddy, as well as Norah (who chaired), and Brian (my supervisor) for all your time, help, and support. After the defence, Mel waited outside with a beer in hand, and it being Friday and all, I happily popped the cap and drank. Plans to head to The Stables gave way to chilling on the couch in 110 (my home away from home), before we headed to town for the Kila gig. We arrived early, had some beers, enjoyed the show, had some more beers, went home, and had some more beers to Guitar Hero, and when I crawled into bed, I was shocked to find out that I had lost all track of time and it was in fact already 5:30 on Saturday morning, instead of the perceived 2 o'clock. See, the source of this shock was a plane that left Dublin the next day around noon, and a rental car that was to get me there, leaving the house at 8. But when my alarm shattered my drunk dreams at 7:30, it quickly became clear (or well, everything was blurred, actually), that I would have a hard time getting into the car, and I would certainly never manage to navigate it to Dublin, a three hour drive. So I called up the airline and the rental company and rescheduled for the next day (only one flight from Dublin to Zurich a day), and went back to dreamland. I am entirely unsure whether my Ph.D. transfer defence was enough of a reason to get smashed. I still had a good time, though as always in Ireland, especially with this crowd NP: The Flower Kings: The Rainmaker

13 December 2007

Martin F. Krafft: Delaying mail delivery

My current mailfilter has two features which increase my day-to-day productivity:
  1. a "tickler," which is a reminder system inspired by the tickler file component of David Allen's Getting Things Done action management method: I can submit emails and notes to the tickler along with a timestamp in the future, and the tickler delivers the mail (or note) to my inbox when the timestamp has passed.
  2. the ability to delay certain types of mail (e.g. Debian mail is held until the weekend, while news items and the like are only delivered at night).
My current implementations work alright, but they're brittle and crap. What's worse is that the two features could be combined and handled by one and the same tool, but I implemented them differently for now: The tickler consists of a Maildir, to which I can submit mails, either by mailing a note to a specific email address (currently broken, thus not linked from here), or by adding a tickle stamp (X-Tickle header) to a message with this script, saving it to the local tickler mailbox and asking offlineimap to shove it to the server. On this server, the tickler queue is regularly scanned by a script, which resubmits mail whose timestamp has expired to my mailfilter, where it is treated somewhat specially as a resubmitted mail. After almost three months with this setup, I can identify the following shortcomings: When I implemented the delay queue, I knew of these problems and went a different way: delayed mail is stored in a Maildir and a (msgid, timestamp, filename) tuple is inserted into an sqlite3 database on the mail server. This script regularly processes the queue. If I just sent you the chills, at least we have the same taste. There are numerous problems with this approach, the foremost being that Maildir filenames are not guaranteed to be constant: mails jump between the new and cur directories, and tags, such as seen are encoded in the filename (thus, symlinks also cannot be used). My script now uses an ugly heuristic, which at least makes it work. I should investigate whether inodes could be used instead as I think those wouldn't change throughout the lifetime of a mail, at least while it's not moved between folders. I initially considered just dumping messages to files and encoding the timestamp in the files' mtime, but then I would not be able to access the queue with mutt in case I needed to fetch a delayed mail prematurely, or if I wanted to synchronise the queue with offlineimap as well. The past few days, I've been condensing experiences from both approaches and am working out a new technique to combine both features. In essence, I think the database/index approach is the best, if I can figure out a way to uniquely identify mail message files, ideally across folders. Assuming I can use inodes for that, delayed mail would then be stored into the delayed Maildir and an (inode, timestamp) tuple saved into the database. Tickler mail would be stored along with all other mail in my store Maildir and would get a similar entry in the database. This approach solves some problems and leaves others. Assuming I synchronise the store Maildir remotely (which I do), then I can easily fathom making modifications via IMAP which causes orphan records in the database (if only IMAP would allow me to store key=value pairs for mails ). Furthermore, I'd have to submit mails to the tickler by bouncing them to an email address, and deleting the local copy, unless I want duplicates. If now the mail is somehow dropped, I've lost mail. Still unhappy about all of this, still searching for a better implementation, I'd appreciate any feedback! NP: Luminous Flesh Giants: Duma I Upadek

10 December 2007

Steve Kemp: Open your eyes, look up to the skies and see

If you have a (public) revision controlled ~/bin/, or bash/shell scripts I'd love to see them. Feel free to post links to your repositories as comments. I'm certain there are some great tools and utilities out there with I could be using. Right now the only external thing I'm using is Martin Krafft's pub script. I don't use it often, but it is very neat and handy when I do want it. (Something that I'd never have considered writing myself, which suggests there are many more gems I'm missing!) In other news my migration to mercurial is going extremely well. With only minimal downtime. Downtime for services really comes about because I have several websites which are powered entirely with a CVS checkout of remote repositories, so the process looks a little like this:

Steve Kemp: Open your eyes, look up to the skies and see

If you have a (public) revision controlled ~/bin/, or bash/shell scripts I'd love to see them. Feel free to post links to your repositories as comments. I'm certain there are some great tools and utilities out there with I could be using. Right now the only external thing I'm using is Martin Krafft's pub script. I don't use it often, but it is very neat and handy when I do want it. (Something that I'd never have considered writing myself, which suggests there are many more gems I'm missing!) In other news my migration to mercurial is going extremely well. With only minimal downtime. Downtime for services really comes about because I have several websites which are powered entirely with a CVS checkout of remote repositories, so the process looks a little like this:

6 December 2007

Martin F. Krafft: Pay us, we might actually do as promised

On Saturday, we sent an express letter to Ireland, using the courier service provider of the German Postal Service: DHL. The lady at the counter alerted us that the letter was unlikely to arrive on Monday, but Tuesday would be fine for our purposes, so off it went. What an amazingly crap choice. The letter has not arrived in Ireland today (Thursday) even, who knows whether it will make it tomorrow. Or next week. Or ever? When we handed over a fair bit of money to aforementioned lady for their express services, we entered a contract with the courier. A sensible assumption would be that the contract requires the courier to deliver the letter as soon as possible, which is my understanding of "express". But in this world, nothing is sensible any longer. Somewhat related to the asymmetry of e-shops I previously identified, the terms and conditions of the courier make sure that they cannot be held liable for failure to fulfill their side of the contract. The next time you walk up to the Deutsche Post/DHL counter, keep in mind that when you hand them money, you are purchasing a lower bound on delivery time: they assure you that they won't deliver the express letter before the next business day. That's it, nothing more, please move on. They don't even ensure that any such letter will arrive. Ever. But you cannot hold them liable. Maybe there is a reason why e.g. UPS charges almost three times the sum for express delivery of letters to Ireland: they actually get there in time. But then I check their conditions and see that they also interpret their delivery times as estimates of best effort, but no guarantees. Since when does "consumer" mean "get ready to be screwed?" Why are we putting up with this? I am now filing a complaint. I hope others in similar positions do the same. I am also going to try an experiement: post another express letter and ask to see their terms and conditions before forking over the money. I have a vague feeling that they'll fail to present them in an orderly fashion. Then I'll call up a lawyer friend and sum up my belligerence, time available, and plausibility. And the likely outcome is that I'll go to court against the Deutsche Post. You can count on me. NP: The Pineapple Thief: Variations on a Dream

3 December 2007

Michael Prokop: git[-svn] in 30 minutes

… or something like that… I planned to write a short note about how to start with using git-svn so I can provide a pointer to some of my colleagues. It turned out that git has too many nice features that you should be aware of. :) Hopefully my notes (now being a reference for myself as well, thx to gebi for all the help and feedback) are useful anyway. If you think something (more or less essential, or at least something most of us should be aware of) is missing: please feel free to mention that in the comment section of my blog entry, thanks. Disclaimer: I’m still happy with mercurial for what I - and we at grml in general - use it: linear, but anyway distributed development. git on the other hand provides some really nice features. Rebasing and branching with git is really great - so non-linear development just works. As usual: use the right tool for the right job. git is a bit complicate to use. Not only but especially in the beginning. On the other hand I’m not such a big friend of subversion. If you wanthave to use subversion (Graz University of Technology for example provides a svn service to their students and employees) but prefer to work with git instead you should be aware of git-svn. git-svn gives you bidirectional operation between subversion and git. First of all make sure you have all you might need when working with git. Make sure to use a current version of git (I’m refering to version >=1.5.3). Just execute the following command line on your Debian system to install all relevant packages:
aptitude install \
git-buildpackage git-core git-cvs git-daemon-run \
git-doc git-email git-gui git-load-dirs git-svn \
gitk gitweb qgit
Now let’s start with some general and basic configuration:
# Remove directories from the SVN tree if there
# are no files left behind, configure it globaly:
git config --global svn.rmdir=true
# Want some more global, personal git configuration?
for line in  
  user.name=Michael Prokop 
  user.email=foo@example.invalid 
  color.diff=auto 
  color.diff.new=cyan 
  color.diff.old=magenta 
  color.diff.frag=yellow 
  color.diff.meta=green 
  color.diff.commit=normal 
do
  git config --global $line
done
Check out man git-config for much more details about configuration options. First tip: set ‘g’ as an alias for git so you don’t have to type that much. I’ll write the long version in the following examples so copy/paste works for everyone. Make sure to use the short options of git itself as well: use ‘git co’ for example instead of ‘git checkout’. You can define your own aliases inside git as well - either manually in ~/.gitconfig or running something like:
git config --global alias.st status
Enough pre-configuration for now. It’s time to checkout the SVN repository:
# Check out the SVN repository and set 'svn/' as
# prefix for the branches:
git svn clone -s --prefix=svn/ \
https://svn.tugraz.at/svn/$project foobar && 
cd foobar
# Adjust svn:ignore settings within git:
git svn show-ignore >> .git/info/exclude
# List all branches:
git branch -a
# List all remote branches:
git branch -r
# Rebase your local changes against the
# latest changes in SVN (kind of 'svn up'):
git svn rebase
# Checkout a specific branch:
git checkout $branch
Ok so far? But what do we have to do if we want to work on the upstream source and are allowed to commit/push directly to the repository? Let’s see how to work on that without using branches:
# Hack:
$EDITOR foobar
# Check status
git st[atus]
# List diff:
git diff [foobar]
# Commit it with a commit message using $EDITOR:
git commit -a
# Now commit your changes (that were committed
# previously using git) to SVN, as well as
# automatically updating your working HEAD:
git svn dcommit
But what should we do if we do not have commit rights? Let’s create our own branch and send a patch via mail to upstream:
# Make a new branch:
git checkout -b mikas_demo_patch
# and hack...
$EDITOR
# Commit all changes:
git ci -a -m 'Best patch but worst commit msg ever'
# ... and prepare patch[es]:
git format-patch -s -p -n master
# Now send mail(s) either use git-send-email:
git send-email --to foo@example.invalid *.patch
# ... or if you prefer mutt instead (short zsh syntax):
for f in *.patch ; mutt -H $f
You got a mail from someone else and would like to incorporate changes from the attached patch in your repository? Just store the mail in a seperate mailbox (use save-message in mutt for example, keybinding ’s’ by default), then execute:
# Apply a [series of] patch[es] from a mailbox
git am /path/to/mailbox
Want to work on a seperate branch and rebase your work with upstream?
# First of all make sure to use recent sources...
# So pull when using plain git:
git pull -u
# .. or when using git-svn use:
git svn rebase
# Then create a new branch:
git checkout -b mika
# Hack:
$EDITOR
# Commit:
git ci -a -m 'Best patch but worst commit msg ever'
# Switch to master branch:
git checkout master
# Pull again when using plain git:
git pull -u
# .. or when using git-svn use:
git svn rebase
# Finally switch back
git checkout mika
# Now rebase it with plain git using:
git rebase origin/master
# ... or when using git-svn:
git svn rebase
# Now check out the last 5 commits:
git log -n5
Another branch-session might look like:
git co -b foo
$EDITOR
git ci -a -m 'foo changes'
git co master
git co -b bar
$EDITOR
git ci -a -m 'bar changes''
git co foo
git rebase bar
git log -n5
git st
git branch
Pfuhhh? Right. :) Now it’s time to check out another cool feature: git stash, which is just great when pulling into a dirty tree or when suffering from interrupted workflow. Demo:
git stash
git pull / fetch+rebase
$EDITOR # fix conflicts
git commit -a -m "Fix in a hurry"
git stash apply
git stash clear # unless you want to keep the stash
git reset rocks as well:
# List all recent actions:
git reflog
# Now undo the last action:
git reset --hard HEAD@ 0 
How to get rid of branches?
# Delete a branch. The branch must be fully merged:
git branch -d remove_me_branch
# Delete a branch irrespective of its index status:
git branch -D remove_me_branch
# Delete a remote branch:
git push reponame :branch
Repack a git repository to minimize its disk usage:
git pack-refs --prune
git reflog expire --all
git repack -a -d -f -l
git prune
git rerere gc
Use git cherry to find commits not merged upstream. Another really cool feature is the interactive rebasing: git rebase –interactive Make sure you are aware of gitk: Screenshot of gitk … and don’t forget to set readable fonts for gitk, like:
[ -r ~/.gitk ]   cat > ~/.gitk << EOF
set mainfont  Arial 10 
set textfont   Courier 10 
set uifont  Arial 10 bold 
EOF
If you prefer a Qt based interface check out qgit. Useful ressources:

29 November 2007

Martin F. Krafft: Rewarding geek^W survey participants

Sooner or later, I will conduct a series of interviews as well as a community survey among Debian package maintainers as part of my research. The motivation for my research is to improve the workflows in the Debian project. How could I make you take part in such a survey? A key challenge and necessity of a survey is to ensure a high degree of participation, or else the responses cannot be read as descriptive of the entire group. Well-formulated questions and a smart way to present them are prerequisites. For instance, I'd consider it quite counter-productive (somewhat ironic even) to ask Debian package maintainers to hit radio buttons on a web form. Instead, participation should require the use of tools with which we are familiar. Another way to get people to respond is by showing how their time will help the project. This assumes that the research hypothesis is tangible and the whole endeavour plausible. And that people care. A third means of motivation is to reward participants. Commonly, this is done by way of a draw among all participants at the end of the survey, and a price given out to the (random) winner. Obviously, the individual's chances get slimmer with every additional participant, but if the price is right, it's still worth a try. I've been pondering for a few days on what a right price would be. Previously, Nokia Internet tablets have been hip, but would you dedicate your time to a survey where you could win one of those? Or a Neo1973 (thanks Lo-lan-do)? Or would a game console, such as the PS3 or the Wii be more exciting? Or is there something (in the same price range) out there you want and would, uh, fill for fill out the survey I mean Please take a moment and let me know which price you could not resist. Don't hesitate to provide me with a list I could just as well let the winner of the draw chose her/his favourite NP: The Pineapple Thief: 8 Days Later Update: Gaudenz Steinlin suggested a Thecus N2100.

25 November 2007

Steve Kemp: Open your eyes, look up to the skies and see

If you have a (public) revision controlled ~/bin/, or bash/shell scripts I'd love to see them. Feel free to post links to your repositories as comments. I'm certain there are some great tools and utilities out there with I could be using. Right now the only external thing I'm using is Martin Krafft's pub script. I don't use it often, but it is very neat and handy when I do want it. (Something that I'd never have considered writing myself, which suggests there are many more gems I'm missing!) In other news my migration to mercurial is going extremely well. With only minimal downtime. Downtime for services really comes about because I have several websites which are powered entirely with a CVS checkout of remote repositories, so the process looks a little like this:

5 November 2007

Martin F. Krafft: How to ruin music, German-style

Solar Project are a German progressive band. I like most of their music, but they ruin it on almost every song by opening their mouths. The problem is not that they can't sing, the problem is that they sing ein English. Even zough zey doo not h ve i Dsch rm n ccent, they still can't pronunce their words, usually stressing the wrong syllables or resting too long on a vowel. For instance, they love the word "animals," but they always pronunce it aa-niiii-mals. As a result, I tend to think I am listening to some sort of "Learning English Special, First-Year Edition for German Folk Singers" CD, rather than progressive rock. What a shame. When The Beatles sing "O komm doch, komm zu mir" to the tune of "I Want to Hold Your Hand", I get the chills; when Peter Gabriel sings "Eindringling" instead of "Intruder", I turn off the stereo. But those experimented with their curiosity and translated their originals into German, which is applaudable even if horrific; well, it's "art", right? Solar Project seem to think English is so hip that they don't even bother with German. That's not uncommon either, many German bands sing English, but none have rubbed me so badly as Solar Project has. NP: Solar Project: Chromagnitude

30 October 2007

Martin F. Krafft: I am thinking of installing Windows

Did that title get your attention? Thought so. Now you have to read on as I explain! I am working on my PhD thesis and despite a bunch of gimmicks in place to help me with discipline (ha!), such as a pretty sweet mail filter setup (in need of further improvement), I end up distracted too often. For me, it's not the Internet which draws my attention, it's rather just Debian. As a developer, whenever I encounter a suboptimality (there are no problems with Debian!), I end up fixing it, or at least filing a bug report. Or I'll play around with my system and tweak things. I'd even argue that I am not playing around, actually, for I am good enough staying away from geeky fiddling and rather put proper fixes and enhancements in place. But those still consume time. Thus the idea of putting a second system with Windows installed wandered through my head in search of something to connect with. Yes, Windows, for one simple reason: I hate using it. So the theory goes that with Windows, I might actually stick with working on the thesis, trying to avoid touching that disgusting system otherwise. There are at least two (obvious) reasons why this isn't going to happen, any time soon at least: first, I am sure that the devil in me would find ways to kill time, and if only by cheating to obtain access to a Real operating system. Whether this is true, only a trial would tell. The second, and more important reason is that I have an important deadline coming up and anticipating the lovely whooshing sound it'd make zooming by is not an option. To get Windows up and running, and to have it ready for service, with LaTeX and Git and all the other tools I use properly configured, I'd have to invest 2-3 days, at least. And those I cannot afford at this stage. But the thought is now in my head. I hope you haven't just lost all your respect. I may actually be kidding. NP: Red Snapper: Prince Blimey

Martin F. Krafft: Exploding Marmite

I have nothing to add to this article on The Register. NP: Red Snapper: Bogeyman

17 October 2007

Martin F. Krafft: Mexican salsa on Pizza?

I am a purist when it comes to food. A huge purist. And yesterday I ended up at Miller's Pizza on Upper Baggot Street, Ballsbridge, Dublin, Ireland, and I enjoyed a Thai Prawn Green Curry Pizza, while colleagues of mine were devouring Mexican Salsa on Pizza Dough and similarly "perverse-sounding" foods. Unfortunately, their menu behind the above link is out of date (someone should let them know ), but that should not stop anyone with an appreciation for eclectic food and an adventurous vein from stopping to eat at this place the next time you're in Dublin. NP: Devin Townsend: Ziltoid the Omniscient

Martin F. Krafft: Asymmetry of eShops

Why do we shop over the Internet? Why do we let ourselves be treated like cattle in ways? The other day, I won an eBay auction and was notified shortly afterwards by the seller ("smile_plus168") that the item was not in stock anymore. So why did you list it, you muppet? If I retract my bid on eBay, I get punished for it, but sellers can do what they like? It was the icing on the cake to then receive the following note from the seller:
Would you pls still give me a positive feedback to me .pls don't worry about yours ,once you given it to me ,my ebay system will give you the same by AUTO.
Are you out of your mind? Then I got a note from an Amazon seller ("e-bug.de"), filled with spelling and grammar errors and letting me know that
unfortunately, the number of articles in stock was not enough to ship one out to you.
I got refunded in both cases, but still feel let down. I find it unacceptable that such asymmetry exists. After all, clicking that "Yes, I agree" button is making a binding contract, just like putting an item up for sale. If you don't have the item, you can't sell it. Seems like standard merchandising 101. NP: Oceansize: Frames

Next.

Previous.