git rocks even when it sucks

Posted in debian, english, linux, planet-debian, software December 3, 2011

Today I wanted to clone my dotfiles repository (no, not available online, too much private stuff in there) to a remote machine and noticed that it has grown way too big (20MiB working directory and about 200MiB in .git), so I decided to clean it up.

git gc did clean up a couple of megabytes, but .git was still about 190MiB, so I wasn’t satisfied. Short thinking revealed the “lost” megabytes are somewhere in the history when I accidentally added some files and removed them afterwards (iceweasel, icedove, it’s you I’m blaming ;)). But how the heck do I find and remove them?

git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch FILE' -- --all will remove FILE from all commits, says git-filter-branch(1), but how to find those files? They are not in my working directory anymore and I do not want to checkout every revision and look for big files in there. Let’s ask git itself :)
for commit in `git log --all --pretty=format:%H`; do git ls-tree -r -l $commit; done |awk '{print $4 " " $5}' |sort -nu will show all files (actually all versions of all files) ever known to git, with the biggest ones at the end. Just identify the really big (unused) ones and remove them as above, thats what you think, right? Right, but .git won’t be any smaller. Huh? Read git-filter-branch(1) again, just create a clone and it will be smaller, so mission accomplished! Now I had just 6MiB to push (compressed). For reference, the old tree would have used something about 150MiB to push.

flattr this!

Desktop in a shell: mutt with multiple IMAP accounts

It’s been a long time since my last post about my “desktop in a shell“, but today I stumbled over something absolutely awesome I want to share with you.

A bit of background: I am using mutt with a single imap server (where everything is forwarded to), because I disliked the idea of having multiple mutt instances running and did not want to play the “<change-folder>imaps://other.server.tld/<enter>” game too much.
Now today I had to delete some mail from an account I don’t use regularly (and where the webmail sucks), so I switched my screen to mutt and actually did the <change-folder> game and was like wow… because the account showed up in my sidebar and I could just jump between the folders of both accounts.

So I thought how to automate this, so I could actually use mutt with multiple accounts (without offline-imap and friends, which is what you find on the web).

It’s damn easy:

# muttrc
set imap_user=account1
set imap_pass=password

set folder="imaps://imap.one.example.com/INBOX"
set spoolfile="imaps://imap.one.example.com/INBOX"

...

push <change-folder>imaps://account2@imap.two.example.com/<enter>

Well, what does this do? It advises mutt to use imap.one.example.com, but then just jumps to imap.two.example.com at the end of the config, resulting in both accounts being loaded into the sidebar and usable. That’s it, one line and it is awesome!

Please note, the password to both accounts is the same, you will have to fiddle around and put it in the URL somehow if it differs.

flattr this!

the fairy tale of the UNIVERSAL serial bus

Posted in debian, english, fail, hardware, linux, planet-debian, uni August 30, 2011

So I own some machines with that Universal OS on them and had to create a bunch (300) identical USB-keys (with the not so universal daughter OS).

Doesn’t sound too complicated, huh? Buy 300 USB-keys, create one by hand, dd that over the 299 others. To make life easier, add some USB-hubs to the mix. Well, I will drop the part how to use dd to make identical copies of USB-keys and just list the lessons learned:

  1. The regular USB-key is some millimeters wider than a standardized USB-plug and almost all manufactors of USB-hubs place the ports in a way that there is exactly no space between the plugs. Yes, that means that you cannot plug two USB-keys in two neighboring ports of the hub then.
  2. There is NO way to get a USB-hub for below 10€ here in Düsseldorf, and if you do…
  3. HiSpeed USB 2.0 does NOT mean the hub will actually work as a USB 2.0 hub with 480Mbit/s, but as USB 1.1 with 12MBit/s
  4. If you happen to own a Cherry keyboard with an integrated USB hub, it’s most probably USB 1.1 too :/
  5. When you buy 300 USB-keys, don’t expect them to be identical, about 100 of them are 3MiB smaller than the other 200, and we created the initial image on one of the “big” ones of course.
That’s all for now: </rant>
Thanks go out to Transcend, K&M Elektronik, some cheap chinese USB-hub manufactor, Conrad Elektronik and MediaMarkt.

flattr this!

when mdadm is too fast for the kernel…

Posted in debian, english, hardware, linux, planet-debian July 19, 2011

