Archive for the ‘Gentoo’ Category

stats.larrythecow.org — what’s installed on your box?

Friday, November 7th, 2008

I’m trying to build a database of what packages users have installed on their machines. I’ve been wanting to do this for a while. I think it would help out in a number of places, like before considering what packages to remove.

Here’s the webpage which gives all the details: http://stats.larrythecow.org/

If you just want to cut to the chase though, and upload your statistics, you’ll need curl + eix or portage-utils.

Here’s the quicky:

curl -d "arch=$(uname -m)&packages=$(eix -I ––only-names)" http://stats.larrythecow.org/

or

curl -d "arch=$(uname -m)&packages=$(qlist -CI)" http://stats.larrythecow.org/

Thanks guys. I’ll make a prettier page once I have some actual data and something worth sharing.

Edit: Sorry about some of the characters, wordpress was messing them up.

pimp my mythvideo: coverfiles made simple

Monday, October 6th, 2008

his being my third patch to fix some mythvideo nags, I’m actually starting to get comfortable going in there and trying to find this stuff. It’s still incredibly difficult to try and figure this out, since there’s little documentation and I vaguely understand C++, but it’s fun to attempt and cool to succeed.

This patch fixes an annoying problem I’ve had for a long time — it’s a royal pain setting a cover file for a video. A cover file would be the actual image that shows up in the gallery view for a media file. Without one, you just see a blank little icon which is pretty boring.

Folders are really simple — you just add folder.jpg (or .gif or .png) to the directory, and it will show that. Individual files are a bit tricker. If you were just using the interface, you’d have to first go into the Video Manager to let Myth scan the directory of files, create an entry in the database, then go find the file, edit the entry, and set the coverfile manually.

I originally wrote a script to do that part for me. I would just create a JPEG image for each media file, usually with the same filename, but a different extension, and code in a check to see if both exist, update the videometadata table. All the time, I kept thinking though, it would be so much simpler if Myth would just check to see if the file existed like the folders, and display it. That’s exactly what this patch does.

I pretty much just copied the same code from the part where it looks for the folder icon, and did the same thing. If, for example, you have movie.avi, just create movie.avi.jpg (or .gif, or .png) as the coverfile and you’re done.

Actually, you do have to put the file in the database first, since it still checks to see if there is any metadata for it at all. That is extremely simple, though, either by script or UI navigation. The UI will just add new ones quietly, and you can quickly exit out. The patch will still use your coverfile in the videometadata table too, if there isn’t a similar filename that it can find, so you can apply this and it won’t break your existing setup.

As usual, the ebuild is in my overlay. This one is mythvideo-0.20.2_p15087-r3.ebuild. I’m going to eventually document these a bit better and file bugs with upstream. I know I’m using an “old” version to patch it onto, but the reality is that SVN hasn’t changed at all since that revision, so even the latest version bump is the same code.

I also spent the weekend working out a number of small kinks in my system and setup. I drafted up a new “wishlist” that I have of stuff I’d like to eventually get fixed, and it’s getting smaller all the time. Right on.

As far as mythvideo patches, though, I only have one last small annoyance that, while it doesn’t really bother me, does kind of throw me for a bit of a loop so I’d like to see if I can fix it. The bug is that folder names and file names are sorted differently. I can’t remember which is which off the top of my head, but one of them will ignore prepositions like “The”, and “A” on the front of titles and sort by the second words. So “The A-Team” would show up near the top of the list. Maybe it does that on both file and folder. Anyway, I don’t like it. It’s a bit confusing. I tried looking for where it does that, but I haven’t had much luck yet.

planet larry google search

Wednesday, October 1st, 2008

Planet Larry has kept archives of posts for about five months now, but I just barely added a Google search form to the side nav so you can … uh, search.

It would be nice to have the archived pages put the dates in the title tag, but looking through the Venus code I couldn’t really see a quick way to do that, so meh.  I could probably just write a quick sed line to fix it when its archived, I suppose.  I’ll look at it later.  Or let someone else figure it out for me. :)

Oh, also, just a reminder, Planet Gentoo stores archives as well, though there’s no index page or search index yet.  Another item on my long to do list.

playlist resume

Wednesday, October 1st, 2008

I wrote about this a little bit a while back, wrt mplayer-resume, that I wanted to work on a way to resume playback from a playlist as well using MPlayer. Well, I finally sat down and figured it out last week. For some reason it took me a good while to figure out the logistics of how to do it rather than the coding. I dunno why. Anyway.

