Skip to content

Instantly share code, notes, and snippets.

View patch.sh
#!/bin/sh
URL="https://gist.githubusercontent.com/yath/1c7b8f497b869e9070d5/raw/5fee4133fc11bcb96d07467754fef551aea32160/stripenv.c"
OUT=/usr/local/lib/stripenv
set -e
test_vuln() {
dir="$(mktemp -d)"
cd "$dir"
env ohai='() { echo pwned; }' X='() { (a)=>\' bash -c "echo ohai" > /dev/null 2>&1
if grep -qw pwned echo 2>/dev/null; then rc=0; else rc=1; fi
@yath
yath / sssh
Last active Aug 29, 2015
sssh - sane(r) ssh
View sssh
#!/bin/sh
# sssh - sane(r) ssh
#
# executes a remote command (more) sanely by passing the arguments url-like
# escaped (foo%23bar for "foo#bar") and unpacking them on the remote side
# with perl again.
if [ "$#" -lt 2 ]; then
echo "Usage: $0 <host> <command> [arguments...]" >&2
exit 1
@yath
yath / check-kd-stations
Created Aug 28, 2011
Watch for changes in Kabel Deutschland's analog TV channel assignment
View check-kd-stations
#!/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"
View keeweasel.pl
#!/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 ?
View alp
#!/usr/bin/perl
use strict;
use warnings;
use 5.012.0;
my $dir;
my $file;
my %x;
while (<>) {
chomp;
View keeweasel.pl
#!/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 ?
View stations.txt
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
View scan.txt
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
View patch.c
/* 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
View patch.c
/* 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
You can’t perform that action at this time.