bartman's blog

git-graft and git-find brainstorm

I want to be able to take a bunch of patches that were applied to one semi-related branch and appened them to the current branch, or better yet a new branch of the current. The bunch of patches will be selected by what they change; I should be able to graft all patches that modify some file, or modify some regular expression. Here is what I mean: ,-----X---X---X---X--- ... --- "historical" branch o `--------------------Y "current" branch \ `---Z---Z---... "working" branch You start off at current branch and run something like: git-find historical --file some_file.c --or --re 'some pattern' \ | git-graft --new-branch working - This will let me take the interesting subset of X commits and apply them at some point Y. Should the patches X cause conflicts with the current branch, then git-graft needs to let the user resolve those conflicts a patch at a time. The default is to apply onto the current branch, however if desired it should be possible to create the changes on a new, working, branch. The result is a new set of Z commits, as shown above.

pretty function tracing

I wanted to see how different functions got used in a block of code that I was new to… and was having a hard time understanding. My UML instance was acting flaky and didn’t cooperate with gdb, so I could not single step the code. I added a small chunk of C code to generate pretty tracing that looks like this: ,-< ipsec_sa_wipe:946 | ,-< ipsec_sa_put:549 | `-> ipsec_sa_put:561 = 0 `-> ipsec_sa_wipe:1054 = 0 Functions can nest upto 25 times (arbitrary max) and after that it stops indenting nicely. The code has to be modified so that at the entry of each block there is a call to the IN macro, and on the exit to the OUT macro. Here is an example:

uml and multiple network segments

I am doing a lot of network testing and require multiple virtual networks created for my UML’s. Debian’s uml-utilities package does not currently support bringing up multiple network segments, although the uml_switch daemon can be ran multiple times. In such a setup each uml_switch is associated with it’s own tapX device and maintains one network segment. I modified two files: /etc/init.d/uml-utilities /etc/default/uml-utilities And filed bug 378166.

lastfm artist and title to clipboard

Sharing your current [last.fm]{tag/lastfm} track on irc in realtime is very important. :) Here is a ion3 binding that will use xclip to copy the current track info into the X clipboard. defbindings("WScreen", { kpress("Mod4+grave", "ioncore.exec('echo player/currentlyPlaying | nc localhost 32213 | xclip -i')"), }) Put it in ~/.ion3/cfg_user.lua.

reverting a git changeset

I accidentally committed a changeset without a description and wanted to fix it. As I was pushing enter I realized that I didn’t want to commit yet. I have not pushed anywhere – an important requirement for this kind of revert. I basically want to do a bk fix -c (if I recall my bk correctly). Since git revert pollutes the history, it is not the right thing to do here since the bad changeset was not pushed. But it would be the right thing to do had I pushed my change.

user #3

Wow! vimblog has a new user. Welcome, Eugene, to the world of [vimblog]{tag/meta} :)

firefox crashes with form input

I ran into a strange bug with firefox locking up each time I pushed a form submit button. When I ran it from the console I had an endless stream of: mork warning: unexpected byte in ReadContent() mork warning: unexpected byte in ReadContent() mork warning: unexpected byte in ReadContent() mork warning: unexpected byte in ReadContent() mork warning: unexpected byte in ReadContent() mork warning: unexpected byte in ReadContent() mork warning: unexpected byte in ReadContent() mork warning: unexpected byte in ReadContent() Googling for it revealed an intresting thread which dates this bug to firefox 1.0. Grr.

git vs hg

After working almost exclusively with git for a few months, I had to do some work on a freebsd kernel. The freebsd kernel is maintained in mercurial. I noticed right away a few features that I have started to take for granted with git.

ldap account management

Ok, so in [last eppisode]{ldap-upgrade-to-2.3.23-brakage} we looked at how my Debian/testing upgrade of slapd killed my slapd install because I was using two incompatible schemas. Now, I will show you how to limit what accounts are accessible to pam_ldap module on each host.

stupid ldap

For some very stupid reason I decided to upgrade my fileserver, which happens to run my ldap database as well. Setting up slapd (2.3.23-1) ... Backing up /etc/ldap/slapd.conf in /var/backups/slapd-2.2.26-5... done. Moving old database directories to /var/backups: Backup path /var/backups/dc=jukie-2.2.26-5.ldapdb exists. Giving up... dpkg: error processing slapd (--configure): subprocess post-installation script returned error exit status 1 Errors were encountered while processing: slapd E: Sub-process /usr/bin/dpkg returned an error code (1) Frig!