Category Archives: FOSS

Improve your shell experience with tmux & ConqueTerm

As a power text-mode user, I was both surprised and glad to hear (10x @erikzaadi!) about two interesting tools: tmux & ConqueTerm, which significantly changed the way I use the shell/terminal. I'll try to keep it short and to the point, and briefly explain the most notable behavior-changing features the way I see them. Or in other words: why should you give them a try.

tmux

tmux is screen-like. I didn't get to learn much of screen (absolutely my bad), so it's really not a "why tmux is better than screen" post, but simply what goodies does tmux provide.

tmux goodies: Continue reading

Introducing myip (no more ifconfig eye-grep!)

Complex tools for a simple task

It's common for us, users and admins, to check what is the ip of the host we are logged in to. Currently on Linux, this task is commonly done by the ip and ifconfig tools. However, I find them way too complex for the simple task of checking what's the IP. their output is full of confusing, irrelevant details, and they have tons of command-line arguments.

But you can pipe it all through grep, sed and awk!

Well... I'm not even going to explain why it isn't friendly.

myip for the rescue

So after I failed to find a simple tool for displaying IPs, I started writing it myself. Some command line samples: Continue reading

How I converted a VMware VM to KVM

There's lots of info on the net on achieving that, but I found it a bit too scattered, and had to combine instructions from multiple sources.

I'm not certain it's the right way, but it worked™. So I'll share, and get your feedback in case I've done anything stupid:

  1. Convert VMDKs (VM's disk), even when having multiple files,  to qcow2 format (note: QVM/QEMU should be able to deal with vmdk files (multiple as well?), so possibly this step is redundant):
  2. Convert the vmx (VM's settings) to xml (requires vmware2libvirt tool found in virt-goodies package)
  3. Continue reading

Network-Manager 0.9.2 WiFi password issues

I've noticed a few significant issues with Network Manager on GNOME 3.2, when connecting to WiFi networks that require password (e.g. WPA, EAP). Trying to find existing bug reports, I've found quite a mess: multiple bug reports, both downstream (Debian, Ubuntu, Fedora) and upstream (GNOME bugzilla).

I suspect many of these bugs are related to the same root cause (or max. 2-3 root causes). In order to try and make sense of this, I tried to categorize the bugs I've found. I hope it'll help to gather more info to resolve the bugs, and reject dups.

  1. NM (gnome applet?) forgets passwords:
    1. GNOME Bugzilla: [666465], [665431], [665503]
    2. Debian BTS: [651445], [646018]
    3. Ubuntu BTS: [904666]
    4. Mint forum post with a workaround
  2. NM takes too long to re-connect after resume (possibly problem in popping up the enter-password dialog box):
    1. GNOME: [664289],
    2. Debian: [651358], [653076]
  3. NM-gnome double password dialog box case:
    1. GNOME: [661208], [665503] - mentioned in 1st comment,
    2. Debian: [651097]

I'll try to update this post when new info arrives, please add your comments.

Generally speaking, I think that FOSS community lacks some "dirty-work" QA workforce for bug scrubbing, such as what I'm trying to do here. I don't even know how to name this non-coding activity. Thoughts? 🙂

Update1: This Linux Mint forum post suggests that only the applet "forgets" passwords.


pylint Vim plugin update (0.24.0 support)

[Executives' summary (in case any executive uses Vim) - get this updated pylint.vim for compatibility with pylint 0.24.0 changes] 

Integrating Python code checker into Vim is really cool. It lets Vim provide (relatively) quick feedback on your code, be it a conventions warning or syntax error. That, in my opinion, increases coding productivity slightly.

The problem is, that configuring the vim-pylint integration is hell. for two reasons mainly:

  1. Doing it manually requires understanding of the unpleasant errorformat syntax and some other vim tricks.
  2. No good zero-setup plugin is available: official pylint.vim is unmaintained. I used to use this fork, but its not really active anymore.

Specifically, since I upgraded to latest pylint (0.24.0),  Vim stopped showing pylint's hints. That's because pylint's output was modified to contain the column number as well.

I've re-forked it, and updated it to support pylint 0.24.0. Note that it will probably fail with older versions. Please try it and send feedback (you can comment this post if easier).

The mysterious case of broken SSH client (“connection reset by peer”)

Update: from the info I've gathered, this is most probably a problem with some Cisco IDS/DPI is running on the ethernet equipment. Workaround is available in the content below, I still don't know what's the real solution here (Cisco equipment config? update Cisco firmware?)

---

Starting with 5.7p1, ssh client on specific environments fails connecting to specific (usually old versioned) servers. I reproduced it on a particular network, while trying to connect using new ssh client (5.8p1, Ubuntu 11.04) to an old server (default SSH server on RedHat 5.4).

Motivation

This issue is around for quite a while, but is very tricky to reproduce or understand. What bothered me most is that many people reported it to different forums, each posting only a few (different) pieces of the puzzle. So my motivation here is to try and summarize the relevant info from multiple places. I'll do my best to update this post when I hear something new.

Complete Fact list Continue reading

Solution for Xsession + bash_completion problem

Update: just noticed that on a more advanced ~/.profile, I see it sourcing ~/.bashrc only if under bash (by using if [ -n "$BASH_VERSION" ]; ).

As Debian sid was just unfrozen due to Squeeze release, I recently get lots of package updates. I had the feeling that something is gonna break, even slightly, despite the relative high stability of Debian unstable.

And indeed, after 100+ updates, I could no longer login to GNOME. I'm not sure which package update caused this (bash_completion was updated to 1.3, yet the problem isn't necessarily there) . gdm nicely referred me to ~/.xsession-errors, which had something like:
sh: /etc/bash_completion.d/git: line 123: syntax error near unexpected token <'
sh: /etc/bash_completion.d/git: line 123:
done < <(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream) 2>/dev/null | tr '\0\n' '\n ')'
sh: _grub_mkpasswd-pbkdf2': not a valid identifier
sh:
_grub_script-check': not a valid identifier

I couldn't find any related Debian bug report, nor hardly anything on the internet (just some Arch Linux bugs with no clear solution).

Eventually I've found out that /etc/gdm/Xsession uses /bin/sh (a crippled shell, even though it's a symlink to /bin/bash), which indeed fails with the same error when running 'source /etc/bash_completion'. This makes sense. bash_completion[*] should be bash-compatible, and may include bash-only non-standard-shell compliant syntax.

