May 09

dev-db/sqlite-3.6.14 fails to merge

./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
--localstatedir=/var/lib --libdir=/usr/lib64 --disable-debug --enable-threadsafe --enable-cross-thread-connections --disable-tcl
configure: error: configure script is out of date:
configure $PACKAGE_VERSION = 3.6.13
top level VERSION file     = 3.6.14
please regen with autoconf

!!! Please attach the following file when seeking support:
!!! /var/tmp/portage/dev-db/sqlite-3.6.14/work/sqlite-3.6.14/config.log
*
* ERROR: dev-db/sqlite-3.6.14 failed.
* Call stack:
*               ebuild.sh, line   49:  Called src_compile
*             environment, line 2810:  Called econf '--disable-debug' '--enable-threadsafe' '--enable-cross-thread-connections' '--disable-tcl'
*               ebuild.sh, line  534:  Called die
* The specific snippet of code:
*               die "econf failed"
*  The die message:
*   econf failed
*
* If you need support, post the topmost build error, and the call stack if relevant.
* A complete build log is located at '/var/tmp/portage/dev-db/sqlite-3.6.14/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/dev-db/sqlite-3.6.14/temp/environment'.
*

>>> Failed to emerge dev-db/sqlite-3.6.14, Log file:
To solve this, we simply do what is suggested, we regen conig with autoconf. To do that we unpack the sources and run the build-process manually:

ebuild /usr/portage/dev-db/sqlite/sqlite-3.6.14.ebuild unpack
cd /var/tmp/portage/dev-db/sqlite-3.6.14/work/sqlite-3.6.14
autoconf

after that we need to finish of the emerge process:

ebuild /usr/portage/dev-db/sqlite/sqlite-3.6.14.ebuild compile
ebuild /usr/portage/dev-db/sqlite/sqlite-3.6.14.ebuild install
ebuild /usr/portage/dev-db/sqlite/sqlite-3.6.14.ebuild qmerge