… you have to put options scsi_mod scan=sync somewhere in /etc/modprobe.d/ and regenerate the initrd.
(thanks to Michal Ludvig in http://lists.debian.org/debian-boot/2010/11/msg00369.html)

Just happened to me on my Sun Netra T1-200 after the upgrade from Lenny to Squeeze, which threw me back into busybox of the initrd when it could not find the root-fs (on raid) and where mdadm -A /dev/md0 worked just fine to confuse me.

flattr this!

signing data inside your browser?

Posted in english, planet-debian, security, software June 30, 2011

Let data be textarea->value and browser be (firefox or chrome).

I want the user to be able to sign the data he entered in the textarea as I do not trust the website to store the data without modification.

So far I found a couple of GnuPG/PGP based solutions:

Didn’t test any of them yet, so I am asking you, dear Lazyweb: are these any good? Are there any more such tools? What about X.509 client certificates? Can I abuse them for signing in the browser too? So far I found login stuff only. Pointers highly appreciated.

flattr this!

monitoring Adaptec RAID controllers in Debian

Posted in debian, english, hardware, linux, planet-debian, software June 23, 2011

So I got my hands on that new machine, somewhere, somehow, and I had to make myself comfortable on it. The biggest difference in that machine and the ones I used before is the RAID controller, an Adaptec 5405, instead of the 3ware ones I used to have before. That means getting used to new tools, messages and all these things which I’ll try to document here.

Step 1: does vendor deliver?

Well, yes, mostly. There is (mainline) kernel support for the controller, Squeeze’s kernel will boot up just fine and I just throw my junk into /dev/sda and it will handle the whole raidy thingy itself. But what is when I want to check the health of the disks, to add a spare or modify the caching? Ask the mighty vendor and it will answer “Yes, you can!”.

So I downloaded that asm_debian_x86_x64_v6_50_18570.tgz, unpacked and faced two debs, one i368 and one amd64. Yes, you could have saved half of the bandwidth if someone would have asked for the arch before, but who cares for some additional 60MiB today? So let’s see what it does. Oh no, wait, there is a READMEASM_IUG_for_Debian_and_Ubuntu.txt:

1. Make sure to be in root level access.
2. Install the ASM storman .deb package. For example, if the package is storman_6.50-18570_i386.deb,
   then install it using the following command dpkg -i storman_6.50-18570_i386.deb
3. Adaptec Storage Manager will get installed at /usr/StorMan
4. Add the line /usr/StorMan to /etc/ld.so.conf. Then run "ldconfig". This is needed for the arcconf
   utility to find the path of the libstdc++.so.5 library

Well, 1 is obvious, so is 2.
For 3: hum, /usr/StorMan? Ever heard of FHS? Don’t think so.
For 4: WTF?! I prefer to get libstdc++5 from my local Debian mirror instead.

But at least they provide a .deb, right? Uhm, no, it’s an RPM converted via alien :( And don’t dare to look at preinst, postinst and postrm (it extracts an own copy of Sun JRE 1.6u16, chmods around wildly on install and does rm -rf something on uninstall, did I see that some days ago on the webs?). Let’s get rid of that package as soon as possible, I decided, and just keep arcconf (which will be described later), esp because StorMan itself seems to include some call-home functionality which I’d like not to have:

cp -a /usr/StorMan/arcconf /usr/local/sbin/
apt-get remove --purge storman

Step 2: does community deliver?

You can, by the way, get (better) packages at http://hwraid.le-vert.net/wiki/DebianPackages from Adam Cécile (Le_Vert). I didn’t test those much, but I currently use the arcconf package from there, which seems to be exactly what I need: proper dependencies and just the arcconf binary, no Java sh*t.

Step 3: monitor the controller

As this post is about monitoring, not ranting, let’s continue. As mentioned before, I only have arcconf installed, which is just a cli to do stuff with the controller. If I understood the docs right, the actual StorMan is able to send notification mails when a disk dies or the controller gets eaten by aliens, but as I don’t have StorMan, I have to do things myself.

Adam has a aacraid-status package in his repository, which includes some minimalistic shell-daemon to monitor the output of arcconf. It didn’t perfectly fit my needs (and had some hickups with my disks which refuse to report a vendor, whyever), so I decided to write something myself (slightly based on what Adam has done in aacraid-status, though).

The result is on GitHub: https://github.com/evgeni/aacraid

As you can see the code contains (at the time of writing) exactly ZERO comments and there is no README either, but it’s actually quite usable already.

  • aacraid.py is the main magic inspired by Adam’s aacraid-status, basically just parsing arcconf output
  • aacraid-status prints all useful info about all controllers, arrays and disks (the output is pretty much like Adam’s)
  • aacraidd is a small daemon which will monitor all controllers every (per default) 5 minutes and mail you in case of status-change

I am now running aacraidd and get happy mails when something breaks :) [running = running from /etc/rc.local, no init script yet :)]

Step 4: monitor the disks via smartmontools

There is one little problem I have with arcconf: it’s closed source and does magic to the controller.

With the old 3ware controller I was able to monitor the disks with smartmontools/smartd using something like this:

/dev/twa0 -d 3ware,0 -a -s L/../../2/01 -m root
/dev/twa0 -d 3ware,1 -a -s L/../../2/03

This is possible with Adaptect controllers too (not through /dev/twaX obviously). You have to have the sg module loaded, which will result in /dev/sg[012] on my machine, with sg0 being the controller itself and sg1/sg2 the both disks attached to it. Having sg loaded, one can now use smartd with:

