From 60cb01f9a81c311f914aed4a23e8e5b35e965918 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sat, 11 May 2013 13:27:07 +0200 Subject: soem more cleanup Signed-off-by: Florian Pritz --- abuse.pl | 30 -- bashrun.sh | 106 ----- cgrep | 3 + check-mail-addr.pl | 51 --- check-mail-addr.sh | 3 + convert2mp3 | 27 -- convert2ogg | 27 -- fb-client-up | 29 ++ info.pl | 285 ------------- kernelver.py | 10 - logos.pl | 37 -- machine-update | 1108 ------------------------------------------------- mailq-recipient | 12 + mkmaildir | 8 - nomde.pl | 359 ---------------- ompload | 4 - pg_list_updater.sh | 28 -- qt-faststart.c | 315 -------------- reformat_fstab.pl | 70 ---- revdepwalk | 1 - send-link-to-phone.sh | 3 - shell2html | 19 - slowloris.pl | 467 --------------------- smtp-cli | 814 ------------------------------------ tempfs.sh | 17 - update_checker.sh | 25 -- upload-image.sh | 13 - woof | 429 ------------------- xup.sh | 29 -- 29 files changed, 47 insertions(+), 4282 deletions(-) delete mode 100755 abuse.pl delete mode 100755 bashrun.sh create mode 100755 cgrep delete mode 100755 check-mail-addr.pl create mode 100755 check-mail-addr.sh delete mode 100755 convert2mp3 delete mode 100755 convert2ogg create mode 100755 fb-client-up delete mode 100755 info.pl delete mode 100755 kernelver.py delete mode 100644 logos.pl delete mode 100755 machine-update create mode 100755 mailq-recipient delete mode 100755 mkmaildir delete mode 100644 nomde.pl delete mode 100755 ompload delete mode 100755 pg_list_updater.sh delete mode 100644 qt-faststart.c delete mode 100755 reformat_fstab.pl delete mode 120000 revdepwalk delete mode 100755 send-link-to-phone.sh delete mode 100755 shell2html delete mode 100755 slowloris.pl delete mode 100755 smtp-cli delete mode 100755 tempfs.sh delete mode 100755 update_checker.sh delete mode 100644 upload-image.sh delete mode 100755 woof delete mode 100755 xup.sh diff --git a/abuse.pl b/abuse.pl deleted file mode 100755 index 42e31a4..0000000 --- a/abuse.pl +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/perl -use warnings; -use strict; -use File::Basename; -use Net::IP; -use Net::DNS; - -my $abusednsbl = "abuse-contacts.abusix.org"; - -if (@ARGV == 0) { - print "usage: ", basename($0), " IP ...\n"; - exit 1; -} - -my $res = Net::DNS::Resolver->new; - -for my $host (@ARGV) { - my $IP = $host; - - my $ip = new Net::IP ($IP); - my $querystring = $ip->reverse_ip().$abusednsbl; - $querystring =~ s/\.in-addr\.arpa//; - my $query = $res->query($querystring, "txt"); - if ($query) { - print (($query->answer)[0]->rdata, "\n"); - } else { - print "no abuse address for $IP\n"; - exit 1; - } -} diff --git a/bashrun.sh b/bashrun.sh deleted file mode 100755 index b571a52..0000000 --- a/bashrun.sh +++ /dev/null @@ -1,106 +0,0 @@ -#!/bin/bash -# -# usage: bashrun [geometry] (default: 40x1) -# -# NOTE: commands entered will have an '&' appended before being run, -# so don't append it yourself, it will fail silently. -# -# rcfile: $HOME/.bashrunrc -# -# --------------------------------------------------------------------- - -GEOM=${1:-40x1} - -# create .bashrunrc unless present -BASHRUNRC=$HOME/.bashrunrc -if [ ! -f $BASHRUNRC ]; then -( -cat <<'EOF' -# which X terminal to use: -# (xterm|rxvt|urxvt|mrxvt|aterm|mlterm) -XTERM=urxvtc - -# history file and options: -HISTFILE=$HOME/.bashrun_history -HISTCONTROL=ignoredups:erasedups - -# bind to menu-complete. Makes cycle through completions on -# the current line instead of paging all possible completions -bind '"\t": menu-complete' - -# bind to send ^D -# ( is the default quit-chain-key in emacs, ratpoison, etc) -bind '"\C-g"':"\"\x04\"" - -# set a simple prompt -PS1=">" - -# ***DO NOT EDIT BEYOND THIS LINE*** -# -# bind ENTER to add ' &' to command -bind '"\x0d"':"\" &\n\"" -EOF -) > $BASHRUNRC -fi - -. $BASHRUNRC - -error() { - if [ `which zenity` ]; then - zenity --title bashrun --error --text "$@" - elif [ `which kdialog` ]; then - kdialog --title bashrun --error "$@" - elif [ `which xmessage` ]; then - xmessage "$@" - fi - echo -en "\007" - echo $@ -} - -# run bash terminal -if [ "$XTERM" = "xterm" ]; then - $XTERM -name 'bashrun' \ - -title 'bashrun' \ - -geometry $GEOM \ - -e "/bin/bash --rcfile $BASHRUNRC -i -t" - -elif [[ "$XTERM" = "aterm" || "$XTERM" = "mlterm" ]]; then - $XTERM -name 'bashrun' \ - -title 'bashrun' \ - -geometry $GEOM +sb \ - -e /bin/bash --rcfile $BASHRUNRC -i -t - -elif [[ "$XTERM" = "urxvt" || "$XTERM" = "rxvt" ]] || [ "$XTERM" = "urxvtc" ]; then - $XTERM -name 'bashrun' \ - -title 'bashrun' \ - -geometry $GEOM \ - -e sh -c "/bin/bash --rcfile $HOME/.bashrunrc -i -t" - - -elif [ "$XTERM" = "mrxvt" ]; then - $XTERM -name 'bashrun' \ - -title 'bashrun' \ - -geometry $GEOM +sb -ht \ - -e sh -c "/bin/bash --rcfile $BASHRUNRC -i -t" -else - error "$XTERM is not supported. Please check $BASHRUNRC" - exit 1 -fi - -# history cleanup... -# remove trailing whitespace and '&' from the last history line -tac $HISTFILE | sed "1s/\&//;s/ *$//" | tac > $HISTFILE - -# HISTCONTROL won't work on its own because bash applies the -# 'ignoredups' and 'erasedups' rules to 'command &'. - -# apply 'ignoredups' if set -if [[ "$HISTCONTROL" =~ "ignoredups" || "$HISTCONTROL" =~ "ignoreboth" ]]; then - uniq $HISTFILE $HISTFILE.tmp - mv $HISTFILE.tmp $HISTFILE -fi - -# apply 'erasedups' if set -if [[ "$HISTCONTROL" =~ "erasedups" ]]; then - tac $HISTFILE | gawk '!x[$0]++' - | tac > $HISTFILE -fi diff --git a/cgrep b/cgrep new file mode 100755 index 0000000..a99edb3 --- /dev/null +++ b/cgrep @@ -0,0 +1,3 @@ +#!/bin/sh + +grep "$@" | ccze -A diff --git a/check-mail-addr.pl b/check-mail-addr.pl deleted file mode 100755 index 4aa1d0b..0000000 --- a/check-mail-addr.pl +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/perl -use warnings; -use strict; -use IO::Socket::INET; -use File::Basename; -use Net::Domain qw(hostfqdn hostdomain); -use Net::DNS; -use Data::Dumper; - -if(@ARGV < 1) { - print "usage: ", basename($0), " []\n"; - exit; -} - -autoflush STDOUT 1; - -sub post { - my $socket = shift; - my $command = shift; - my $ret; - - print " >> $command"; - print $socket $command; - while ($ret = $socket->getline) { - print "<< ".$ret; - $ret =~ /[0-9]([- ]).*/; - last if ($1 eq " "); - } - -} - -my $email = $ARGV[0]; -my $from = $ARGV[1] ? $ARGV[1] : ""; -$email =~ m/.*@(.*)/; -my $domain = $1; - -print "Getting MX for $domain\n"; -my @mx = mx($domain); - -print "Connecting to ".$mx[0]->exchange."\n"; -my $socket = IO::Socket::INET->new( - PeerAddr => $mx[0]->exchange, - PeerPort => 25, - Proto => "tcp") || die "Error: couldn't create socket."; - -print "<< ".$socket->getline; -post $socket,"EHLO ".hostfqdn()."\r\n"; -post $socket, "MAIL FROM:<$from>\r\n"; -post $socket, "RCPT TO:<$email>\r\n"; -post $socket, "QUIT\r\n"; - diff --git a/check-mail-addr.sh b/check-mail-addr.sh new file mode 100755 index 0000000..0b358a6 --- /dev/null +++ b/check-mail-addr.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +swaks -q to -f "<>" -t $1 diff --git a/convert2mp3 b/convert2mp3 deleted file mode 100755 index 26c65a8..0000000 --- a/convert2mp3 +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -#---------------------------------------------------- -# Version: 0.1.0 -# Author: Florian "Bluewind" Pritz -# -# Licensed under WTFPL v2 -# (see COPYING for full license text) -# -#---------------------------------------------------- -# Converts a number of files provided on the command line to MP3 -#---------------------------------------------------- - -for i in "$@"; do - pushd . &> /dev/null - cd "$(dirname "$i")" - - file="$(basename "$i")" - file_mp3="$(echo ${file} | sed 's/\(.*\)\..*/\1/').mp3" - tmpfile="$(mktemp)" - - mplayer -ao pcm:fast -novideo -vc null -vo null -ao pcm:file="$tmpfile" "$file" - lame -h "$tmpfile" "$file_mp3" - - rm "$tmpfile" - - popd &> /dev/null -done diff --git a/convert2ogg b/convert2ogg deleted file mode 100755 index ec49617..0000000 --- a/convert2ogg +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -#---------------------------------------------------- -# Version: 0.1.0 -# Author: Florian "Bluewind" Pritz -# -# Licensed under WTFPL v2 -# (see COPYING for full license text) -# -#---------------------------------------------------- -# Converts a number of files provided on the command line to OGG -#---------------------------------------------------- - -for i in "$@"; do - pushd . &> /dev/null - cd "$(dirname "$i")" - - file="$(basename "$i")" - file_ogg="$(echo ${file} | sed 's/\(.*\)\..*/\1/').ogg" - tmpfile="$(echo ${file} | sed 's/\(.*\)\..*/\1/').wav" - - mplayer -ao pcm:fast -novideo -vc null -vo null -ao pcm:file="$tmpfile" "$file" - oggenc -q 5 "$tmpfile" - - rm "$tmpfile" - - popd &> /dev/null -done diff --git a/fb-client-up b/fb-client-up new file mode 100755 index 0000000..1bbf273 --- /dev/null +++ b/fb-client-up @@ -0,0 +1,29 @@ +#!/bin/bash + +set -e + +branch="${1:-master}" + +TMPDIR="`mktemp -d "/tmp/fb-client-up.XXXXXX"`" +trap "rm -rf '${TMPDIR}'" EXIT TERM + +cd "$TMPDIR" +git clone ~/git/fb . +git checkout "$branch" + +VERSION="$(make version)" + +git tag --verify "v$VERSION" + +echo "==> Building release tarball" +make dist +echo "==> Building finished" + +gpg --detach-sign "dist/fb-$VERSION.tar.gz" +scp "dist/fb-$VERSION.tar.gz" dist/fb-$VERSION.tar.gz.sig web-filebin@karif:public_html/data/client + +if [[ $branch = "master" ]]; then + ssh web-filebin@karif echo "$VERSION" \> public_html/data/client/latest +fi + +echo "released version: $VERSION" diff --git a/info.pl b/info.pl deleted file mode 100755 index d29aa95..0000000 --- a/info.pl +++ /dev/null @@ -1,285 +0,0 @@ -#!/usr/bin/perl -# @title : Theme info script 0.1.2 revisited -# @author: rab -# @date : 08/04/08 -# @commnt: Maybe if people quit forking the hell outta this, it would be easier to maintain - -## Configurations -# On = 1. Off = 0 -my %display = ( - "OS" => 1, # Displays the operating system's name - "KL" => 1, # Displays your kernel version - "DE" => 0, # Displays your desktop environment, if you have one - "WM" => 1, # Displays your window manager - "WMT" => 1, # Displays your window manager's theme - "IC" => 1, # Displays your icon theme, if you have one - "FN" => 1, # Displays your font - "UI" => 1 # Displays your UI theme - ); - -# The command to execute for taking a screenshot -# Escape ' with a backslash, \' -# Leave blank if you don't want a screenshot taken -#my $screenshot = 'scrot screen-%H-%M-%S.png -e \'mv $f ~/media/screens/\''; -my $screenshot = ''; - -# The Color to use for the variables, needs to be global for logos.pl -@colors = ( "\e[38;0;33m", "\e[38;1;37m", "\e[m" ); - -# Debugging -my $debug = 1; -## End of configuration - -######################## -## Script starts here ## -######################## -@distros = (); -require '/home/flo/bin/logos.pl'; - -my $nocolor = "\e[0m"; -my @info = (); -my ($DE,$WM,$theme,$icon,$font,$cscheme) = ""; -my $distro = &distro; - -## Hash of WMs and the process they run # -my %WMlist = ("Beryl" => "beryl", - "Fluxbox" => "fluxbox", - "Openbox" => "openbox", - "Blackbox" => "blackbox", - "Xfwm4" => "xfwm4", - "Metacity" => "metacity", - "Kwin" => "kwin", - "FVWM" => "fvwm", - "Enlightenment" => "enlightenment", - "IceWM" => "icewm", - "Window Maker" => "wmaker", - "Compiz-Fusion" => "compiz", - "PekWM" => "pekwm", - "Awesome" => "awesome", - "Dwm" => "dwm" ); - -## Hash of DEs and the process they run ## -my %DElist = ("Gnome" => "gnome-session", - "Xfce4" => "xfce-mcs-manage", - "KDE" => "ksmserver"); - -## Get Kernel version ## -if( $display{KL} ) { - print "::$colors[0] Finding Kernel version$nocolor\n" - if $debug; - - my $kernel = `uname -r`; $kernel =~ s/\s+/ /g; - push @info, "$colors[0]Kernel\t\t\t$colors[1]$kernel$nocolor"; -} - -## Find running processes ## -print "::$colors[0] Getting processes$nocolor\n" - if $debug; -my $processes = `ps -A | awk {'print \$4'}`; - - -## Find a Desktop Environment ## -DESKTOP: -goto WINDOWM if !$display{DE}; -while(my($DEname,$DEprocess) = each(%DElist)) { - next if $processes !~ /$DEprocess/s; - - $DE = $DEname; - print "::$colors[0] Desktop Environment found as $colors[1]$DEname$nocolor\n" - if $debug; - push @info, "$colors[0]Desktop Environment\t$colors[1]$DEname$nocolor"; - last; -} - -## Find a Window Manager ## -WINDOWM: -goto ICON if !$display{WM}; -while(my($WMname,$WMprocess) = each(%WMlist)) { - next if $processes !~ /$WMprocess/sg; - - $WM = $WMname; - print "::$colors[0] Window Manager found as $colors[1]$WMname$nocolor\n" - if $debug; - push @info, "$colors[0]Window Manager\t\t$colors[1]$WMname$nocolor"; - last; -} - -## Find a Window Manager Theme ## -WINDOWMT: -goto ICON if !$display{WMT} || !$display{WM} || $WM eq ""; -print "::$colors[0] Finding $WM theme$nocolor\n" - if $debug; - -$WM eq "Openbox" && do { - ($theme) = fgrep(["$ENV{HOME}/.config/openbox/rc.xml"], ["(.+?)"]); - goto ICON; -}; - -$WM eq "Beryl" && do { - ($theme) = fgrep(["$ENV{HOME}/.emerald/theme/theme.ini"], ["description=(.*?)$/"]); - goto ICON; -}; - -$WM eq "Metacity" && do { - $theme = `gconftool-2 -g /apps/metacity/general/theme`; - chomp $theme; - goto ICON; -}; - -$WM eq "Fluxbox" && do { - ($theme) = fgrep(["$ENV{HOME}/.fluxbox/init"], ["session.styleFile:\s*/.*?/(.+?)"]); - goto ICON; -}; - -$WM eq "Blackbox" && do { - ($theme) = fgrep(["$ENV{HOME}/.blackboxrc"], ["session.styleFile:\s*/.*?/(.+?)"]); - goto ICON; -}; - -$WM eq "Xfwm4" && do { - ($theme) = fgrep(["$ENV{HOME}/.config/xfce4/mcs_settings/xfwm4.xml"], ["