Older blog entries for shlomif (starting at number 715)

Tech Tip: Resetting the GLib/Gtk+ Default Apps on Linux (e.g: the Default Browser)

In this tip, I would like to describe how to reset the default apps, and especially the default browser, for GLib and GTK+. These are used by desktops like GNOME and XFCE, and by GTK+ applications such as HexChat or claws-mail. My problem originally was that I accidentally pressed the "Yes" button when Firefox Nightly (installed under a prefix under /opt) asked me whether I should set it as the default browser, which caused HexChat and Claws-Mail to open links using it by default.

Anyway, to resolve this problem do this:

  1. Go to ~/.local/share/applications.

  2. Backup this directory somewhere safe.

  3. The mimeapps.list file contains the reference to use the offending apps under the *.desktop files there which you can search for the reference to the apps.

  4. Remove these line or their portions from mimeapps.list.

Now you may need to restart the desktop apps or the desktop environment (not sure).

Hope it helps.

Here’s how I found it: after some false leads of either trying to recursively search my home directory for occurrences of /opt/firefox and reading the source code of HexChat, GLib and gtk+ to see where this happens (there were too many levels of indirection there), I ended up doing “strace -f -o hexchat.strace hexchat” and inspecting the strace file for hints.

Licence

You can reuse this entry under the Creative Commons Attribution 3.0 Unported licence, or at your option any later version. See the instructions of how to comply with it.

Syndicated 2014-03-08 11:31:14 from shlomif

The Lost Souls of Freenode

I originally wanted to written a more prose-like blog post about the topic of “The Lost Souls of Freenode”, echoing some of my frustrations from trying to help people on Freenode channels, especially #perl and ##programming and I started from keeping a list of bullets and sub-bullets and decided to keep it this way out of being lazy. Maybe it can also be considered the blog equivalent of some wikiHow pages.

After I gave a link to the bullets to someone I met on Freenode, he told me he hasn't found any of what he read here surprising from his experience on IRC and as a tutor and T.A. (= Teacher Assistant) in an American college.

  • “Many Lost Souls” on Freenode's #perl - IM conversation.

  • Quote the conversation about “First rule of #perl channels” (meaning that Freenode’s #perl is our first line of defence).

  • People having problems getting indentation right.

  • People who /msg me after asking.

    • Either they think that's the way to answer.
    • Or they think that I cannot help them because there's another conversation.
    • They're usually not willing or cannot afford to pay.
    • Someone who thought that paying me 50 USD / hour for private help was too high.
  • * People who want us to write their code for them.

  • “Help me with a script I found.”

    • Often badly written.

  • “Help me with using a program / my operating system / etc.”

    • Not even related to coding.

    • “Are you using version control?” “No, what's that?”
    • Automated tests?
    • A debugger?
  • Old versions of perls.
    • Homework/scholastic constraints.

    • “We didn't study it yet”

    • “No external modules / CPAN”

    • “Not allowed to any built-in language data structures, including not arrays.”

      • Mandatory course.

      • Graded 0 once because was programmed on Python-2.7.x and tested on Python-3.3.x (on Windows).

  • One who didn't know what files are nor did file I/O.

    - Ruby

    - private conversation with someone else who didn't know what files are.

Syndicated 2014-02-25 14:02:09 from shlomif

Freecell Solver 3.24.0 Release: Mourning Adrian Ettlinger

Freecell Solver version 3.24.0, has been released. Freecell Solver 3.24.0 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.

This release is dedicated to the memory of Adrian Ettlinger who passed away on 23 October 2013, who was a good Internet friend of the primary maintainer of Freecell Solver (= Shlomi Fish), and who contributed a great deal to Freecell Solver and to Freecell research and programming in general (among other major life achievements, and contributions to man kind). You can read an obituary of Mr. Ettlinger by Shlomi Fish as it was posted to the Freecell Solver Discussions mailing list, and also read an an interview that Fish conducted with him back in 2003.

The new video-editing preset was named in honor of Ettlinger’s previous work in pioneering non-linear video editing back when he worked as an Electrical Engineer (and later as a software developer) for CBS corporation.


In any case, the main highlights of this release are:

  1. New Feature: the -l video-editing (or -l ve for short) flare-based preset that tends to yield shorter solutions on average. See a post with some performance analysis.

  2. A bug was fixed when providing input without a trailing newline character (“\n”). This was reported against the online JavaScript version was Olaf and was fixed globally. Thanks, Olaf!

  3. The distribution now contains the sources for the Split FCC (= Fully Connected Component) Solver which was an unssuccessful attempt to solve Windows Freecell deal No. 384,243 with two freecells. It may prove of general utility in the future, though.

Hope you enjoy this release and we extend our sadness to the other family members and friends of the late Mr. Ettlinger.

Syndicated 2014-02-21 17:12:00 from shlomif

Tech Tip: Empty tag in XHTML served as text/html

If you serve XHTML (= HTML written using XML grammar and conventions) as Content-Type: text/html, you may be tempted to write an empty <div> tag as a standalone XML tag with a trailing slash using <div id="my_anchor" />. Don’t do that, and instead write a pair of opening and closing tags, e.g: <div id="my_anchor"></div>.

Using the first form confused both Firefox (24.2.x in my case) and Google Chromium (whatever shipped with Mageia at the time), and made them misrender my page, despite the fact that it validated as valid XHTML. Perhaps I should have considered putting the id=".." inside a meaningful sub-section of the document, but I implemented something for skipping a section navigation menu.

Syndicated 2014-01-14 14:25:58 from shlomif

