Skip to content

Instantly share code, notes, and snippets.

@yath
yath / check-kd-stations
Created August 28, 2011 07:31
Watch for changes in Kabel Deutschland's analog TV channel assignment
#!/bin/sh
MYDIR="$(dirname "$(readlink -f "$0")")"
OUTFILE="$HOME/kd-stations.txt"
if [ -e "$OUTFILE.new" ]; then
echo "$OUTFILE.new already exists" >&2
exit 1
fi
"$MYDIR/kdinfo" > "$OUTFILE.new"
#!/usr/bin/perl
use strict;
use warnings;
sub WINDOWS() { $^O eq "MSWin32" }
use Inline C => "DATA",
CCFLAGS => "-W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-comment",
BUILD_NOISY => 1,
WINDOWS ?
@yath
yath / alp
Created September 9, 2011 08:40
#!/usr/bin/perl
use strict;
use warnings;
use 5.012.0;
my $dir;
my $file;
my %x;
while (<>) {
chomp;
#!/usr/bin/perl
use strict;
use warnings;
sub WINDOWS() { $^O eq "MSWin32" }
use Inline C => "DATA",
CCFLAGS => "-W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-comment",
BUILD_NOISY => 1,
WINDOWS ?
scanning /usr/share/dvb/dvb-c/de-Muenchen
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
initial transponder 113000000 6900000 0 3
initial transponder 121000000 6900000 0 3
initial transponder 346000000 6900000 0 3
initial transponder 354000000 6900000 0 3
initial transponder 362000000 6900000 0 3
initial transponder 370000000 6900000 0 3
initial transponder 378000000 6900000 0 3
initial transponder 386000000 6900000 0 3
@yath
yath / scan.txt
Created September 20, 2011 09:49
scanning de-Muenchen
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
initial transponder 113000000 6900000 0 3
initial transponder 121000000 6900000 0 3
initial transponder 346000000 6900000 0 3
initial transponder 354000000 6900000 0 3
initial transponder 362000000 6900000 0 3
initial transponder 370000000 6900000 0 3
initial transponder 378000000 6900000 0 3
initial transponder 386000000 6900000 0 3
@yath
yath / patch.c
Created September 20, 2011 18:14
/* As the memmem() fuction is ripped off the GNU C Libary:
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@yath
yath / patch.c
Created September 20, 2011 18:15
/* As the memmem() fuction is ripped off the GNU C Libary:
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#!/bin/sh
# managed by Class['common::sleeperservice']
#
# sleep some time before running cron jobs
sleep <%= delay %>m
@yath
yath / sendmail.sh
Created April 7, 2013 06:09
smartd mail script
#!/bin/sh
# send smartd mail plus serial and smartctl -a.
# usage: -m root -M exec /path/to/this/script
# test with: -m root -M exec /path/to/this/script -M test and smartctl -q onecheck afterwards.
tempfile=$(mktemp)
# message is passed via stdin
cat > $tempfile