Tech Tip: add a notification (or any other command) after a command-line task has ended

I discovered that one can add a notification after a command you've alreadystarted running has ended on a UNIX system by suspending the commandusing “Ctrl + Z” and then typing something like“fg ; n --msg 'Command finished'” (where “n” is the command I use fornotifications). “fg” brings a job to the foreground, and for more informationabout it seeits wikipediaentry and the Unix Background Jobs entry on thegeekstuff.com.

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:

Go to ~/.local/share/applications.

Backup this directory somewhere safe.

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.

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.

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).

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:

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.

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!

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.

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.

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.

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.

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

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

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

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

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.

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".