I wanted to wait to bump mplayer-resume until after I added something else, and this is gonna be it. Just gotta clean up the code and package it now, and it’ll be ready to go.

Here’s how it works though: the script, like mplayer-resume, acts as a wrapper to mplayer. In fact, everything is pretty much the same except that it saves both the filename along with the position in the playlist.

The problem I was having a hard time figuring out was that I wanted to easily make two options available: resume playback in the current file I’m in (old mplayer-resume functionality), and resume playback in the position in the playlist I’m in. I just finally mapped two keys on my remote, exit and stop, to take care of both of them.

Hitting Exit on my remote will save the playback of the current file and write that to the playlist position file. Then it also saves the seek time where I left off. Hitting Stop will kill the old entry and just add a line to the playlist saved position file that says what the *next* file should be on playback.

Pretty simple when you consider it, but it took me some time to figure out, mostly so that it seemed intuitive. I figured I’d have a hard time getting used to it, and hit stop accidentally and losing my place where I wanted to be, but so far it’s worked out fine. I’m happy with it.

I’m using it for playback of my TV shows, which is pretty much 95% of what I’ve got ripped on my media setup. I have a few movies, but no AC3 output, so I prefer to just stick those in my DVD player. It is the only way I can watch my Region 2 or 4 DVDs though. For TV, it works great, since I generally want to watch them in general succession of episode order. And if I don’t feel like watching a certain episode, you just hit stop and it’ll skip to the next one. Very nice. I suppose I could map a button to go *back* in the playlist if I screw things up accidentally, but I’m kinda running out of buttons to map on my remote. Besides, vague mappings that I’m supposed to remember usually hurt more than help.

gpnl and packages todo

Wednesday, October 1st, 2008

I spent all last week working really hard on getting my MythVideo setup all cleaned up (and I still need to write a post or two about some new stuff), and moving next in my todo list, getting GPNL and the Packages websites back up to speed is my next goal.

The thing is though, I haven’t worked on this in so long, I can’t really remember what it is I want to do.  Sure, I have a bug tracker, but if there’s anything anyone thinks should take priority (on the list or not), lemme know.

I only really have three main things on my plate:

- robbat2 showed me how to access portage metadata directly instead of using the SQLite module + backend, so I wanna switch over to using that (attempt #3 at accessing portage data, whee!)

- Need to start checking for EAPI 2 usage in ebuilds.  I have no idea what will happen right now, which means it’ll probably break things.

- Make displaying the ChangeLogs optional on the packages site.  Man, that gets in my way.

Oh, and note to self — also want to get aliz’s old stable candidates website back online.

gentoo’s growth

Tuesday, September 23rd, 2008

DistroWatch has yet another “the sky is falling” post about Gentoo, and, going against habit, I’m going to comment on the situation in general.

I see a panicked argument on the threads every now and then that Gentoo is dying because of a lack of manpower.

Well, I’ll concede that as a distribution, we can use more volunteers. On the flip side, try to name one open source project that couldn’t benefit from more contributors. So in that case, we are no different.

One simple thing that I’ve realized lately is that the whole “foo is dying” argument rests on one arbitrary assumption: that a project has some standard of manpower that it needs to meet, and if it isn’t, it’s falling short. With that principle in mind, I don’t think Gentoo has ever been “dying”. It’s always been either growing or shrinking in strength, but dying implies that it’s not meeting up to its designated standard. The thing is, there is no standard.

Once upon a time Gentoo would have been just a brainchild idea by one person (Hi, Daniel), and grown from there. Was Gentoo equally dying when it lost maybe one developer among the five that were working on it? My question is basically this — where is the peak that we should constantly be comparing ourselves to? Is every record for growth our new standard? If you manage to get a 42 inch waist and gradually lose 10 inches, does that mean you’re dying? Sure, you can’t meet your same capacity as in the past, but that doesn’t mean you’re going to up and disappear.

The nature of any project — software, community, corporate, whatever — is that people come and go. People get burned out, want to move on, do something else. I would never be happy working on the first job I ever got, and by the same token, I don’t see myself working on Gentoo forever for the rest of my life.

Experience on my part has shown that while a group of users may unitedly cry the mantra whine that Gentoo is dying, individually, the reason is never universal. It all comes down to the the perception that it’s falling apart because one or a few small parts of what they want supported no longer is. Just because one popular desktop manager isn’t in the tree, does that mean that the collective work of every other developer is worthless? That’s an awfully short stick to measure by.

I’ve always been positive and optimistic about the future of Gentoo. One thing, more than any, I’m certain of, is that even should the distribution collapse in on itself and completely go away, the idea will never die. Gentoo has too many original ideas swirling all around it that will live on even if the primary project doesn’t.

planetlarry.org

Friday, September 19th, 2008

I don’t know about anyone else, but everytime I want to go Planet Larry, I still type in planetlarry.org, even though I ditched the domain a few months ago.

Well, I got tired of it not working, so I re-registered it, and it redirects once again as normal.

Also, we can always use more bloggers — if you have a Gentoo blog, lemme know about it, and we’ll get you added.  It’s a very informal process, just send me an email with your blog URL and stuff.  Now that I think about it, I really need to catch up with all the new Gentoo devs and get them on Planet Gentoo as well. Slack…

Finally, I decided I’m going to create a feed specifically for ex-developers, but since I’m too lazy to go out and find their blogs (and I don’t think I still have an old copy), if you guys could send me your info, that would greatly help to speed things along. Update: It’s too much work to create a separate feed, so I just put them back in the main feeds. Now, behave. :)

