Older blog entries for shlomif (starting at number 666)

Tech Tip: How to Build Firefox with Debugging Symbols on Linux

I spent a large part of today building Firefox on one of my Linux machines and trying to figure out why gdb did not display debugging symbols, and instead only displayed question marks in the backtrace (?? ). Eeventually, I found a solution, so I'd like to document the process for other people in the future.

The solution is documented in this bug report that I filed and involves the following steps:

  1. Checkout the firefox source from the mozilla-central repository

  2. Put something like the following in the .mozconfig file in the source's root (where client.mk can be found):

    . $topsrcdir/browser/config/mozconfig
    export LDFLAGS="-Wl,--no-keep-memory"
    mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/ff-dbg
    ac_add_options --disable-optimize
    ac_add_options --enable-debug
    ac_add_options --enable-tests
    ac_add_options --enable-debug-symbols
    ac_add_options --prefix="$HOME/opt/firefox-from-hg"
    

    The important lines are the --enable-debug, --enable-debug-symbols and the LDFLAGS one.

  3. Type make -f client.mk. Now you'll need to wait.

  4. Type make -f client.mk install PKG_SKIP_STRIP=1 and make sure you do not forget the PKG_SKIP_STRIP=1 parameter.

  5. Now you can use gdb ~/opt/firefox-from-hg/bin/firefox to debug Firefox with all the debugging symbols.

Enjoy!

Syndicated 2012-07-04 17:08:20 from shlomif

How to Listen to Jamendo Radio and Tracks from the Browser

In case you do not know, Jamendo is a show case for music licensed under Creative Commons licences, with a lot of great tracks to listen to. However, after the recent upgrade, I found that I was no longer able to listen to their radio stations or press the listen button of their tracks using Firefox, my browser of choice.

Here is what I discovered on how to re-enable it after some investigation: first of all, you need to enable and/or whitelist JavaScript for jamendo.com. If you are using NoScript, you can use the “S” button on the Add-on bar for that.

Furthermore, the new Jamendo requires Adobe Flash to be whitelisted as well. If you are using FlashBlock, then go to “Tools → Add-Ons → Extensions → Flashblock → Preferences → Whitelist” and add http://www.jamendo.com/ there. I don’t know how to properly enable the listening on browsers and platforms which do not have Adobe Flash installed, so blame Jamendo.com - not me. (And, yes, I know that Flash is evil.)

There may be some other obstacles on the way, but now everything is working fine for me. I am going to complain to Jamendo that in this HTML 5 day and age, one needs to use Flash to listen to their streams, which, as I recall, was not necessary in the old Jamendo.

Happy listening.

Syndicated 2012-06-27 11:40:08 from shlomif

New and Updated Material on My Homepage

Here are the recent updates for Shlomi Fish’s Homepage. There are quite a few changes this time.

The humorous document “It’s not a Fooware - it’s an Operating System.”, mostly written by me, was restored from the perl.net.au wiki which is currently down:

Lots of people heard Emacs haters complain that “Emacs is not an editor - it’s an operating system” or something along these lines. So here we're trying to concentrate other such programs that are no longer limited only to their original purpose, but rather expanded to cover lots of other stuff. So you'll know that Emacs is not alone.

I also added a a new aphorism:

We agree. But do we agree to agree?

There are some new Factoids:

If the mountain will not come to Muhammad, then Muhammad will go to the mountain. If the mountain will not come to Chuck Norris, then the mountain will suffer Norris’s wrath for not complying with his whims.

And there are also some new fortune cookies:

  • Su-Shee: SO I TURNED TO YOU FOR HELP IN TIMES OF DESPERATION…
  • Botje: desperation is for wimps
  • anno: prosperation?
  • Altreus: deprecation is an outdated concept and we prefer not to do it
  • Su-Shee: let’s deprecate deprecation.
  • alpha--: agreed.
  • alpha--: oh wait.
  • Su-Shee: that would be a deprecation
  • rindolf: Who will watch the watcher?
  • rindolf: Who will deprecate deprecation?
  • Su-Shee: shouldn’t someone deprecate the deprecator in that case?
  • * rindolf deprecates the deprecator who is deprecating deprecation.
  • Altreus: that's OK, it's not deprecated yet

I found many typos in the fifth part of the Perl for Perl Newbies series before and during giving the talk at the Tel Aviv Perl Mongers and also prepared some notes for it in Hebrew (which can be found in the series’s front page).

The Transcript of the Perlcast interview with Tom Limoncelli, about his book Time Management for System Administrators has been restored from the currently offline perl.net.au wiki:

