Autarchy of the Private Cave

Tiny bits of bioinformatics, [web-]programming etc

    • Archives

    • Recent comments

    Archive for the 'Software' Category

    tudu: a beautiful ncurses to-do list application

    11th October 2011

    tudu is just what it says in the title, and is written in C.
    All the functions are mapped to keys. Extremely flexible: you can use it either as a simple to-do list, or utilize a bunch of optional features (priorities, schedules, deadlines, categories, tags, maybe something else).

    If you (like me) love ncurses – you will love tudu :) Just give it a try.


    Screenshot copyright: Ruben Pollan (tudu author).

    Share

    Posted in *nix, Software | No Comments »

    Good advice: /bin/false is not security

    1st October 2011

    SSH Security and You – /bin/false is *not* security.

    Share

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

    Phusion Passenger Apache users guide

    14th August 2011

    Phusion Passenger Apache users guide

    Also as a PDF.

    Share

    Posted in Links, Notepad, Software | No Comments »

    How to remotely convert live 1xHDD/LVM Linux server to 2xHDD RAID1/LVM (GRUB2, GPT)

    17th May 2011

    Assumptions:

    • current HDD is /dev/sda, it has a GPT (with bios_grub being /dev/sda1), separate /boot partition (/dev/sda2), and a physical LVM volume (/dev/sda3), where LVM holds all the remaining partitions (root, /home, /srv, …); LVM is properly configured, and system reboots with no problems
    • your new drive is /dev/sdb, it is identical to /dev/sda, and it comes empty from the manufacturer (this is important! wipe the drive if it is not empty, especially if it used to be a part of another RAID)
    • your system is Debian or Debian-based; in this exact example I’ve been using Ubuntu Server 10.04
    • your LVM volume group is named vg0
    • make sure you understand what each command does before executing it
    • you do have an external backup of all your important data, and you do understand that the following operations are potentially dangerous to your data integrity

    Inspired by: Debian Etch RAID guide, serverfault question.
    Read the rest of this entry »

    Share

    Posted in *nix, how-to, Software | 6 Comments »

    Generate .mood moodbar files for your whole music collection

    10th April 2011

    Amarok moodbar wiki page has 2 nice scripts to generate .mood files for your whole music collection (to be displayed by amarok when playing).

    Read the rest of this entry »

    Share

    Posted in *nix, Links, Notepad, Software | 3 Comments »

    Debunking the widespread myth of 2^32=4GB being the architectural limit

    10th April 2011

    Quite a number of people are aware of the PAE which can extend the addressable space from 32bit up to 36-48-52bit (depending on the implementation; as I understand, Windows PAE extends to 36 bits, or 64GB of addressable space). However, overwhelming numbers of internet pages continue insisting that a not-more-than-4GB limit for the 32bit Windows is the consequence of 2^32 = 4GB architectural limit.

    There is an excellent, in-depth, well-argumented article by Geoff Chappell on the issue. Highly recommended in its entirety to those who want a complete understanding (additional side-reading and facts verification might be necessary).

    A single citation to get you started:

    There is already on the Internet and elsewhere an awful lot of rubbish to read about this question. Hardly any of it would be worth citing even if I didn’t want to spare the authors the embarrassment. A surprising number of people who claim some sort of attention as expert commentators would have you believe that using more than 4GB of memory is mathematically impossible for any 32-bit operating system because 2 to the power of 32 is 4G and a 32-bit register can’t form an address above 4GB. If nothing else, these experts don’t know enough history: 2 to the 16 is only 64K and yet the wealth of Microsoft is founded on a 16-bit operating system that from its very first version was designed to use 640KB of RAM plus other memory in a physical address space of 1MB. Some remember this history and add seemingly plausible qualifications that exceeding 4GB is possible only at the price of nasty hacks that require everyone—well, all programmers—to jump through hoops. Fortunately, Intel’s processors are a lot more advanced than the 8086 from all those years ago.

    P.S. Unfortunately, patching the kernel won’t help make Windows XP see more than 4GB RAM: even though the kernel itself does support more RAM (with PAE), starting with SP2 the HAL was modified in a way prohibiting access to any RAM beyond 4GB. Patching may only be suggested to devoted geeks with Vista’s and 7′s.

    Share

    Posted in Hardware, Links, Misc, Software | No Comments »

    rtorrent-enhanced with ipfilter and GeoIP: Debian Squeeze amd64 package

    1st April 2011

    rtorrent-eyecandy
    rtorrent is an excellent ncurses rtorrent client.

    There are a few highly-popular patches, which haven’t yet made it into the Squeeze’s rtorrent version 0.8.6.

    Note: ArchLinux already has an rtorrent-extended package, so you may want to look at that one (instead of my Debian package below). I might use Arch’s patchset next time to generate a truly extended rtorrent package.

    I’ve incorporated 3 of such patches (#239 ipfilter, #2064 GeoIP support, and #2171 colours/eyecandy), and built a squeeze amd64 rtorrent-enhanced package.

    A few excerpts to explain how these extra features are to be configured and used (all come from the above-mentioned trac tickets, some were edited/extended).

    ipfilter

    ipfilter allows to selectively blacklist/whitelist peers – based on IP address range files (so-called ipfilter files). The ipfilter files may, for example, come from bluetack.co.uk. Each line of the file contains a record in this format: range_description:start_IP-end_IP, where start_IP should be less than or equal to end_IP. Multiple files can be used. Overlapping ranges are merged automatically. Both incoming and outgoing connections are checked against the filter. Exclusions are not supported, so connection to/from IPs in all the loaded ranges will be disallowed and dropped.

    Include “ip_filter=” directive in .rtorrent.rc. For example (paths are specified relative to user’s home directory):
    ip_filter=ipfilter/level1,ipfilter/level2

    It is probably a good idea to reload ipfilter files once in a while, so you can also include “reload_ip_filter” directive on schedule to refresh the filter. The same files named in “ip_filter” will be reloaded.

    schedule = filter,18:30:00,24:00:00,reload_ip_filter=

    To support the feature you may want to setup cron job to reload and unzip files from bluetack. Examples here and here.

    GeoIP

    In the Peers view of each torrent a new column – CC, country code – is added, which shows peer’s country code. When examining each peer, you will see more data from the GeoIP database (if you have the relevant files installed): AS num and city. At the very least, you need to have geoip-database installed. You can get free “lite” versions of city/AS-databases, rename them (removing “lite”) and put into an appropriate location to make rtorrent+geoip use them as well. Geop-isp data support isn’t integrated into this rtorrent package.

    Colours

    This patch somewhat changes the way rtorrent shows torrents. Seeding torrents have bold titles, there are no half-displayed torrents at the top/bottom when scrolling, and you can configure colours for active/done torrents (ticket libtorrent.rakshasa.no/ticket/1382, which seems to be gone now). Source code and testing hint at these configurable colours: done_fg_color, done_bg_color, active_fg_color, active_bg_color, and at these possible values: 1 (red), 2 (green), 3 (yellow).

    Geek’s cellar
    A related (though not used in any way for the preparation of the package) resource is rtorrent mods page.

    Relatively schematically, applying patches and building the package was performed in these steps (starting within some newly-created directory):

    1. sudo aptitude install cdbs devscripts [and whatever else you find you're missing]
    2. apt-get source rtorrent
    3. dpkg-source -x rtorrent_0.8.6-1.dsc
    4. cd rtorrent-0.8.6
    5. cdbs-edit-patch 01-ipfilter.patch
    6. patch -p1 < /path/to/patch/239
    7. exit 0
    8. cdbs-edit-patch 02-geoip.patch
    9. patch -p1 < /path/to/patch/2064-after-ipfilter
    10. exit 0
    11. cdbs-edit-patch 03-eyecandy.patch
    12. patch -p1 < /path/to/patch/2171-mod-with-canvas
    13. exit 0 [you could do all 3 patches together, but I prefer cleaner and manageable approaches]
    14. [some weird operation to be explained below]
    15. dpkg-buildpackage

    Weird operation: I didn’t know how to make dpkg-buildpackage run autorun.sh (which is required for one of the patches I’ve used) before configure (could someone enlighten me how to do that?), so I started a new patch with cdbs-edit-patch, then ran one by one `autoreconf -if`, `./autorun.sh`, `./configure`, exited with zero status and was done with that problem. The resulting “patch” was 2MB large :)

    Share

    Posted in *nix, Software | No Comments »