And here’s an image just because this blog post is so boring, it needs one.

pimp my mythvideo: another navigation patch

Friday, September 19th, 2008

I’ve been working on a bug all night I noticed the other day that really annoys me in Myth, and I stayed up poking at the code trying to find a way around it. Actually, it’s a little weird how I “discovered” it, since I always perceived in the back of my mind that there was something annoying, but never pinpointed it specifically what it was doing until this week.

The bug is this: when you are using gallery view in MythVideo and you enter a folder, when you exit back to the main root menu, it repositions that folder at the top, regardless of where it was when you entered the folder.

Some pictures will probably make more sense.

Here is a screenshot of what my folder display looks like when I enter MythVideo’s gallery for the first time, and browsing for a folder to select:

 

Now, when I select that directory, I’ll see the files in there. But when I hit Escape or select the previous folder icon, it will return me back to the root menu. However, the folder layout has changed, and the row that the folder is on, originally the bottom, is now at the top.

 

 

Moving around the position of the folder layout throws my brain for a loop every time it happens, because I’m expecting to see the same display as when I was just in there, and since it’s different I have to rescan the layout visually and reprocess where I am and where I want to navigate.

This patch fixes that, and keeps the layout the same when you return to the root window.

I went ahead and added a new ebuild in my personal overlay which will install it for you if you don’t want to patch it manually. The ebuild is mythvideo-0.20.2_p15087-r2.ebuild and it also includes my original navigation patch.

Now then, there’s one small bug in it that I’d like to fix, but I don’t know any Qt or C++, and it’s a miracle in itself that I managed to even get this far on my own. In fact, I’m quite proud of myself actually that I even figured this one out all by myself, go me. :)

I originally patched it so that it would just reposition the parent view around the last folder row you were in … that is, I was doing the same thing, but not specifically for the root menu, just any folder you went into. That worked fine, provided your tree didn’t have more than one level. The second you went into a third directory Home -> Foo -> Bar, the 2nd variable would overwrite the first one so when you returned to the parent it would be whacked. If that makes any sense. Anyway, for someone with Qt knowledge, it shouldn’t be hard to fix so that it always does that no matter which folder you are in, and at what depth level. I have no idea how, though.

It’s actually kinda interesting how I figured this one out. There were two things I noticed from poking around in the code. One, to get videogallery to dump out variables to stdout, I would add this to the code:

VERBOSE(VB_GENERAL, QString(”Some text.”));

VERBOSE(VB_GENERAL, QString(”Some variable: %1″).arg(someVar));

Yah, brilliant hacking on my part, I know, but I managed to kludge my way through it and figure it out.

The second thing I realized was that if I wanted to find out if I was on the parent tree or not, I would have to create a new instance of GenericTree and check to see if getParent() returned the main root or not.

GenericTree *lparent = where_we_are->getParent();

Then, if lparent != video_tree_root you would know you’re not at the top yet.

Anyway, yah, my awesome debugging skillz at work there, but hey — it took a lot of patience and more than a few rebuilds, but it worked, and I’m happy. Woots.

One last thing — the patch will also apply cleanly against current SVN (r18336 as of this writing) since it hasn’t changed in a good while, so you don’t have to use my ebuild if you don’t want, or you could just rename it to the latest snapshot in portage and it’ll still apply.

bend, drip, mythvideo

Tuesday, September 2nd, 2008

Here’s something I haven’t written about in a long time — bend, my custom written CLI PHP5 scripts to rip and encode TV shows.