Josh: Getting back to where we had started on that planning your day at the beginning of the day, before you check your email. You claim there, that whenever you're prioritising your activities, you really only need three categories and not, you know, a top-ten list, or anything like that. Could you explain that a little?

Tom Limoncelli: that comes from the fact that I used to try to really be specific about the priorities of my action items. So I put something in my to-do-list, and I'd say well, you know I'm ranking their importance from 0 is not important, and a 100 is the world is going to explode if I don't do it right now. And I spent so much time calculating "Wow, is this more like a 63 or a 67, is it a 67? Wow!". And I just spent so much time trying to get an exact priority. In some cases, the task would have been done already. You know I've spent too much time prioritising.

I'm not sure where I picked this up, but someone recommended three priorities: A - it's due today; B - it's important; and C - everything else. Generally, if it's a day where I have any A's at all - that's all I'll be working on. And the way projects go, I'm generally working on that for the whole day. So that's sort of the exception. Most of the time I'm working on B's, which are things that are important, and C's are sort of those would-be-nice-kind-of-things.

And the nice thing about breaking it into this a simple A, B, C priority scheme is that first of all, you're spending less time picking your priority. And secondly, when you're planning your day, in that 5-minute planning period, you can look at your tasks and say "You know, I wanna work 8 hours today, I have one hour of meetings, so I'm down to 7 hours", and then you can look at your tasks and say "Is this more than 7 hours worth of work?". Because it's written, I can start actually doing this kind of planning, and say "That's more like 14 hours worth of work, so those C priorities and B priorities - I'm gonna move them to the next day's to-do-list." Or maybe, OK, I have time for my A's and my B's and the C's get moved.

The third version of my essay, “The Case for Drug Legalisation”, is now live, with several major improvements. They are in large part, thanks to someone who commented on my essay, and allowed me to use their text, and who chose to remain anonymous.

I have set up project pages for MikMod, a module files player, which I now maintain, and for Website META Language, a sophisticated HTML preprocessor, which I have also been maintaining and recently released its 2.2.0 version.

Also in the software section is a How to Contribute to my Projects sub-section with a concentrated and ongoing “HACKING” document.

And, naturally, there are also many smaller enhancements, such as new links, fixes for broken links, new <meta name="description" /> tags, and corrections of typos. I’ve also moved the site’s version control repository from a Subversion repository that required a username and password to access to a publicly-accessible Mercurial repository. More details can be found on the Site's Source Code page.

Syndicated 2012-06-14 10:18:07 from shlomif

Freecell Solver 3.12.0

Freecell Solver version 3.12.0 has been released. It is available in the form of a source archive from the download page. Freecell Solver is an open source framework (library and some command line applications), for automatically solving several variants of card Solitaire / Patience games, including Freecell.

The first item to note is that the URL of its site changed from under *.berlios.de to http://fc-solve.shlomifish.org/, and that there is a redirect in place. Moreover, we have switched the version control system from one based on Subversion to a git repository which is currently hosted on GitHub (though we may move it later).

This release adds a new flag - --show-exceeded-limits or -sel for short, that removes some ambiguity in the output, and fixes a problem with starting the solver with --set-pruning r:tf in conjunction with -opt. A new preset - -l three-eighty (or -l te for short) has been added, which provides somewhat better performance.

The experimental dbm_fc_solver is now less experimental and can now store the positions inside binary trees in memory, and its memory consumption has been greatly reduced since earlier versions. We also added another experimental solver called fcc_fc_solver which aims to determine the solvability of a deal by analysing fully-connected-components (“FCCs”).

We also added support for building and testing the distribution in an out-of-tree build, and there are some cleanups to the code.

More information about all these can be found in the distributed documents of Freecell Solver.

Enjoy!

Syndicated 2012-06-13 13:31:00 from shlomif

Tech Tip: GNU tar’s “-a” Flag

On this post to the Mageia development mailing list by Thierry Vignaud, I discovered that GNU tar (at least in recent versions) has an “-a” flag which is useful in conjunction with its “-c” (create new archive) mode. This is because it detects the suitable compression based on the extension and uses the appropriate flag.

So: “tar -cavf myarchive.tar.gz ./mydir/” is equivalent to “tar -czvf myarchive.tar.gz ./mydir/”, “tar -cavf myarchive.tar.bz2 ./mydir/” does the same thing as “tar -cjvf myarchive.tar.bz2 ./mydir/” and so forth. When unpacking archives, you can omit the “-a/-z/-j/-J” flags, because GNU tar will detect the compression of the archive based on the file magic of the compressed formats.

Another useful (and open-source) tool for manipulating tarballs and other archives is patool, but I've been meaning to suggest they do a short-circuiting when converting tarballs from .tar.gz to .tar.xz to .tar.bz2 / etc.

