Autarchy of the Private Cave

Tiny bits of bioinformatics, [web-]programming etc

    An alternative to shared hosting

    4th June 2008

    Personal communication resulted in a link to slicehost, who provide VDS/VPS services at prices as low as 20$/mo, which is comparable in price to good shared hosting plans, and is cheaper than Dedicated plans.

    I’m considering a move from shared hosting, and found Slicehost attractive. For 20$/mo, you get guaranteed 256MiB RAM, 10GiB disk and 100GiB traffic, which is sufficient to host several under-1k-per-day sites.

    The only thing which isn’t spoken aloud is the guaranteed CPU speed. Based on the numbers provided: 16GiB total RAM per server, quad-core CPU, and CPU quotas set equivalently to RAM quotas, I came to a conclusion that 20$-plan guarantees ~125MHz of CPU (take 16 GiB, multiply by 4 20$-plans – you get 64 “slices” – virtual servers; quad core CPUs were quoted as 8+GHz – I assume that’s the sum of the core frequencies, thus 8GHz divided by 64 slices gives as little as 125MHz guaranteed per slice).

    The better slice you buy – the more CPU is guaranteed, so for 1024-RAM slice you’d have a minimum of 500MHz of CPU.

    However, slicehost describes their CPU-clamping system as the one allowing “bursted” performance, if others aren’t actively using their CPU shares. So it must be much better than what I’m calculating here. And even if it’s not, then for some applications it’s better to have a 125MHz-clamp on CPU, than have a 20-seconds maximal CPU time limit.

    Still, I’m looking for reasonably-priced collocation services in Ukraine – e.g. those (currently unavailable) from Volia, starting at 40$/mo for the rented physical VIA C7-based server with enough traffic included.

    Update: I now have my own server collocated in Ukraine. This blog still lives on a shared hosting, but I’m considering the move to own server (where I have the biomed half-dead site and resource-hungry COTRASIF tool).

    Share

    Posted in Hardware, Links, Notepad, Web | No Comments »

    Instructions on installing libmp3lame-enabled ffmpeg on shared linux hosting

    12th March 2008

    Note: this post is based on the comment by Simon, who generously shared his experience.

    Step-by-step:

    • Download the compiled ffmpeg with libmp3lame support (direct download links: older version ffmpeg.with.lame and newer version ffmpeg.2007-10-28.with-libmp3lame-support).
    • Rename the downloaded executable file to “ffmpeg” (no extension), upload it to the directory on your server (in this example /home/myusername/).
    • Download libmp3lame.so.0.
    • Upload libmp3lame.so.0 to the same directory where you placed ffmpeg in.
    • Create a php file with the following code (remember to change the paths to your own, where you actually uploaded binaries in previous steps):
      1. <?php
      2. exec("export LD_LIBRARY_PATH=/home/myusername/");
      3. echo passthru("/home/myusername/ffmpeg -formats");
      4. ?>
    • If you access that PHP file with your browser, you should be able to see a list of formats which are supported by ffmpeg, and if you find “EA libmp3lame” somewhere in the output, then it means you now can Encode Audio in libmp3lame!
    • If that doesn’t work for you: LD_LIBRARY_PATH can be a protected variable in PHP (you can check for this by searching for the “safe_mode_protected_env_vars” value in phpinfo() output). The workaround here can be to write your commands to a file from php, then chmod that file with 0755 permissions (rwx-rx-rx), and run the file through exec(). In this way, PHP is not changing the LD_LIBRARY_PATH, but telling the server to run a file, which tells the server to change it. This method worked for the original author of these instructions.

    For passing arguments to the PHP wrapper script – check out PHP’s $argv variable (more on this here). If you decided to use shell-script as a wrapper for “export LD_LIBRARY_PATH”, then using $1, $2 etc will allow you to pass parameters to the shell script, e.g. in the example below

    1. #!/bin/bash
    2. export LD_LIBRARY_PATH=/home/myusername/
    3. /home/myusername/ffmpeg -i /home/myusername/$1 $2 /home/myusername/$3

    you could pass “input file” as first argument, “parameters” as second and “output file” as third to make such a wrapper script work.

    Share

    Posted in *nix, PHP, Programming, Software, Web | 19 Comments »

    Using libmp3lame-enabled ffmpeg on shared hosting

    25th October 2007

    Update: there’s now a much more recent post on how to install libmp3lame-enabled ffmpeg on shared linux hosting.

    As Gabe pointed out in my post with compiled ffmpeg Linux binaries, there is a relatively simple method of adding libmp3lame.so.0 file to your shared hosting so that ffmpeg executable will see the library:

    You can upload libmp4lame.so as well to the shared hosting site and when you call ffmpeg, call something to set an environment variable right before the call to ffmpeg i.e. in php I’d do exec(”export LD_LIBRARY_PATH=/path/to/lib/with/lame; /path/to/ffmpeg [ffmpegargs]”); That way you can use the uploaded lame. I hope that helps someone as I have been unable to find any info on how to use an uploaded lame. I’ve tried it and it works on godaddy.

    Hope this helps.

    Update: here’s libmp3lame.so.0.0.0 (from slackware 2.4.x, lame-3.97). I have no idea if it’ll work in your (shared hosting) environment; it is provided AS IS, use at your own risk etc. I can only state that the archived binary file at the moment of upload was indeed libmp3lame.so.0.0.0 from my elderly Slackware with 2.4.x kernel.

    Share

    Posted in *nix, Software, Web | 9 Comments »