Posts tagged ‘free software’

I’ve been working on enum again recently and got completely stuck in getopt_long() return values. I don’t want to bore you with details, so let me cut to the chase: I needed a way to look into what getopt_long() is actually doing.

Now, there are a few ways to figure out the doings of a function. If it’s your own code, you could just go ahead and add a few printf()s to see if your variables fill up as intended. Then you could use gdb to walk through your running code. But what if you want to do so in functions outside the scope of your own code? In my case: getopt, i.e. libc?

Obviously, you can download the library, add your printf() stuff, compile and install it, and see it all happening. But libc isn’t exactly small, fast-compiling, and you really don’t want to mess it up and have it installed on your system. So how about just taking what you actually care for and push it in? This is nothing experimental or particularly “hacky”. I just don’t want to forget about it and maybe someone can make use of it. So here we go…

Download your libc sources to a new directory and copy the files you need. Try something like

mkdir -p /tmp/getopt/mygetopt
cd /tmp/getopt
apt-get source eglibc
cp eglibc-*/posix/getopt* mygetopt/
cd mygetopt

Now write up a primitive Makefile:

all: libmygetopt.so

libmygetopt.so: getopt.c getopt1.c getopt_int.h getopt.h
	gcc -shared -Wl,-soname,libmygetopt.so.1 -fPIC -o libmygetopt.so.1.0.0 getopt1.c getopt.c
	ln -s libmygetopt.so.1.0.0 libmygetopt.so.1
	ln -s libmygetopt.so.1 libmygetopt.so

clean:
	$(RM) libmygetopt*

In order for this to actually work, I fiddled around with a few #ifdef’s in getopt.c. But that’s something you’ll probably find out yourselves. You should at least be able to compile it (‘make’ it). Now put a printf statement somewhere in the function you want to inspect. Recompile the lib and then go back to your actual program.

Running the program ist easy.

src/enum -p1 1 3
1.0
2.0
3.0

Surprisingly, running it using your own getopt version is just as easy. Just push your library in:

LD_PRELOAD=libmygetopt.so LD_LIBRARY_PATH=/tmp/getopt/mygetopt:$LD_LIBRARY_PATH src/enum -p1 1 3
Yo, Ulrich, my getopt version is waaaay cooler than yours!
Yo, Ulrich, my getopt version is waaaay cooler than yours!
1.0
2.0
3.0

If you’re disappointed now, that’s your own fault. I said it in the beginning, this is nothing special. It’s not my idea. It’s something that developers all use all the time … or something like that. In case you didn’t know about it, good for you. Otherwise, sorry for reading my memory dump.

Since there have been a few blog posts about GNOME 3 already, I’m sure you don’t mind me adding one. I’m one of those who don’t do any work, just lurk around and wait for stuff to be fixed — or working in the first place. I also don’t like compiling GNOME myself. I barely touched the already packaged stuff in the repository of our Debian GNOME packaging team. But I run unstable plus stuff from experimental. I’ll thus have a bit of a different experience with GNOME 3 than current testing users who at least in parts don’t seem to like what they’re getting.

That being said… I love it.

No, I don’t mind running network manager on my systems, I even have it on my netbook (Atom processor). I used wicd for a long time because network manager really got nothing done back in the days (half a year ago or what :)). Nowadays, since version 0.9, it works fine for me. No fiddling around with config files, perfect integration in the desktop, and LAN and WLAN Just Work [tm].

No, I don’t like if some weird dependencies dictate what tools to use. I usually used pidgin for messaging, for instance. Now I’m using empathy, simply because it’s best integrated in GNOME. And no, I won’t switch from mutt to evolution. :-P

And there are more such cases. Also, these weird accessibility tools that are stuck in the gnome-shell “top panel”, I don’t need them. Still there. (There’s an extension to remove it, by the way.) Also, I must say, GNOME 3.2 is a lot better than 3.0 already. And I think 3.4 might do the final trick for me.

Fact is, with GNOME 3 I have a much cleaner desktop, there is more room for windows (which is nice on a netbook display), there are web apps which I already use a lot, and it has a professional, not too playful look (i.e. a few effects, clear and consistent theming, no bubbling windows). And the new notification stuff is just awesome, especially with the empathy integration.

Oh, and too many mouse click to access an application? 1) Put your most used apps in the favorites bar (or whatever it is called); it’s just one click then. 2) Press your meta-key (that way our name for the windows key, or was that the ESC key? Whatever, press your windows key), type in the first two or three letters of your application, and hit enter; you don’t need a mouse at all.

There. It had to be said. :)

It’s the time of the year again. LinuxTag is right up and, of course, Debian is part of it. But, it wouldn’t be us if we didn’t have any problems at all. Well, the situation isn’t real badâ„¢ but could deserve some improvement. Improvement about what, you ask? Isn’t that obvious? It’s man power that we need (women shall feel included :)).