Anyway, enjoy.

Meta

I know I’ve been really negligent with blogging in my blogs lately (which is not good), but don’t worry - I am fine, just busy with a lot of stuff including work work (which gives money but consumes time), doing quite a lot of coding and other development on open-source software, some Freecell-related research, keeping up with my E-mails, posting to mailing lists, playing some computer games, chatting a lot (maybe too much) on the IRC, and naturally - sleeping.

It seems that despite starting the new job in December, and despite the fact that it was now spring time (which is often a time of calamity for me), I did not have any particularly strong periods of stress lately, which is a good think. Thanks, $DEITY!

Today a friend who is an Israeli open-source enthusiast called me and asked me why I disappeared and if everything OK, and I replied, but he later called again and said his mobile phone mixed me with someone else. Anyway, you can always reach me in many ways, but I think I should start blogging more often, so I‘ve picked up this tech tip as the lowest hanging fruit.

Syndicated 2012-05-27 20:38:59 from shlomif

New Vim Plugin: Add to Word Search

I’ve released a new plugin for the Vim text editor, called "add-to-word-search" ( GitHub repository, Vim Scripts page), and I’d like to introduce it here. If you like Vim, please let me know what you think by commenting below.

In order to properly introduce the plugin, one first should introduce the different (and useful) commands of Vim of * and #. What they do is search forward or backward for the complete word under the cursor (or somewhat before it or after it). Bram Moolenaar (the creator of Vim) covers them in his “Seven habits of effective text editing” document (there’s also a video available), and I think I covered them in a previous Vim tip.

Now, here is the use case that often bugged me: sometimes I searched for a certain function, found it in the text and then found a function that called this function (or often in the case of C code, a preprocessor macro that wrapped it), and wanted to look for its occurrences as well as those of the previous term. I wasn't aware of any good way to do it, so I ended up writing the “add-to-word-search” plugin.

After installing it, and after having searched for a word using * or #, one can press \** to search forward for an additional word under the cursor (or \## to search backward), and then use it more times to add additional words.

After publishing this plugin and mentioning it on #vim, “ironcamel” reported an issue that it gives an error if you have set nowrapscan. I fixed it, but was only able to do so by temporarily disabling nowrapscan, and then enabling it if it was previously enabled. (Apparently, vimscript’s exception-handling cannot handle some of the built-in errors.)

I also demonstrated it to my (now former) co-worker, who had been trying to get used to Vim, and he said it looked useful, but asked if there was an easy way to remove terms from the search query (which there is not at the moment), and I noted it may be a good idea.

Anyway, this Vim plugin is open-source and available under the MIT/X11 licence. Enjoy!

Syndicated 2012-04-24 07:51:03 from shlomif

ANNOUNCEMENT: Resumed maintenance of mikmod and libmikmod

To whom it may concern,

libmikmod is a portable and open-source (LGPLed) library for playing various common formats of Module files, including MOD, S3M, XM, and IT. mikmod is a Curses-based front-end for it, freely available under the GPL. Shlomi Fish would like to announce that he resumed maintenance of libmikmod and mikmod, after many years of lack of maintenance, after getting approval from Raphaël Assénat (raphnet), the previous maintainer.

So far, libmikmod-3.2.0-beta3 has been released with some older changes that lingered in the old version control repository, as well as several important fixes for security bugs taken from the downstream Mageia Linux package. The version control repository was converted from CVS to Mercurial, and more development is expected.

Plans for the future include releasing a stable libmikmod-3.2.0 and afterwards converting the build system from GNU Autotools to CMake, and then looking into fixing more bugs as they are encountered and implementing new features.