Tech Tip: Mitigating “git clone”’s inability to be resumed using rsync

Happy new civil year, everyone. As you may know Git is a distributed version control system, but its often time-consuming (if the repository’s history is large) “git clone” operation cannot be resumed, which is a problem with bad Internet connections. There was a service that did “git clone” and then allowed people to download using HTTPS Called “Git bundler” but it has been down for sometime now. However, I found a different solution to the problem.

What can be done is use ssh to log in to a remote host, where the “git clone” is performed (preferably, but not absolutely necessarily, when running on top of a session of tmux, GNU Screen or similar). After that, you can use rsync over ssh to download the .git directory to the local workstation (I like to use the invocation rsync -a --progress -v --inplace for that).

Following that all you have to do is run git clone to a different directory to the one where you put the .git and set “git remote” appropriately.

Hope that helps, and the same can be done with other distributed version control systems such as Mercurial, or Bzr.

Syndicated 2014-01-02 12:43:58 from shlomif

Tech Tip: Combining/Merging Bookmarks From a Different Firefox Profile

Happy New Civil Year! Let’s suppose you collected some bookmarks in a different Firefox profile (possibly on a different computer or system, or in a different profile), and wish to place them somewhere under your current or main profile’s bookmark tree - how can it be done? I had a need for that and in this entry, I describe a solution that worked for me.

  1. First of all export your bookmarks from the source profile to a JSON file (“Bookmarks → Show All Bookmarks → Import and Backup → Backup…”)

  2. Create a new Firefox profile in the machine of the target profile. (see this page for more information about Firefox profiles.).

  3. Import the bookmarks from the JSON file to it (while overriding the default bookmarks).

  4. Copy all the folders you want to merge to the system clipboard (Ctrl+C or equivalent).

  5. Paste them into the default profile’s bookmark manager.

Then all you need to do is sort them. Cheers!

Syndicated 2013-12-31 18:14:49 from shlomif

The GNU Project Will Integrate GNU Guile into GNU coreutils

Tel Aviv, Israel: the GNU (= “Guile N' UNIX”) project announced today that following the popular decision to integrate GNU Guile (= an implementation of the Scheme programming language) into GNU Make, it is going to integrate GNU Guile into the various tools inside GNU coreutils. So for example, GNU cat will have a "-g" flag that will allow embedding Scheme expressions, GNU echo will gain a similar flag, and GNU true and GNU false will allow evaluating Scheme expressions for truth or falsehood. It is not yet clear what functionality GNU head and GNU tail will gain by the integration.

O’Reilly Media announced that it will publish a new edition of its series of books, which includes Mastering cat and Mastering echo to cover the additional functionality provided by GNU Guile, and we will give an overview of the additional functionality in the usergroups of the cat mongers, the echo-chamberists, and the (GNU) true believers.

“If it’s not bloat, it’s not us.”, said Richard Stallman, the colourful head of the GNU project, and started to sing the Free Software song. Linus Torvalds was not available for comments about the proposal to integrate GNU Guile into the Linux kernel.

Syndicated 2013-11-13 12:41:50 from shlomif

E-mail Netiquette Resources, New Software, and BertycoX’s Music

Here are the recent updates for Shlomi Fish’s Homepage.

  1. There are some new factoids in the factoids pages, and many of them now have a Hebrew translation:

    • Chuck Norris does not keep any numbers on his mobile phone’s address book. Instead, he memorised the entire phone directory.

    • For all you know, you may not exist, and Chuck Norris convinced you that you do.

  2. There’s a new section with some articles about E-mail netiquette.

  3. The Hebrew version of “The Case for Drug Legalisation” is now at its third version, and was converted to DocBook 5/XML.

  4. There are new software pages for sky - a convient uploading interface, and Maniac Downloader, which is a download accelerator.

  5. There are new pages with Links against Adobe Flash and Links against TIOBE - The Test Index of Programming Languages’ Popularity.

  6. I have placed the music of BertycoX (originally from Jamendo) online.

  7. There’s a new page about “In the Event of My Death”.

  8. I’ve placed a very old snapshot of my home site (from 1998) online in a kind of Nostalgia.

Syndicated 2013-11-11 09:59:20 from shlomif

Tech Tip: How to Copy a Remote File on rsync.net

rsync.net is a good service (and a not too pricey one) for remote storage of data (for backups/etc.) based on open protocols and open source applications. One thing that bugged me there however, was that I couldn't find a way to copy a remote file to a different name, because the SFTP client does not support a copy operation, and because I could not get to a login shell by sshing my rsync.net account. Apparently, it's doable and not very hard.

What you need to do is type ssh my_account@somewhere.rsync.net cp [source filename] [destination filename] and it will run the remote UNIX "cp" command to copy the file. You can access some other remote UNIX commands like that such as "ls".

Hope it helps.

Syndicated 2013-10-26 12:14:54 from shlomif

Freecell Solver 3.22.0 was Released: Bug Fixes

Freecell Solver version 3.22.0, has been released. Freecell Solver 3.22.0 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 highlights of this version are some bug fixes: the Win32 NSIS (= Nullsoft Installer) package should now build, run and process the presets (e.g: -l as properly). Furthermore, there's a bug fix to the command line flags processing, where flags whose prefixes are known flags were erroneously recognised as such (e.g: --resetjunk vs. --reset).

On the new features side, the JavaScript-based solver now accepts arbitrary fc-solve command line options, so it can be used to solve any of the supported variants of Solitaire, as well as support most other fc-solve features.

Enjoy!

Syndicated 2013-10-07 17:29:00 from shlomif

706 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!