Sunday, July 27, 2008

Ubuntu: "bad signature" problems prevent apt-get update from working

When running a routine package update, I sometimes get errors like this:


$ sudo apt-get update
...
W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used.GPG error: http://security.ubuntu.com hardy-security Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/hardy-security/Release
W: Some index files failed to download, they have been ignored, or old ones used instead.
W: You may want to run apt-get update to correct these problems

This ubuntu bugs page suggests this:


$ sudo apt-get update -o Acquire::http::No-Cache=true




but the problem persists.
Solved it! By deleting the incorrectly signed Release and Release.gpg files that were downloaded in the last try:

$ sudo rm -f /var/lib/apt/lists/partial/security.ubuntu.com_ubuntu_dists_hardy-security_Release*

Now apt-get is successful.
I got the idea above from the instructions in comment 20 to the bug

Sunday, June 29, 2008

McCain vs Obama

From CNN:

Muslim and Jewish groups on Monday sharply criticized Sen. John McCain's comments that he would prefer a Christian president to lead the United States.



The Arizona Republican's remarks came in an interview with Beliefnet, a Web site that covers religious issues and affairs.


"I just have to say in all candor that since this nation was founded primarily on Christian principles, personally, I prefer someone who has a grounding in my faith," the GOP presidential hopeful told the Web site in an interview published Saturday.



Its hilarious that other religious groups are attacking him for emphasizing his religion and excluding theirs, and not because this is blatantly false.



On the other hand, Barack Obama seems to take a more reasonable stand:


Whatever we once were, we're no longer just a Christian nation; we are also a Jewish nation, a Muslim nation, a Buddhist nation, a Hindu nation, and a nation of non-believers. (http://www.cbn.com/CBNnews/204017.aspx)


Here is another quote:

Democracy demands that the religiously motivated translate their concerns into universal, rather than religion-specific, values. It requires that their proposals be subject to argument, and amenable to reason. (from http://obama.senate.gov/speech/060628-call_to_renewal/)

US Presidential Candiates on Politics vs Religion

I was returning from a social trip to Jakarta. While at the airport, wondering how to kill time, I ran into a bookshop and spied Richard Dawkin's "The God Delusion". I bought it immediately. Honestly, I did it more to dig up interesting factoids to tell my religious wife than because I thought the book would have any new perspectives for the godless geek that I am.


However, I had forgotten that Richard Dawkins writes very well, and it has been quite an entertaining read so far.


I could feel indignation bringing blood rushing to my eyes when I read chapters on how atheism is discriminated against in American politics and how the religious are blatantly lying in the press regarding the United States being founded as a Christian nation.


The chapter "Arguments for God' existence" does a very good job of summarizing the very few arguments from first principles put forward to justify the existence of God.


And the book led me to discover two blogs:



  • Pharyngula, a blog about "Evolution, development, and random biological ejaculations from a godless liberal", belonging to PZ Myers, a bilogist and associate professor at the Univertisty of Minnesota.

  • Atheists of Silicon Valley





Tuesday, May 27, 2008

Building and installing a local debian package

Recently, I ran into trouble with the 'python-zeroc-ice' package on Ubuntu 8.04. It used to work fine on Ubuntu 7.10.

Some digging revealed that the package python-zeroc-ice-3.2.1-2 claims it supports python2.5, but the C module for ICE is built against python2.4.

So I compiled the package and installed it locally. This is how:

1. Downloaded the source package:
$ apt-get source python-zeroc-ice

2. Installed all other packages needed to *build* this pacakge:
$ sudo apt-get build-dep python-zeroc-ice

3. Fixed the problem:
$ cd zeroc-ice-python-3.2.1 # yes, the source package/dir is called zeroc-python-ice
$ vim config/Make.rules
-> set "PYTHON_VERSION = python2.5" in the appropriate place.
$ dch -i # bring up the changelog with new entry
Added a changelog messsage. The package version, at the top of the changelog, is now python-zeroc-ice-3.2.1-2ubuntu1
$ dpkg-buildpackage -uc -us

4. Install the new package
$ cd ..
$ dpkg -i python-zeroc-ice_3.2.1-2ubuntu1_i386.deb

And we are done. However, the change above means Ice won't be available for python2.4 anymore.

Wednesday, April 9, 2008

Gotcha with git-svn dcommit?

http://kerneltrap.org/mailarchive/git/2007/8/21/255431: this should be kept in mind/verified when using git-svn.


Tracking multiple branches in svn repo with git-svn

For some time now, have wanted to use git and git-svn to track the subversion repo at work. That repo has lots of branches, and individual changesets are merged very often between branches, making it a nightmare to find out what has already been merged, and what not.
Used to keep track of all this in a text file. Its becoming tedious. Have been trying to use git-svn to ease the pain.
On the first try, git-svn gave up halfway during the clone operation with an error message about protocol/network error. This git-svn was the one in ubuntu repositories.
Since then, installed git from source.
First I tried this way. It works, but then gitk will only show me one branch: the one I have currently checked out.
Now, I am trying this other way. Hopefully this will work better.

Saturday, April 5, 2008

Code merging

Wanting to merge two branches of code, both of which have had concurrent commits going on them for some time. Code is kept in svn, so the branches actually live in separate directories. Most changesets have been merged back and forth, yet residual changes remain.

I get diff to tell the files which are different between the branches.

diff -q -r -x '\.svn' -x '*.pyx' -x '*~' branch1 branch2


This produces lines like:



Files zeroc-ice-python_3.2.1/config/Make.rules and zeroc-ice-python-3.2.1-new/config/Make.rules differ
Only in zeroc-ice-python-3.2.1-new/config: Make.rules.GNU
Only in zeroc-ice-python-3.2.1-new/config: Make.rules.GNU_kFreeBSD

I need to munge the output of diff. I want to have 4 columns: directory (sans the branchname), filename, link to the file in branch1 if it exists there, link to file in branch2 if it exists there. I want this ordered/sorted by directory, and I want the output in emacs org mode format. I filter the output of the above diff command through this perl script:


while (<>) {
if (/^Only in/) {
m/Only in (.*): (.*)$/; $dirname=$1; $fname=$2; # sep dirpath and filename
($branch = $dirname) =~ s/([^\/]+).*/$1/; # the branch name is the first part of the dirpath (e.g. branch-xy/dir/path/file)
$dirname =~ s/$branch\/?(.*)/$1/; # remove the 'branch-xy' from dirpath to get the remaining dirpath
$_ = "| $dirname/$fname | [[file:~/workspace/couffable/branches/$branch/$dirname/$fname][Only in: $branch]] |";
}

if (/^Files /) {
m/Files (.*) and (.*) differ/; $left=$1;
$left =~ m/release-3-11\/(.*\/)?([^\/]+)/;
if (defined($1)) { $dirname=$1; } else { $dirname = ""; }
$left=$2; # remove branch name, sep dir and file
$_ = "| $dirname$left | [[file:~/workspace/couffable/branches/release-3-11/$dirname$left][r311]] | [[file:~/workspace/couffable/branches/release-3-11-airtel/$dirname$left][r311-airtel]] |";
}
print $_ . "\n";
}