Autarchy of the Private Cave

Tiny bits of bioinformatics, [web-]programming etc

    • Archives

    • Recent comments

    Archive for March, 2009

    Linux: how to remove trailing ^M (carriage return)

    30th March 2009

    Imagine you have some styles.css transferred from Win machine to Linux via FTP in binary mode instead of ASCII mode; then

    cat styles.css | tr -d "\r" > styles-nocarriage.css

    will create styles-nocarriage.css with ^M’s removed.

    Alternative syntax:

    tr -d "\r" < styles.css > styles-nocarriage.css

    Most editors have global replace features which allow to get rid of control characters using regular expressions (exact instructions are editor-specific).

    For multiple files, try this:

    for f
    do
    mv $f ${f}~ && tr -d "\r" <${f}~ >$f
    rm ${f}~
    done

    Save this shell script as a file (e.g. dos2unix.sh), then do ./dos2unix.sh . This script accepts wildcards (e.g. ./dos2unix.sh *.php), so be careful!

    Share

    Posted in *nix, how-to, Notepad | 3 Comments »

    How to create custom Affymetrix CDF file

    23rd March 2009

    First, learn about custom CDFs and why they are needed.

    The aroma.affymetrix R package google group has a how-to: create a CDF annotation file from scratch.

    Also useful: how to convert CDF into an R package, which has all CDF data available (as a PDF with more details).

    Share

    Posted in how-to, Links, Science | No Comments »

    Intel i915 integrated graphics under Debian: how to get rid of sluggish 2D performance

    2nd March 2009

    I assume you already have configured and working desktop environment, but want to improve performance.

    First of all, sudo aptitude install mesa-utils. Then run in a Terminal/Konsole glxgears, and wait for ~15 seconds; if your FPS is ~400 or less, then you do have sluggish video performance (usually manifesting itself as slow scrolling in Firefox/Iceweasel, slow window switching/minimziing/maximizing etc).

    After reading through several forums and bug reports and blog posts, I’ve ended with the following modifications to my /etc/X11/xorg.conf:
    Read the rest of this entry »

    Share

    Posted in *nix, Hardware, how-to | 5 Comments »