I actually rewrote the entire thing over Labor Day weekend.  What’s amazing is it took so long to write the original one, but so short a time to completely revamp it.  It’s something I’ve been wanting to do for a long time, and I’m glad I finally got to it.  The code on the old one was so horrible, and was such a frustrating experience to patch, debug or add features.  The new one is already 20 times better.

The first one was just plagued by scope creep, though — I started off just mostly coding it around the way that I thought DVDs *should* work and how they ought to be authored, only to be constantly slapped in the face by so many exceptions that I’d have to go back and hack it to work around the new found realities.

One example is that either lsdvd or libdvdread is buggy in how it outputs chapter information.  Actually, my whole experience with chapters have been that if there are any oddities, then the players will just freak out.  You wouldn’t believe the cases I ran into.  Anyway, here’s a small example.  On one DVD, lsdvd will report in original output that one track has 30 chapters on it.  But when you go to display the chapters, it will only say that there are two.  Most of the time, what happens, is that it will choke anytime there is a chapter between others that is zero length.  In this case, lsdvd just chokes and stops counting them.  MPlayer (at least, the ancient version I’m using) will do a couple of things depending on its mood — sometimes freeze, sometimes skip over it, sometimes act like its not even there.  It’s very odd.  I’ve found a lot of interesting little bugs in the dvd libraries and tools.  I’d love to poke and the source and fix them up … when I have time.

The code is online in my svn repo, and the new one is called ‘drip’ for dvd ripper.  Original, I know, but eventually it will replace bend completely once I add in all the features the old one had plus all the new stuff I want.  I would throw in a link to trac which has prettier display output for viewing SVN files, but my installation is broken (again) and I have no idea why, and it’s always a royal pain trying to figure out what went wrong, so I’ll just fix it later.  I love trac, but its not easy debugging the setup.

Oh yah, also I’ve been working on my mythvideo setup, tweaking it even more.  One really thing that dawned on me, which I’ll write in more detail once I actually have a script ready, is that you can use it to execute shell scripts using the File Types admin menu.  Just tell it to execute .sh files in your folders with /bin/bash and away you can go.

Another thing I learned is that MythVideo will only pass two variables to any external scripts, the default player (%d) and the video file (%s), or more accurately, the file you’ve selected to run.  So if you wanted to see what you’re executing, you would add this to the file type for .sh files: /bin/bash %s %s

Then, say you had test.sh, this would be the contents:

#!/bin/bash

echo $a

I’m getting ahead of myself, though .. I’ll write more about that when I’ve got something to show.  I’m actually working on a shell script similar to mplayer-resume to resume playback of a playlist you’re in.  It’s a bit trickier than I thought it would (or rather, not nearly as simple as I had hoped), so I’m still scoping it out in my head.

Speaking of mplayer-resume, I fixed a bug I kept running into with it for a while now.  The script will now catch the exit code of mplayer, and if it’s not successful (zero), then it won’t overwrite or delete the old position.  I used to hit it all the time because I used to run mplayer -hardframedrop when playing my videos, which would crash the playback about 10% of the time and of course kill the file that had the playback position.  I need to repackage it and push it live, but there’s a few more small fixes I want to make to it first … I might finish the playlist resume script first and add it to there.  Plus I want to get trac working, because that’s where it’s homepage is.

But, I moved my mini-itx to the living room and hooked it up to my HDTV.  It was sitting in my bedroom just collecting dust, and I figured I might as well move it to see if it gets any more usage.  Actually, I remember now, I moved it was because the LED lights were really bright in my bedroom at night, and I have to sleep in total darkness to get a good night’s rest.   Anyway, it’s worked out well so far.  My TV has a VGA port so it’s super simple to plug it in, not to mention I like the fact that it doesn’t use up an HDMI port.  I love my TV. :)  Once I have this series playlist resume script finished, I think I’ll be pretty much “done” with having the setup that I’ve wanted so long.  Well, aside from the fact that I need about 12 more terabytes of harddrive space.

Good times, I tell you what.  I’m gonna go watch some Star Trek TNG.

mplayer + dvdnav + dvdread svn ebuilds

Friday, August 15th, 2008

I updated the mplayer and dvdnav ebuilds in my small overlay, and added one for dvdread now, which has been split into a separate package.  I haven’t had time in the past while to keep an eye on what’s been going on, but I do know that the heavy flurry of development has stopped, and that the installer works better.  Plus, the software works fine for me. :)

My overlay isn’t in layman right now, so if you want to check it out, here’s the skinny:

svn co http://overlays.gentoo.org/svn/dev/beandog/

Have fun and lemme know if there’s any problems.