/dev/sg1 -d sat -a -s L/../../7/01 -m root
/dev/sg2 -d sat -a -s L/../../7/02 -m root

(-d sat is the important option here!)

Thanks to Thomas Krenn Wiki: Smartmontools mit Adaptec RAID Controller for the basic info and ostlogd.spenneberg.net: Adaptec-Raid-Controller S.M.A.R.T.-Healthstatus monitoren for the pointer to the sg module!

Step 5: relax

Yupp, 4 steps are enough, go relax until the next disk dies (you will be doing something REALLY important that moment according to Murphy).

flattr this!

Debian/Ubuntu Games Team Meeting #4

Posted in debian, debian-games, english, events, planet-debian June 20, 2011

Yupp, it’s this time of the month again! Rhonda has already spammed about it, but I think repeating won’t hurt: the next (4th) meeting of the Debian/Ubuntu Games Team will be held in #debian-games on June 26th at 10:00 UTC.

  • What: Debian/Ubuntu Games Team Meeting #4
  • When: 26.06.2011, 10:00:00 UTC
  • Where: #debian-games on irc.debian.org
  • Who: YOU!

The agenda is (as usual) listed in the wiki. This meeting will be moderated by Arand Nash.

As I won’t make it this time, I wish everyone a nice meeting and good results!

flattr this!

I’m going to DebConf11 and Wacken2011

Posted in events, planet-debian May 29, 2011

I'm going to DebConf11Yes, you will see me in Banja Luka. This will be my first DebConf, but I have a strong feeling it won’t be the last one. I hope to see some productive sessions in pkg-games and pkg-ayatana, nice people and a lot of fun in a nice country.

I will travel with ICE 729 from Duesseldorf to Munich and EN 499 from Munich to Zagreb on the 22.07.2011 and return with EN 498 and ICE 728 on 31.07.2011.

To make things louder, I will go to Wacken from 02.08.2011 until 07.08.2011, wonder to see some Debian people there :)

flattr this!

Debian/Ubuntu Games Team Meeting #3

Posted in debian, english, events, linux, planet-debian May 28, 2011

As it hasn’t been announced on planet yet, I’d like to invite you to the thrird Debian/Ubuntu Games Team Meeting on May 29th (yes, tomorrow!) at 11:00 UTC in #debian-games.

  • What: Debian/Ubuntu Games Team Meeting #3
  • When: 29.05.2011, 11:00:00 UTC
  • Where: #debian-games on irc.debian.org
  • Who: YOU!

The agenda is listed in the wiki and Kamping_Kaiser will try to stick to it (not as I did the last meeting).

So see you tomorrow 11:00 UTC in #debian-games on irc.debian.org!

 

flattr this!

playing sick games (RC-bugs 2011/18)

Posted in debian, english, linux, planet-debian, software May 9, 2011

I’ve been a little sick the last days and decided to be productive instead of just drinking tea all the time.

The result are some (10) squashed bugs from pkg-games, and one long standing nmu.

adonthell

#624998 LP#765984
FTBFS: py_adonthell_wrap.cc:27357:44: error: taking address of temporary [-fpermissive]
Patch by Peter De Wachter, I just had to sign and upload.

alex4

#624884
FTBFS: stat.h:106:22: error: expected identifier or ‘(‘ before ‘[' token
Include defs.h *after* particle.h, thus not redifining __unused from glibc's bits/stat.h

fenix

#554286 LP#770962
FTBFS with binutils-gold
Fixed since 0.92a.dfsg1-6, bug closed. Found different FTBFS though, fix uploaded as -9.

freeciv

#554411
FTBFS with binutils-gold
Closed after verifying that it is fixed since at least 2.2.1 as upstream wrote.

kball

#624978
FTBFS: src/gamemenu.cpp:224:52: error: 'mkdir' was not declared in this scope
Include sys/stat.h in 06_homedir_game.patch and 07_homedir_editor.patch.

kiki-the-nano-bot

#625047 LP#770970
FTBFS: ../src/../SWIG/KikiPy_wrap.cpp:13045:63: error: taking address of temporary [-fpermissive]
Patch by Peter De Wachter, I just had to sign and upload.

late

#624937 LP#770857
FTBFS: ball.h:113:19: error: ‘NULL’ was not declared in this scope
Include stddef.h in ball.h to define NULL.

libclaw

#625038 #624919 LP#770805
FTBFS: avl_base.hpp:137:15: error: ‘ptrdiff_t’ does not name a type
Patch by Julien Jorge, I just had to sign and upload.

liquidwar

#555468
FTBFS with binutils-gold
Patch by Stephen Kitt, I just had to sign and upload.

lordsawar

#555564
FTBFS with binutils-gold
Closed after verifying that it is fixed since at least 0.1.8

xnecview

#621392
FTBFS on armel: expected identifier before numeric constant
R0 is already taken as a register name on armel, rename xnecview’s constant to DEFFAULTR0. (Patch basically stolen from Ubuntu)

flattr this!