ceph - sort osds by utilisation

Posted on Thu 20 September 2018 in Ceph • Tagged with ceph, crush, linux, notepad, code • 1 min read

Version 1: keep it simple

$ ceph osd df  | awk '{ print "osd."$1, "size: "$5, "usage: " $8 }' | sort -nk5

OSDs can be listed twice - depends on the crushmap.

Version 2: json + python

$ ceph osd df tree -f json | python sort_hdd_osds.py
osd.28  utilization: 15.278888
osd.15  utilization: 19.700484 …

Continue reading

ARD (Video)-Podcast Downloader

Posted on Wed 24 November 2010 in Linux • Tagged with Linux, Perl, Code • 1 min read

#!/usr/bin/perl -w
#
# ARD tagesschau podcast url
$url = "http://www.tagesschau.de/export/video-podcast/webl/tagesschau/";
#
# wget parameter
$wgetopts = "--quiet";
$targetpath = "/tmp";
#
# Enable verbose output
$verbose = 0;
#
#############################

use XML::Simple;
use LWP::Simple;

sub output{
        my $msg = shift;
        if ($verbose) { printf STDERR "$msg\n"; }
}

$xmlcontent = get($url);

my $xml …

Continue reading