(I've omitted the output of the commands here...)

After that we're ready to go and can continue updating world ;)
The bug at bugs.gentoo.org: 269075

Share

Apr 05

RSS reader in Ruby which posts to wordpress

I wanted a possibility to automatically create a list of updated photoblogs on pacnews. A bit of search revealed that it should be fairly easy to write something in ruby for that. So I settled for the newest implementation of a RSS-Parser library for ruby: Feedzirra by Paul Dix which can be found over at github.

I created a sqlite database with the following schema (place it in db/schemal.sql):

CREATE TABLE feeds (
id INTEGER PRIMARY KEY NOT NULL,
url VARCHAR(255) DEFAULT NULL,
last_title VARCHAR(255) DEFAULT NULL
);

the database file can be created with the following command:

sqlite db/feeds.db < db/schema.sql

In this database I save a hash of the photoblog's url and a hash of the last post title. In that way I can check if a blog has been updated or added to the list with fairly decent speed (I hope).

A simple text file called feeds within the same directory contains the line separated feedurls.
The program simply checks every feed url it finds in the feeds list for a new post title. New feeds are saved to the Hash new_feeds, feeds with new posts are saved to the Hash updated_feeds.
After the updating a simple unordered list is created out of the new and updated feeds. This list is posted to my wordpress blog via the xml-rpc interface. You might have to enable that in your admin interface under settings->writing.

Now I just put the script the crontable to update regularly. The very first post created by this script can be found here.

The script:
(direct download the rendering seems to be a bit screwed ;) )

  1.  
  2. require 'rubygems'
  3. require 'feedzirra'
  4. require 'sqlite'
  5. require 'atom/entry'
  6. require 'atom/collection'
  7. require "xmlrpc/client"
  8.  
  9. db = SQLite::Database.new( 'db/feeds.db', 0644 )
  10. new_feeds=Hash.new
  11. updated_feeds=Hash.new
  12.  
  13. file=File.open("feeds")
  14. while (line=file.gets)
  15. # fetching a single feed
  16. if line.size>0
  17. if 404!=(feed = Feedzirra::Feed.fetch_and_parse(line)) && feed!=0
  18. puts "updating "+line
  19. puts feed
  20. last_title = db.get_first_value("select last_title from feeds where url='"
  21. +feed.url.hash.to_s+"';")
  22. if last_title
  23. if last_title!=feed.entries.first.title.hash.to_s
  24. updated_feeds[feed.url]=feed.title
  25. stmt = db.prepare("update feeds set last_title='"
  26. +feed.entries.first.title.hash.to_s+"' where url='"+feed.url.hash.to_s+"';")
  27. stmt.execute
  28. end
  29. else
  30. new_feeds[feed.url]=feed.title
  31. stmt = db.prepare("insert into feeds (url,last_title) values ('"
  32. +feed.url.hash.to_s+"','"+feed.entries.first.title.hash.to_s+"');")
  33. stmt.execute
  34. end
  35. end
  36. end
  37. end
  38. file.close
  39.  
  40. content = ""
  41. if updated_feeds.size>0
  42. content = "<p>Updated blogs:</p><ul>"
  43. updated_feeds.each do |url, title|
  44. content+="<li><a href="+url+">"+title+"</a></li>"
  45. end
  46. content+="</ul>"
  47. end
  48. if new_feeds.size>0
  49. content+= "<p>Newly added blogs:</p><ul>"
  50. new_feeds.each do |url, title|
  51. content+="<li><a href="+url+">"+title+"</a></li>"
  52. end
  53. content+="</ul>"
  54. end
  55.  
  56. if content.size!=0
  57. username = "the_user_name"
  58. password = "a_very_secret_password"
  59.  
  60. begin
  61. server = XMLRPC::Client.new( "www.urlofyourblog.de", "/xmlrpc.php")
  62.  
  63. newPost = Hash.new
  64.  
  65. newPost['title']="Blog updates"
  66. newPost['description'] = content
  67. newPost['category']= "Blogs"
  68. result = server.call("metaWeblog.newPost",1,username,password,newPost,true)
  69. rescue XMLRPC::FaultException => e
  70. puts "XMLRPC Error: "
  71. puts e.faultCode
  72. puts e.faultString
  73. rescue StandardError => e
  74. puts e.to_s
  75. end
  76. end
  77.  
Share

Dec 19

Trappywiki

I've now set up a little open wiki to collect some spam data. I need to test some algorithms to detect spam I implemented for my semantic wiki project. So feel free to spam at http://www.marrias-rvr.de ;)

Share

Dec 10

Fedora 10 – Review

So, I recently have installed Fedora 10 on my home computer. Since there are really some quirks that keep on annoying like hell, I'm trying to summarize whats working and what's not:
Pros:

  • My eclipse and my projects all seem to work with the icedtea VM, a bit surprising, but welcome
  • The kde version in the repository comes with a working digikam 0.10.0 nice thing for my photography management. The plugins even work with the 0.10.0 version in this packaging
  • I kinda stumbled upon Rhythmbox, seem nice enoug to be usable. I had tried that ages ago, where it was quite bad. And with the many bugs amarok still has in its new version it is viable alternative for me.

Cons:

  • The licensing issues of Fedora are quite annoying. It takes some work to even get mp3 played. Some more to get dvd-playing and Nvidia hardware acceleration. Major annoyance!! Why not let the user decide which licenses he is willing to accept?
  • Pulseaudio: I honestly do like the basic idea behind it, but it truly still needs some work. Audio has random lags everywhere. Music from rythmbox, amarok, totem, mplayer .... anything. Videos with mplayer lag. After beeing paused once, mplayer doesn't continue to play a movie and can't even play a video without lags. And surely my machinespeed (3.8Ghz+, 4G ram) is not to blame for those errors

Those are just the major annoyance points. And I didn't even give the testing version a try. That was the normal desktop distribution which is supposed to be working and stable (!) .. I think I'm going back to gentoo, at least there I can watch videos without lags. (Not that this is the first time I gave another distribution a try...)

Share