Wondering why Xsession gets to run ~/.bash_completion indirectly, I've found that I had the following two abominations:

  • 'source ~/.bashrc' command in ~/.xsession
  • 'source ~/.bashrc' command in ~/.profile

I'm not sure why I had these lines, but they shouldn't be there. Bash itself and only bash should source ~/.bashrc (and it's done automatically when bash starts). It makes no sense for other shells to source it.

So the solution was simply removing these lines from ~/.profie and ~/.xsession (actually got rid of ~/.xsession completely). Still, I'm not sure which update triggered this problem.

----

* Actually the problem was in /etc/bash_completion/git which is a part of the 'git' package and not the 'bash-completion' package. But all the same.

Configuring ctags for Python and Vim

Exuberant ctags is a cool, language-agnostic tool for creating tag files for your source code. Nice editors such as Vim, could use these tag files to implement the much needed 'jump to definition' feature.

Ctags is awesome, it supports Python, and is supported by Vim. It seems that the world is perfect and there's no reason to write a post about configuring it. Well... almost.

ctags has a little downside when using Python: it recognizes import lines as a definition, at least as of ctags v5.8. No need to explain why it's annoying in most cases. After 2 years of suffering, I've found it's possible to overcome this simply by adding the --python-kinds=-i option to the command line, or better: to ~/.ctags.

And just to make it complete, a quick cookbook style for setting everything up and using:

  1. Install ctags
    e.g. aptitude install exuberant-ctags
  2. Configure ctags.
    Add to ~/.ctags the following, one option per line:

    1. --python-kinds=-i
    2. optional: --exclude=<partial names of bad files/directories>. e.g. --exclude=*/build/* to exclude all files inside 'build/' directories
  3. Add a cron to rebuild tags, for instance:
    1 * * * * ctags -R -o ~/mytags ~/src
  4. Configure vim:
    add to ~/.vimrc: :set tags=~/mytags
  5. Use Vim:
    1. vim -t <tag name> to open vim straight on the tag
    2. Ctrl+] to jump to tag when over a word
    3. Ctrl+T to pop back
    4. :tselect or :stselect to open
    5. :tnext, :tprev to go to next/prev tag finding
    6. :help tags for more 🙂

Debian: nfs-kernel-server is broken (Or: portmap to rpcbind transition)

UPDATE: rpcbind-0.2.0-3 was just released, and it solves all the rpcbind issues.

UPDATE2: THE BUG WAS SOLVED! Alexander Wirt patched nfs-kernel-server: by removing the linkage of libtirpc, it now uses the previously method of IPv4 binding, thus not triggering the problem. When/if would rpcbind replace portmap - I don't know.

[ This article describes my analysis to a problem found in Debian Unstable(sid) ]

1. The bug (link)

Since the end of December, a change in nfs-kernel-server package caused a change of behavior in some NFSv3 crucial services: rpc.statd, rpc.mountd. NFS is RPC-based, and as thus, it uses an RPC-to-UDP/TCP address translation service, aka port mapper. These services try to connect to port mapper when they need address translation, and since the recent change they first try to do it over IPv6.

portmap, the current widely-used rpc port mapper service, does not support IPv6. This causes these crucial services to die, and NFSv3 fails to start (actually, with default configuration it even prevents starting an NFSv4 server).

2. So... rpcbind?

Continue reading

y2k10 bug: spamassassin might tag mail as spam

[ This is bug affects only to people using the spamassassin spam filtering software ]

Fabian Arrotin reports about this spamassassin bug, which tags mails dated 2010 and later - as potential spam (increases its spam-score). This is not silly - many spammers use fictional (far past/future) dates, wishing their spam would stay in the top/bottom of the long list of mails.

This bug alone didn't cause false positives in my spam folder (only increased the score from 0.0 to 0.6), but in some configurations or situations it could happen.

The Fix

Continue reading