Autarchy of the Private Cave

Tiny bits of bioinformatics, [web-]programming etc

    Archive for the '*nix' Category

    How to relay outgoing postfix emails via another mail server (e.g. your ISP)

    4th December 2010

    Here’s a simple and clear guide for gmail, which also definitely works with other relay hosts. I’ve used it to configure my ISP’s mail relay (they block outgoing port 25) on a Debian Squeeze laptop.

    Share

    Posted in *nix, how-to, Links, Notepad, Software | No Comments »

    How to replace newlines with commas, tabs etc (merge lines)

    16th November 2010

    Imagine you need to get a few lines from a group of files with missing identifier mappings. I have a bunch of files with content similar to this one:

    ENSRNOG00000018677 1368832_at 25233
    ENSRNOG00000002079 1369102_at 25272
    ENSRNOG00000043451 25353
    ENSRNOG00000001527 1388013_at 25408
    ENSRNOG00000007390 1389538_at 25493

    In the example above I need '25353', which does not have corresponding affy_probeset_id in the 2nd column.

    It is clear how to do that:

    CODE:
    1. sort -u *_affy_ensembl.txt | grep -v '_at' | awk '{print $2}'

    This outputs a column of required IDs (EntrezGene in this example):

    116720
    679845
    309295
    364867
    298220
    298221
    25353

    However, I need these IDs as a comma-separated list, not as newline-separated list.

    There are several ways to achieve the desired result (only the last pipe commands differ):

    CODE:
    1. sort -u *_affy_ensembl.txt | grep -v '_at' | awk '{print $2}' | gawk '$1=$1' ORS=', '

    CODE:
    1. sort -u *_affy_ensembl.txt | grep -v '_at' | awk '{print $2}' | tr '\n' ','

    CODE:
    1. sort -u *_affy_ensembl.txt | grep -v '_at' | awk '{print $2}' | sed ':a;N;$!ba;s/\n/, /g'

    CODE:
    1. sort -u *_affy_ensembl.txt | grep -v '_at' | awk '{print $2}' | sed ':q;N;s/\n/, /g;t q'

    CODE:
    1. sort -u *_affy_ensembl.txt | grep -v '_at' | awk '{print $2}' | paste -s -d ","

    These solutions differ in efficiency and (slightly) in output. sed will read all the input into its buffer to replace newlines with other separators, so it might not be best for large files. tr might be the most efficient, but I haven't tested that. paste will re-use delimiters, so you cannot really get comma-space ", " separation with it.

    Sources: linuxquestions 1 (explains used sed commands), linuxquestions 2, nixcraft.

    Share

    Posted in *nix, Bioinformatics, how-to, Notepad, Software | No Comments »

    How to record Skype calls on Linux: use free Skype Call Recorder

    11th November 2010

    Just came across Skype Call Recorder - an awesome in its functionality+simplicity tool to record skype calls. Highly recommended!

    It worked immediately for me, and default settings are good enough not to bother tweaking. Well, I know that because I did tweak a few to get more nerdiness, but normal people don't need that.

    SCR download page has packages for Ubuntu, Debian/i386, Xandros, RPM-based distributions, Gentoo - and as its free, you can of course just use the fsource, Luke!

    At the time of writing, a package for Debian/amd64 was not available, but it is really easy to build one.
    Here's mine: skype-call-recorder-debian_0.8_amd64.deb

    Share

    Posted in *nix, Links, Software | No Comments »

    Linux server remote backup options

    3rd October 2010

    Recently I finally managed to configure remote (aka off-site) backup for my Debian server. As always, I started with a comparison of existing solutions.

    Debian has a number of packages enabling remote (over the network) backup: backupPC, backupninja, backup-manager, dirvish, duplicity, luckybackup, rdiff-backup, and some others.

    Read the rest of this entry »

    Share

    Posted in *nix, Links, Software | 1 Comment »

    Linux: how to label swap partition w/o losing swap UUID

    16th July 2010

    In short: sudo mkswap -L new_swap_label -U old_swap_UUID /dev/sd_swap_device.
    If you don't care about the UUID: just sudo mkswap -L new_swap_label /dev/sd_swap_device.

    Step-by-step:
    Read the rest of this entry »

    Share

    Posted in *nix, how-to | No Comments »

    Best Linux software to import still images from a digital camera

    2nd May 2010

    digikamBack in the times when Windows was my OS more than 75% of the time in front of the computer, I really liked a simple photos import utility, supplied for Canon digital still image cameras. It allowed the import of all the new media items (photos and movies) from a camera into a pre-configured location in one click, and it also automatically created date-based directories for new photos. Given the removable media autoplay feature, after connecting the camera it was really a matter of one click (or one button press) to have everything copied.

    Today, I decided to have a look at what the FOSS community has to match that simple and useful Canon utility. Here's my "rating":

    1. digikam: nice and easy import; supports date-based auto-creation of albums (directories); feature-reach, suitable as a primary images-viewing application; my personal "number one" for now.
    2. f-spot: easy import; has nice date-based photos browser; on import, converts photo filenames to lower case; my second choice, will have a closer look at its features.
    3. gThumb: good import, but haven't found a way to configure/create target directory during import.
    4. gtkam: unusual interface; while testing, it died once unexpectedly; otherwise easy to use.
    5. picasa: haven't tried to import with a recent version, but I generally dislike the idea of using software which requires an extra layer to run (wine in this case), unless it is unique. Picasa is not unique, and thus looses (in my opinion) to digikam.

    Related: list of 100 most useful open-source software tools.

    Share

    Posted in *nix, Software | No Comments »

    The list of Linux music players with CUE sheet support

    30th April 2010

    Last updated: 2011-12-13

    • Clementine music player
    • DeaDBeeF (as in 0xDEADBEEF) is an audio player for GNU/Linux systems with X11 (though now it also runs in plain console without X, in FreeBSD, and in OpenSolaris) with CUE sheets support
    • AudioPlayer51 is a free, open-source, cross-platform audio player written to handle FLAC files and CUE sheets (exclusively). If you don't use FLAC files and CUE sheets, you won't find AudioPlayer51 very useful.
    • Amarok: only for WAV+CUE, doesn't currently support FLAC+CUE; version 2.3.1 is promised to fully support CUE sheets
    • Audacious (through the .cue plugin)
    • QMMP (haven't tested this one)
    • XMMS through mp3cue (also untested)
    • foobnix (untested, suggested in this comment)
    • cueplay

    Some extra links:

    Share

    Posted in *nix, Links, Software | 6 Comments »