Now, LinuxTag 2011 is going to happen, with or without you, on May 11th to 14th. Needless to say that you’ll be missing quite a lot if you don’t attend. I mean, even Zack will be there. And so will I (most probably at least). And even more… Who’s willing to miss that, really? So, pack your stuff, get a train ticket or your car or your friend’s car or the car of a friend of your friend who knows a friend who doesn’t know you but still wants to give you his car which you don’t even need since you already have the car of that friend of your friend and now you have two cars and can even bring another bunch of fellas who probably own cars themselves and now you’re thinking about the environment because of all the cars that will come to Berlin and because of that you suddenly buy a train ticket and leave all three cars at home… and in the end only one thing counts: you’ll be there. Oh, and before you drive off to your local train station, please put your name into our neat little list so we can count on you as booth staff — that’s because we need man power in case you missed that section or somehow forgot it while thinking about that guy who is the friend of your friend that owns a car but rather comes by train as it saves the environment.

Been playing with that thought for a while now, finally got to rebuilding it for lenny, now I’m using it… tmux is the new screen. To have fun already I read a few short introductions and got myself a few suggestions for a proper .tmux.conf. So, for root I have this one now:

# Copy mode
unbind [
bind Escape copy-mode

# Use Vi mode
setw -g mode-keys vi

# Make mouse useful in copy mode
setw -g mode-mouse on

# More straight forward key bindings for splitting
unbind %
bind | split-window -h
bind h split-window -h
unbind '"'
bind - split-window -v
bind v split-window -v

# History
set -g history-limit 4000

# Terminal emulator window title
set -g set-titles on
set -g set-titles-string '#S:#I.#P #W'

# Status Bar
set -g status-bg black
set -g status-fg white
set -g status-interval 1
set -g status-left '#[fg=green]#H#[default]'
# no line break here, it's just to long for my blog layout!
set -g status-right '#[fg=yellow]#(cut -d " " -f 1-4 /proc/loadavg)#[default] #[fg=cyan,bold]%Y-%m-%d %H:%M:%S#[default]'

# Notifying if other windows has activities
setw -g monitor-activity on
set -g visual-activity on

# Highlighting the active window in status bar
setw -g window-status-current-bg red

# Clock
setw -g clock-mode-colour green
setw -g clock-mode-style 24

# Create a default session
new -n htop -d htop
setw -t htop monitor-activity off
neww -n aptitude -d aptitude
neww -d

Then I added a new alias to my user’s zsh config:

alias root='su -c "tmux attach"'

Why ‘tmux attach’? Because tmux would start a new session which I don’t want it to. The config already starts a session which we can immediately attach to. Also, when such session was started I can attach to it as a user with the very same command over and over again. That makes it pretty handy as I always have htop, aptitude and a free shell available in a nice tmux session. Great. How did I live until now? ;-)

Good morning everyone,

after quite some time of organization, we got the MiniDebConf running in Berlin. Yesterday at 9.30, Zack had the pleasure of opening the event which seems to be reflected in the press already. After that, we had nice talks, one every hour from 10 to 6 with mine being the last one of the day at 5 p.m. Yes, I did it :) Slides, links, and all that stuff will follow in a later post, or more official announcements. Right now I’m preparing myself to get back to the fairground. The second day starts with another bunch of talks at 10 and I’m excited to meet different people again and hear more interesting talks.

The BSP went… well. :) Actually, we didn’t really fix many bugs, I guess. A few maintainers stayed after the event as well as a couple of users completely new to packaging. Thus, it was more like a small social event bit it was really fun. And of course the HackLab is still open today, so we have every chance to fix more bugs…

This just as a small input from where we stand. More is to come some time later, probably after the weekend, we’ll see…

When I first started using Free Software — yes, that’s quite some time ago — I found it the right thing to do. It felt like I was first time ever really controlling what my computer does. Took just a bit of time to notice I really never knew anything about it. Well, almost at least. Then when I started contributing to Free Software this obviously changed. One of the freedoms is to learn from the code you’re running. And I did it… by reading, contributing, doing nonsense with it, reimplementing it… you know the deal.

Starting to work on Debian was something that just evolved out of it. Doing so gave me the opportunity to give back. I never achieved that actually, though. At least I don’t consider my contributions even remotely sufficient to make up for the great deal of software that I use — sometimes without noticing it. Still there’s lots of stuff that I don’t have a clue of and I rely on other developers to do their (volunteer) job. Otherwise my knowledge wouldn’t help much. I could never continue kernel development if those kernel hackers all stepped back for instance. I guess, it’s getting more and more difficult the closer the piece of code is to hardware.

Another thought I had was about Free Software in general. It’s more than just the code (although it might be the most important part), it’s also a concept that needs to be communicated. Firefox on Windows shows how Free Software can have a big market share in an otherwise closed source environment. Yet I’m not sure all users know about it being open source and what that means (hear them talk about Freeware instead). And who is dealing with this conceptual stuff?

I decided to do something about all that. Now I don’t really have money but a bit I thought I could share. And I could set yet another sign by publicly talking about it, or casually mentioning that I consider Free Software and Linux a good thing. So you will see a mail signature now below all my mails. I always wondered what one might gain with such and now I found a reason to include one. It reads:

Debian Developer                                 www.debian.org
Member of the Linux Foundation                    www.linux.com
Fellow of the Free Software Foundation Europe      www.fsfe.org