The old MikMod homepage ( http://mikmod.raphnet.net/ ) now redirects to the new one at http://mikmod.shlomifish.org/ where new development will take place (some parts of it still need to be updated, but it should already be usable).

Any contribution including testing, reporting bug fixes, contributing changes (as patches or as clones of the repository), or suggesting new features, will be appreciated.

For more information about module files see the wikipedia entry for “Module file”, and the FAQ for alt.binaries.sounds.mods (which was last updated in 1999). </a>

Syndicated 2012-04-15 12:05:18 from shlomif

The Stoic Road to Peace of Mind

If you are like most people, you probably feel angry, frustrated, or disappointed, often. That’s also has naturally been the case for me, but I was told a trick that made it much easier for me to handle these situations, and it dates back to antiquity.

Stoicism was an ancient Greek school of thought (that still exercises some influence today), which among other teachings, advocated self-control and avoiding making your emotions and irrational desires influence your behaviour for the worst. What they claimed was that painful feelings were not a direct result of an experience that induced pain, but rather the human mind's irrational interpretation of it.

If we move from this theory to its implications, then once something frustrating happens to you, you can say to yourself “I don’t like this. This situation is not ideal. However, feeling angry and resentful will not be beneficial, and so I should just accept this as is, try to reasonably cope with it, and make the best of it. I might even grow to like it.”

My psychotherapist told me that “Things must always go my way.” has been identified as an irrational cognitive belief by many people. (It is mentioned in this page in the Google Books’ hosted book). The solution to this is simply to say to myself that “I cannot always get what I want.” and that “Things might not go exactly like I want them to and that’s OK because I’ll survive.”.

Back to Stoicism, we can draw inspiration from the Roman Emperor and Stoic philosopher Marcus Aurelius’s quote from his book Meditations:

Say to yourself in the early morning: I shall meet today ungrateful, violent, treacherous, envious, uncharitable men. All of these things have come upon them through ignorance of real good and ill… I can neither be harmed by any of them, for no man will involve me in wrong, nor can I be angry with my kinsman or hate him; for we have come into the world to work together…

I am not an authority to speak a lot further about Stoicism, because I’ve only heard about it from hearsay and read the wikipedia entry and some other online sources, but I think we can all become a little, or even a lot happier, by adopting the mindset that the key to peace of mind is accepting sub-optimal situations, instead of insisting that we will always have our way.

Thanks

Thanks to steerpike, mofino and perlmonkey from Freenode for going over early drafts of this essay and providing some comments.

Licence

This work is licensed under the Creative Commons Attribution 3.0 License (Unported) (CC-by) or at your option any later version. Copyright © 2012, Shlomi Fish. CC-by is a common, permissive, free/libre/open licence for cultural works, which allows for almost unlimited use. See my interpretation and expectations from people who wish to build upon it (which I believe are pretty fair).

Meta

I realise I’ve neglected this blog for a long time, and I’ve been meaning to write and publish this entry for a long time, but didn’t, but I guess “better late than never”, right? Personally, I’ve been mostly fine recently having found a part-time job, which involves a short bus ride to the office in the downtown city, so it’s at a great location for me. I also enjoyed attending the latest Israeli Perl Workshop for 2012 and written a report about it.

In the meanwhile, livejournal.com’s handling of this blog’s DNS domains has deteriorated, and now just redirects it to shlomifish.livejournal.com. This probably made me even less motivated to post on this blog, and my reports about it appears to have been marked as duplicate without a proper resolution, but I'll try to get it handled and fixed. If not, I might have to investigate other hosted blog solutions.

There’s a lot more going on with my life, but I’m not sure how much it will interest other people and how much I should share it, but I’m fine and happy and have plenty of free time for work and leisure and whatever is in between. So good bye until next time.

Syndicated 2012-03-31 08:57:58 from shlomif

Tech Tip: Getting hgsubversion to Work with subversion-1.7.x

Apache Subversion version 1.7.x broke some backwards compatible and some stuff got broken, including hgsubversion, which provides a way to use subversion remotes with Mercurial.

In order to fix it, just install subvertpy, which provides alternative python bindings for subversion, which hgsubversion prefers by default, and with which it works fine under subversion-1.7.x.

I discovered all that after I attempted to fix it the hard way by installing subversion-1.6.x under /opt/svn-1.6.x, which required building an old version of SWIG, and then setting PATH, LD_LIBRARY_PATH, and PYTHONPATH and then having to remove the global python-svn bindings from under /usr/lib (as root!) because hgsubversion did not like them, a process which took me an entire evening and was frustrating and was ridden with a lot of trial and error, so I would not recommend it.

Hope it helps. Also see this hgsubversion bug report.

Syndicated 2012-03-16 09:04:14 from shlomif

Tech Tip: Getting hgsubversion to Work with subversion-1.7.x

Apache Subversion version 1.7.x broke some backwards compatible and some stuff got broken, including hgsubversion, which provides a way to use subversion remotes with Mercurial.

In order to fix it, just install subvertpy, which provides alternative python bindings for subversion, which hgsubversion prefers by default, and with which it works fine under subversion-1.7.x.

I discovered all that after I attempted to fix it the hard way by installing subversion-1.6.x under /opt/svn-1.6.x, which required building an old version of SWIG, and then setting PATH, LD_LIBRARY_PATH, and PYTHONPATH and then having to remove the global python-svn bindings from under /usr/lib (as root!) because hgsubversion did not like them, a process which took me an entire evening and was frustrating and was ridden with a lot of trial and error, so I would not recommend it.

Hope it helps. Also see this hgsubversion bug report.

Syndicated 2012-03-09 19:04:46 from shlomif

657 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!