Some bash scripts from high-school... wtf are they for?
authorHarvie <tomas@mudrunka.cz>
Mon, 24 May 2010 21:51:53 +0000 (23:51 +0200)
committerHarvie <tomas@mudrunka.cz>
Wed, 26 May 2010 21:45:12 +0000 (23:45 +0200)
bash/rudna.net/madwifi-deb.sh [new file with mode: 0755]
bash/rudna.net/madwifi-install.sh [new file with mode: 0755]
bash/rudna.net/nettest.sh [new file with mode: 0755]

diff --git a/bash/rudna.net/madwifi-deb.sh b/bash/rudna.net/madwifi-deb.sh
new file mode 100755 (executable)
index 0000000..85cd547
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+apt-get update;
+apt-get install apt dpkg;
+apt-get install doc-debian debian-policy debmake devscripts fakeroot dh-make debhelper;
+apt-get install make g++ gcc perl autoconf automake sed libc6-dev pbuilder;
+
+tar -xvvzf "$1".tar.gz;
+cd "$1";
+
diff --git a/bash/rudna.net/madwifi-install.sh b/bash/rudna.net/madwifi-install.sh
new file mode 100755 (executable)
index 0000000..3224a7c
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/bash
+#Harvie's MAAADWiFi module instalation script
+#2oo8
+#No freakin' rightz reserved!
+
+cd /usr/src
+rm -rf madwifi-source*
+
+apt-get build-dep madwifi-source
+
+echo Downloading+Building madwifi-source. plz w8...;
+apt-get source -b madwifi-source
+if [[ $? > 0 ]]; then
+       echo 'apt-get source ERROR... Sorry dude ;(';
+       return 1;
+fi;
+
+echo Instaling madwifi module. plz w8...;
+dpkg -i madwifi-source*.deb
+if [[ $? > 0 ]]; then
+       echo 'dpkg -i ERROR... Sorry dude ;(';
+       return 1;
+fi;
+
+echo "Madwifi gracefully orgasmed. You're da best *NIXadmin on the world.";
+echo "Chuck Norris is proud of you...";
+echo;
diff --git a/bash/rudna.net/nettest.sh b/bash/rudna.net/nettest.sh
new file mode 100755 (executable)
index 0000000..387e485
--- /dev/null
@@ -0,0 +1,48 @@
+#!/bin/bash
+#Poustime pod r00tem!
+testbtotal=268943360; #wc -c test.bin
+
+list_victims() {
+       #tahle funkce zjisti a vypise IP/hostname testovanych boxu - na radku jeden
+       echo fsdfdf
+       echo strep #dostupna + test.bin k dispozici
+       echo 127.0.0.1 #dostupna
+       echo 192.168.2.1 #nedostupna sit
+       echo lollol #neexistujici dns
+}
+
+ping_perc() {
+       perc=0;
+       for i in $(seq 0 99); do
+               ping -c 1 -w 0.7 "$1" &> /dev/null;
+               ret="$?";
+               if [[ "$ret" == 0 ]]; then
+                       perc=$[$perc+1];
+               fi;
+               if [[ "$ret" == 2 ]]; then
+                       echo 0; return 0;
+               fi;
+       done;
+       echo "$perc";
+       return "$perc";
+}
+
+for victim in $(list_victims); do
+       #victim
+               echo -n "$victim - ";
+       #ping
+               echo -n "ping responses: ";
+               pings=$(ping_perc "$victim");
+               echo -n "$pings%, ";
+       #test.bin
+               echo -n "test.bin: "
+               bytes=$(curl "http://$victim/test.bin" --stderr /dev/null|wc -c);
+               downloaded=$[$bytes*100/$testbtotal];
+               echo -n "$downloaded% downloaded, ";
+       #endvictim
+               echo -n "; ";
+done;
+
+echo;
+
+#rozsahu, ty pingnout -c 100, potom z nich stahnout test.bin, do nagiosu potom poslat zpravu spoj $ESSID ma $ODEZVA odezvu, $LOSS, rychlost $WGET_AVG 
This page took 0.161407 seconds and 4 git commands to generate.