From 4f3b31fd611de21d75b0a465b438577632f47ee0 Mon Sep 17 00:00:00 2001 From: Felix Richter Date: Sat, 14 May 2011 23:14:59 +0200 Subject: added retiolum makefile --- modules/retiolum/Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 modules/retiolum/Makefile diff --git a/modules/retiolum/Makefile b/modules/retiolum/Makefile new file mode 100644 index 00000000..9bda5dfc --- /dev/null +++ b/modules/retiolum/Makefile @@ -0,0 +1,8 @@ +all: + mkdir -p /etc/tinc/retiolum + git clone git://github.com/miefda/retiolum.git /etc/tinc/retiolum/hosts + echo cd /etc/tinc/retiolum/hosts/.scripts + echo "choose the right build script from here" +update: + cd /etc/tinc/retiolum/hosts + git pull origin master -- cgit v1.2.3 From 5fc88a3872d0e138b611fd6d1341979232a1de90 Mon Sep 17 00:00:00 2001 From: krebs Date: Mon, 23 May 2011 16:22:29 +0200 Subject: updated shack infrastructure according to wiki see: http://cert.eulerpfad.com/infrastruktur:topo added access points including icons added vdsl-modem,extern-switch updated parents according to plan updated coreswitch and serverswitch infrastructure added check_sip script a lot of more stuff probably --- modules/Monitoring/conf/krebs_hosts.cfg | 12 +- modules/Monitoring/conf/shack_infrastructure.cfg | 193 ++++++++++++---- modules/Monitoring/conf/shacknet.cfg | 34 +++ modules/Monitoring/conf/tinc_hosts.cfg | 6 +- .../images/logos/krebs/wireless_access_point.gd2 | Bin 0 -> 1047 bytes .../images/logos/krebs/wireless_access_point.png | Bin 0 -> 883 bytes .../logos/krebs/wireless_access_point_64.png | Bin 0 -> 5364 bytes modules/Monitoring/plugins/check_sip | 252 +++++++++++++++++++++ 8 files changed, 438 insertions(+), 59 deletions(-) create mode 100644 modules/Monitoring/conf/shacknet.cfg create mode 100644 modules/Monitoring/htdocs/images/logos/krebs/wireless_access_point.gd2 create mode 100644 modules/Monitoring/htdocs/images/logos/krebs/wireless_access_point.png create mode 100644 modules/Monitoring/htdocs/images/logos/krebs/wireless_access_point_64.png create mode 100755 modules/Monitoring/plugins/check_sip diff --git a/modules/Monitoring/conf/krebs_hosts.cfg b/modules/Monitoring/conf/krebs_hosts.cfg index 6857cd45..4903020c 100644 --- a/modules/Monitoring/conf/krebs_hosts.cfg +++ b/modules/Monitoring/conf/krebs_hosts.cfg @@ -7,8 +7,8 @@ define host{ host_name krebs.shack alias krebs _tinc_address 10.7.7.156 - address 10.42.23.5 - parents shack-router + address 10.42.23.5 + parents shack-coreswitch hostgroups krebs-machines,tinc-nodes,ssh-servers } # @@ -20,7 +20,7 @@ define host{ alias UTART _tinc_address 10.7.7.66 address 10.42.23.23 - parents shack-router + parents shack-coreswitch hostgroups krebs-machines,tinc-nodes,ssh-servers } # @@ -31,7 +31,7 @@ define host{ host_name ytart alias ytart _tinc_address 10.7.7.201 - parents shack-router + parents shack-coreswitch address 10.42.1.227 hostgroups krebs-machines,tinc-nodes,ssh-servers } @@ -44,7 +44,7 @@ define host{ alias uPM Virtual Machine _tinc_address 10.7.7.99 address upm.shack - parents shack-vplatform + parents shack-node1 hostgroups krebs-machines,ssh-servers,shack-rz #,tinc-nodes } @@ -61,7 +61,7 @@ define host{ alias genericore Virtual Machine #_tinc_address 10.7.7.XX address genericore.shack - parents shack-vplatform + parents shack-node1 hostgroups ssh-servers,shack-rz #,tinc-nodes,krebs-machines } diff --git a/modules/Monitoring/conf/shack_infrastructure.cfg b/modules/Monitoring/conf/shack_infrastructure.cfg index 2b75a241..3adf193b 100644 --- a/modules/Monitoring/conf/shack_infrastructure.cfg +++ b/modules/Monitoring/conf/shack_infrastructure.cfg @@ -1,46 +1,160 @@ # -define hostgroup { - hostgroup_name shack-rz - alias Shack RZ Infrastructure - } -define hostextinfo{ - hostgroup_name shack-rz - notes Shack RZ Infrastructure -# notes_url http://webserver.localhost.localdomain/hostinfo.pl?host=netware1 - icon_image krebs/shack.png - icon_image_alt shack-RZ - vrml_image shack.png - statusmap_image krebs/shack.gd2 - } # # Shack Virtual Machine Hoster Platform # + +# +# Virtualization and storage +# define host{ use generic-host - host_name shack-vplatform + host_name shack-node1 alias Shack Virtualization Server - address node0.shack - parents shack-router + address 10.42.0.10 + parents shack-serverswitch hostgroups shack-rz,ssh-servers } define host{ use generic-host - host_name shack-router - alias Shack Cisco Router - address 10.42.0.3 + host_name shack-zetbox + alias Shack Virtualization Server + address 10.42.0.10 + parents shack-serverswitch hostgroups shack-rz,ssh-servers } - define host{ use generic-host host_name shack-plattenschwein - parents shack-router + parents shack-serverswitch alias Shack Plattenschwein - address plattenschwein.shack + address 10.42.0.12 + hostgroups shack-rz,ssh-servers + } +define host{ + use generic-host + host_name shack-gauda0 + parents shack-serverswitch + alias Shack gauda0 Mining Server + address 10.42.0.99 + hostgroups shack-rz + } +# +# Network Infrastructure +# + +# +## Shack gateway (no gateway-no internet) +# +define host{ + use generic-host + host_name shack-gw + parents shack-coreswitch + alias Watchguard Shack Gateway + address 10.42.0.1 + hostgroups shack-rz,ssh-servers + } +define host{ + use generic-host + host_name shack-modem + parents shack-gw + alias Shack Telecom VDSL Router + address 192.168.2.1 + hostgroups shack-rz + } +define host{ + use generic-host + host_name shack-externswitch + parents shack-gw + alias Shack External Switch (2.OG) + address 10.0.10.2 + hostgroups shack-rz + } + +define service { + host_name shack-gw + service_description DNS Service + use generic-service + check_command check_dns + } +define host{ + use generic-host + host_name shack-coreswitch + alias Shack Cisco Router Coreswitch + address 10.42.0.3 + hostgroups shack-rz,ssh-servers + } +define host{ + use generic-host + host_name shack-serverswitch + parents shack-coreswitch + alias Shack Cisco Router Serverswitch + address 10.42.0.4 hostgroups shack-rz,ssh-servers } +define host{ + use generic-host + host_name shack-wlan-ap1 + parents shack-coreswitch + alias Shack Wlan Access Point 1 + address 10.42.0.5 + hostgroups wlan-ap + } +define host{ + use generic-host + host_name shack-wlan-ap2 + parents shack-coreswitch + alias Shack Wlan Access Point 2 + address 10.42.0.6 + hostgroups wlan-ap + } +define host{ + use generic-host + host_name shack-wlan-ap3 + parents shack-coreswitch + alias Shack Wlan Access Point 3 + address 10.42.0.7 + hostgroups wlan-ap + } +define host{ + use generic-host + host_name shack-wlan-ap4 + parents shack-coreswitch + alias Shack Wlan Access Point 4 + address 10.42.0.8 + hostgroups wlan-ap + } +define host{ + use generic-host + host_name shack-wlan-ap5 + parents shack-coreswitch + alias Shack Wlan Access Point 5 + address 10.42.0.9 + hostgroups wlan-ap + } +# +# Voip Infrastructure +# +define host{ + use generic-host + host_name shack-voip + alias Shack Cisco VOIP Gateway + address 10.42.0.2 + parents shack-coreswitch + hostgroups shack-rz,http-servers + } + +define service{ + host_name shack-voip + service_description SIP Service + use generic-service + check_command check_sip + } + + + + # # Shack DNS Server @@ -49,7 +163,7 @@ define host{ define host{ use generic-host host_name shack-dns - parents shack-vplatform + parents shack-zetbox alias Shack DNS Virtual Host address dns.shack hostgroups shack-rz @@ -60,23 +174,20 @@ define service { use generic-service check_command check_dns_shack } -define command { - command_name check_dns_shack - command_line /usr/lib/nagios/plugins/check_dns -H shack.shack -s '$HOSTADDRESS$' - } define host{ use generic-host host_name shack-pxe - parents shack-vplatform + parents shack-zetbox alias Shack PXEBoot Vhost address pxeboot.shack hostgroups shack-rz } + define host{ use generic-host host_name shack-printsrv - parents shack-vplatform + parents shack-node1 alias Shack Print Server address printer.shack hostgroups shack-rz @@ -85,7 +196,7 @@ define host{ define host{ use generic-host host_name shack-aptproxy - parents shack-vplatform + parents shack-zetbox alias Shack Apt-proxy address aptproxy.shack hostgroups shack-rz @@ -94,7 +205,7 @@ define host{ define host{ use generic-host host_name shack-shack - parents shack-vplatform + parents shack-node1 alias Shack Data Exchange address shack.shack hostgroups shack-rz,ssh-servers @@ -106,7 +217,7 @@ define host{ define host{ use generic-host host_name shack-ldap - parents shack-vplatform + parents shack-zetbox alias Shack LDAP Server address ldap.shack hostgroups shack-rz @@ -118,21 +229,3 @@ define service { check_command check_ldap!shammunity } -# -# Shack gateway -# -define host{ - use generic-host - host_name shack-gw - parents shack-router - alias Watchguard Shack Gateway - address 10.42.0.1 - hostgroups shack-rz,ssh-servers - } -define service { - host_name shack-gw - service_description DNS Service - use generic-service - check_command check_dns - } - diff --git a/modules/Monitoring/conf/shacknet.cfg b/modules/Monitoring/conf/shacknet.cfg new file mode 100644 index 00000000..7658ab80 --- /dev/null +++ b/modules/Monitoring/conf/shacknet.cfg @@ -0,0 +1,34 @@ +define hostgroup { + hostgroup_name shack-rz + alias Shack RZ Infrastructure + } +define hostgroup { + hostgroup_name wlan-ap + alias Shack Wlan Access Points + } +define hostextinfo{ + hostgroup_name wlan-ap + notes Access Points for Shack + icon_image krebs/wireless_access_point.png + icon_image_alt wireless_access_point + vrml_image wireless_access_point.png + statusmap_image krebs/wireless_access_point.gd2 + } +define hostextinfo{ + hostgroup_name shack-rz + notes Shack RZ Infrastructure + icon_image krebs/shack.png + icon_image_alt shack-RZ + vrml_image shack.png + statusmap_image krebs/shack.gd2 + } + +define command { + command_name check_sip + command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p 5060 + } + +define command { + command_name check_dns_shack + command_line $USER1$/check_dns -H shack.shack -s '$HOSTADDRESS$' + } diff --git a/modules/Monitoring/conf/tinc_hosts.cfg b/modules/Monitoring/conf/tinc_hosts.cfg index 4b1ad9ab..23c2b75e 100644 --- a/modules/Monitoring/conf/tinc_hosts.cfg +++ b/modules/Monitoring/conf/tinc_hosts.cfg @@ -9,7 +9,7 @@ define host{ alias Supernode External _TINC_ADDRESS 10.7.7.1 address miefda.org - parents shack-gw + parents shack-modem hostgroups tinc-nodes,ssh-servers,http-servers } @@ -28,7 +28,7 @@ define host{ alias PA Sharepoint address 141.31.8.11 _TINC_ADDRESS 10.7.7.5 - parents shack-gw + parents shack-modem hostgroups tinc-nodes,ssh-servers } # @@ -40,6 +40,6 @@ define host{ alias no_omo address leechi.kicks-ass.org _TINC_ADDRESS 10.7.7.111 - parents shack-gw + parents shack-modem hostgroups tinc-nodes,ssh-servers,http-servers } diff --git a/modules/Monitoring/htdocs/images/logos/krebs/wireless_access_point.gd2 b/modules/Monitoring/htdocs/images/logos/krebs/wireless_access_point.gd2 new file mode 100644 index 00000000..6e740ec4 Binary files /dev/null and b/modules/Monitoring/htdocs/images/logos/krebs/wireless_access_point.gd2 differ diff --git a/modules/Monitoring/htdocs/images/logos/krebs/wireless_access_point.png b/modules/Monitoring/htdocs/images/logos/krebs/wireless_access_point.png new file mode 100644 index 00000000..9febe45e Binary files /dev/null and b/modules/Monitoring/htdocs/images/logos/krebs/wireless_access_point.png differ diff --git a/modules/Monitoring/htdocs/images/logos/krebs/wireless_access_point_64.png b/modules/Monitoring/htdocs/images/logos/krebs/wireless_access_point_64.png new file mode 100644 index 00000000..fe9788af Binary files /dev/null and b/modules/Monitoring/htdocs/images/logos/krebs/wireless_access_point_64.png differ diff --git a/modules/Monitoring/plugins/check_sip b/modules/Monitoring/plugins/check_sip new file mode 100755 index 00000000..24374727 --- /dev/null +++ b/modules/Monitoring/plugins/check_sip @@ -0,0 +1,252 @@ +#!/usr/bin/perl -w +# +# check_sip plugin for nagios +# $Revision: 1.2 $ +# +# Nagios plugin to check SIP servers +# +# By Sam Bashton, Bashton Ltd +# bashton.com/content/nagiosplugins +# Michael Hirschbichler, Institute of Broadband Communications, +# Vienna University of Technology +# +# 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 of the License, 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 +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +use strict; +use lib "/usr/lib/nagios/plugins"; +use utils qw($TIMEOUT %ERRORS &print_revision &support); +use vars qw($PROGNAME); +use IO::Socket::INET; +#use Sys::Hostname; +use Time::HiRes qw(gettimeofday); +use Net::Domain qw (hostname hostfqdn hostdomain); + +$PROGNAME = "check_sip"; +my $VERSION = "1.2"; + +$ENV{'BASH_ENV'}=''; +$ENV{'ENV'}=''; +$ENV{'PATH'}=''; +$ENV{'LC_ALL'}='C'; + +my ($opt_V,$opt_h,$opt_u,$opt_p,$opt_H, $opt_w, $opt_s, $opt_f); +$opt_V = $opt_h = $opt_u = $opt_p = $opt_H = $opt_w = $opt_s = $opt_f = ''; + +my $state = 'UNKNOWN'; + +use Getopt::Long; +Getopt::Long::Configure('bundling'); +GetOptions( + "V" => \$opt_V, "version" => \$opt_V, + "h" => \$opt_h, "help" => \$opt_h, + "s" => \$opt_s, + "f=s" => \$opt_f, "fromuri=s" => \$opt_f, + "u=s" => \$opt_u, "uri=s" => \$opt_u, + "p=s" => \$opt_p, "port=s" => \$opt_p, + "H=s" => \$opt_H, "host=s" => \$opt_H, + "w=s" => \$opt_w, "warn=s" => \$opt_w +); + +# -h displays help +if ($opt_h) { printHelp(); exit $ERRORS{'OK'}; } + +# -V display version number +if ($opt_V) { + print_revision($PROGNAME, $VERSION); + exit $ERRORS{'OK'}; +}; + +# Check the sip URI is OK +unless ($opt_u) { printHelp(); exit $ERRORS{'UNKNOWN'} } + +# Port is 5060 unless otherwise specified +unless ($opt_p) { $opt_p = 5060 } + +# Determine the host from the sip URI if it wasn't specified with -H +unless ($opt_H) { $opt_H = hostFromURI($opt_u) } + +# Check the host is valid +unless (utils::is_hostname($opt_H)) +{ + print "$opt_H is not a valid hostname\n"; + printHelp(); + exit $ERRORS{"UNKNOWN"}; +} + +unless ($opt_w) { $opt_w = 5 } # Warn if response takes longer than 5 seconds + +### Main code ############################################################### + +# Timeout if we don't recieve a response within a suitable timeframe.. +$SIG{'ALRM'} = sub { + print ("SIP timeout: No response from SIP server after $TIMEOUT seconds\n"); + exit $ERRORS{"CRITICAL"}; +}; +alarm($TIMEOUT); + +my $localhost = hostfqdn(); +$opt_f = getFromURI($opt_f,$localhost,$opt_p); +my $user=getUserPart($opt_f); +my $socket = uconnect($opt_H, $opt_p); +my @localinfo = unpack_sockaddr_in($socket->sockname); +my $req = buildReq($localinfo[0], $opt_u, $opt_f,$user,$localhost); +my (undef, $starttime) = gettimeofday; +$socket->send($req); +my $response; +$socket->recv($response, 1024) or $state = 'CRITICAL'; + +#get rid of the 100 Trying - provisional response ... +if (getResponseCode($response) eq "100"){ + $socket->recv($response, 1024) or $state = 'CRITICAL'; +} + +my (undef, $finishtime) = gettimeofday; +my $rtime = ($finishtime - $starttime) / 1000000; # Time taken in seconds +if(checkResponse($response,$rtime,$opt_s)) +{ + if ($rtime > $opt_w) { $state = 'WARNING' } + else { $state = 'OK' } +} +else { $state = 'CRITICAL' } + +exit $ERRORS{$state}; + +### Subroutines ############################################################## + + +sub uconnect +{ + my ($host, $port) = @_; + my $socket = new IO::Socket::INET->new(PeerPort=>$port, Proto=>'udp', PeerAddr=>$host); + unless ($socket) { print "Unable to connect to $host\n"; exit $ERRORS{'UNKNOWN'} } + return $socket; +} + +sub getFromURI{ + my ($from, $localhost,$localport) = @_; + if (!("$from" eq "")){ + return "$from:$localport"; + }else + { + return "sip:checksip\@$localhost:$localport"; + } +} + +sub getUserPart{ + my ($uri) = @_; + my @uris=split(/\@/,$uri); + my $user=$uris[0]; + return $user; +} + +sub hostFromURI +{ + my ($uri) = @_; + $uri =~ s/sip:[^\@]+@//; + return $uri; +} + +sub getResponseCode +{ + my ($message) = @_; + my @messageparts=split(/\ /,$message); + return $messageparts[1]; +} + +sub buildReq +{ + my ($localport, $dsturi, $fromuri,$user,$localhost) = @_; + + my $req; + my $tag = genTag(); + my $idtag = genTag(); + $req.= "OPTIONS $dsturi SIP/2.0\r\n"; + $req.= "Via: SIP/2.0/UDP $localhost:$localport;branch=z9hG4bKhjhs8ass877\r\n"; + $req.= "Max-Forwards: 70\r\n"; + $req.= "To: $dsturi\r\n"; + $req.= "From: $fromuri;tag=$tag\r\n"; + $req.= "Call-ID: $idtag\@$localhost\r\n"; + $req.= "CSeq: 1 OPTIONS\r\n"; + $req.= "Contact: <$user\@$localhost:$localport>\r\n"; + $req.= "Accept: application/sdp\r\n"; + $req.= "Content-Length: 0\r\n\r\n"; + return $req; +} + +sub genTag +{ + my $tag; + my @chars = ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p', + 'q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8', + '9'); + + for (my $i = 0; $i < 6; $i++) + { + $tag .= $chars[rand(scalar @chars)]; + } + return $tag; +} + +sub printHelp +{ + print "This plugin tests the sip service on the specified host.\n\n"; + print "Usage: $PROGNAME -u sip:uri\@example.com [-H host -p PORT -f sip:fromuri\@example.com -w WARNTIME -s]\n"; + print " $PROGNAME [-h | --help]\n"; + print " $PROGNAME [-V | --version]\n\n"; + print "Options:\n"; + print " -u sip:uri\@example.com\n"; + print " Full SIP uri, eg sip:uri\@example.com\n"; + print " -h, --help\n"; + print " Print this help\n"; + print " -V, --version\n"; + print " Print version information\n"; + print " -H host\n"; + print " Host name or IP Address to connect to\n"; + print " -p port\n"; + print " Port to connect to\n"; + print " -f sip:fromuri\@example.com\n"; + print " Full SIP uri, will be used for the \"From:\"-Header\n"; + print " -s\n"; + print " Changes default behavior: all SIP-responses will result in an \"OK\"\n\n"; + + +} + +sub checkResponse +{ + my ($response, $rtime, $sp_behavior) = @_; + my @header=split(/\r/,$response); + my $tstring=$header[0]; + my $rcode=getResponseCode($response); + if (!$sp_behavior){ + #in this case, we want to see if the SIP-server is respoding positively to our request + # Some SUT respond with 100 Trying - assume everything is OK if we get this + if ($response =~ /^SIP.+[12]00/){ + print "$tstring, $rtime seconds response time|rtt=".$rtime."s;0.5s;1s;0:10; code=".$rcode."\n"; + return 1; + } + elsif ($response =~ /^SIP.+404 Not Found/) { + print "$tstring, $rtime seconds response time|rtt=".$rtime."s;0.5s;1s;0:10; code=".$rcode."\n"; + return 0 } + else { print "Unknown error: $tstring, $rtime seconds response time|rtt=".$rtime."s;0.5s;1s;0:10; code=".$rcode."\n"; return 0; } + }else{ + #in this case, we accept every response from the server, as long it is SIP + if ($response =~ /^SIP./){ + print "$tstring, $rtime seconds response time|rtt=".$rtime."s;0.5s;1s;0:10; code=".$rcode."\n"; + return 1; + } + else { print "Unknown error: $tstring, $rtime seconds response time|rtt=".$rtime."s;0.5s;1s;0:10; code=".$rcode."\n"; return 0; } + } +} -- cgit v1.2.3 From 1e4df0acce701b5488b1be0efbfe66a73c5abf3b Mon Sep 17 00:00:00 2001 From: krebs Date: Mon, 23 May 2011 16:50:59 +0200 Subject: added TODO file first todo is to merge in changes in the global cgi config and htuser file --- modules/Monitoring/TODO | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 modules/Monitoring/TODO diff --git a/modules/Monitoring/TODO b/modules/Monitoring/TODO new file mode 100644 index 00000000..6d74fdcd --- /dev/null +++ b/modules/Monitoring/TODO @@ -0,0 +1,5 @@ +add guest user +add guest user to +> * authorized_for_all_services=usernagios,guest +> * authorized_for_all_hosts=usernagios,guest +in /etc/nagios3/somewhere -- cgit v1.2.3 From f7e9589f5ecf0a56ff8f0afbc0f915005ba829e2 Mon Sep 17 00:00:00 2001 From: Felix Richter Date: Tue, 24 May 2011 18:49:15 +0200 Subject: added opkg packet manager to bootstrapping --- bootstrap.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bootstrap.sh b/bootstrap.sh index 433235e9..c434a4fe 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -5,6 +5,7 @@ set -x [ -e '/usr/bin/git' ] || \ apt-get install -y git-core || \ yum install git || \ +opkg install git || \ pacman -Sy git || \ { echo "please install git!"; exit 1;} || exit 1 -- cgit v1.2.3 From 7e58b11f8a4045088afaafff82ef154fd060fa4d Mon Sep 17 00:00:00 2001 From: krebs Date: Tue, 24 May 2011 21:24:27 +0200 Subject: zoneminder: initial commit --- modules/zoneminder/Makefile | 14 ++++++++++++++ modules/zoneminder/zmdc.pl-LD_PRELOAD.patch | 10 ++++++++++ modules/zoneminder/zoneminder.conf | 2 ++ 3 files changed, 26 insertions(+) create mode 100644 modules/zoneminder/Makefile create mode 100644 modules/zoneminder/zmdc.pl-LD_PRELOAD.patch create mode 100644 modules/zoneminder/zoneminder.conf diff --git a/modules/zoneminder/Makefile b/modules/zoneminder/Makefile new file mode 100644 index 00000000..27302715 --- /dev/null +++ b/modules/zoneminder/Makefile @@ -0,0 +1,14 @@ + +.PHONY: fix it so hard +it: so +so: it hard fix + apt-get install --yes zoneminder libv4l-0 + +hard: /etc/sysctl.d/zoneminder.conf +/etc/sysctl.d/zoneminder.conf: zoneminder.conf + cp $< $@ + sysctl -p $@ + +fix: zmdc.pl-LD_PRELOAD.patch + (cd /usr/bin && patch -N) < $< || : + diff --git a/modules/zoneminder/zmdc.pl-LD_PRELOAD.patch b/modules/zoneminder/zmdc.pl-LD_PRELOAD.patch new file mode 100644 index 00000000..b00fc673 --- /dev/null +++ b/modules/zoneminder/zmdc.pl-LD_PRELOAD.patch @@ -0,0 +1,10 @@ +--- /usr/bin/zmdc.pl 2011-05-23 22:28:57.505247793 +0200 ++++ /usr/bin/zmdc.pl 2011-05-23 22:29:45.597248242 +0200 +@@ -62,6 +62,7 @@ + $ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL}; + delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; + ++$ENV{LD_PRELOAD} = '/usr/lib/libv4l/v4l2convert.so'; + my @daemons = ( + 'zmc', + 'zma', diff --git a/modules/zoneminder/zoneminder.conf b/modules/zoneminder/zoneminder.conf new file mode 100644 index 00000000..1eec6fd9 --- /dev/null +++ b/modules/zoneminder/zoneminder.conf @@ -0,0 +1,2 @@ +kernel.shmall = 134217728 +kernel.shmmax = 134217728 -- cgit v1.2.3 From b3d53f4d088b8abacd95541283ce9229012e736b Mon Sep 17 00:00:00 2001 From: root Date: Tue, 24 May 2011 22:25:04 +0200 Subject: added enterprise config fixing for debian --- modules/Monitoring/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/Monitoring/Makefile b/modules/Monitoring/Makefile index 2d837b43..cc1d8903 100644 --- a/modules/Monitoring/Makefile +++ b/modules/Monitoring/Makefile @@ -1,6 +1,7 @@ .phony: debian debian: [ `which nagios3` ] || apt-get install nagios3 + rm /etc/nagios3/conf.d/localhost_nagios2.cfg || true cp -r conf/* /etc/nagios3/conf.d/ cp -R htdocs/* /usr/share/nagios3/htdocs/ cp -r plugins /usr/lib/nagios -- cgit v1.2.3 From 843b62b3ea1923eeb50d73a2bc260800ebec6213 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 24 May 2011 22:27:31 +0200 Subject: fixed arping --- modules/people/src/arping.py | 2 +- modules/people/src/arping_users.py | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/people/src/arping.py b/modules/people/src/arping.py index eea176e0..1b51ab1b 100755 --- a/modules/people/src/arping.py +++ b/modules/people/src/arping.py @@ -14,7 +14,7 @@ try: log.debug("pinging "+ str(iprange)) """Arping function takes IP Address or Network, returns nested mac/ip list""" try: - conf.verb=1 + conf.verb=0 ans,unans=arping(iprange,iface=iface,timeout=1,retry=3) collection = [] diff --git a/modules/people/src/arping_users.py b/modules/people/src/arping_users.py index d6f6826e..9dd95749 100755 --- a/modules/people/src/arping_users.py +++ b/modules/people/src/arping_users.py @@ -1,14 +1,16 @@ #!/usr/bin/python -import subprocess,re,logging +import subprocess,re,logging,sys from arping import arpingy from multiprocessing import Pool - DEV='eth0' MAC_NAMES='mac_names.lst' data = [] ret = {} -exit (0) +verb = False + +if len(sys.argv) > 1 and sys.argv[1] == 'v': + verb = True def get_own_addr(): data = subprocess.Popen(['/sbin/ifconfig',DEV], stdout=subprocess.PIPE).communicate()[0].replace('\n','') @@ -27,7 +29,7 @@ def load_names(MAC_NAMES): def arping_helper(dic): return arpingy(**dic) -for first in range(3): +for first in range(4): for second in range(255): data.append({'iprange':'10.42.'+str(first)+'.'+str(second),'iface':DEV}) @@ -44,5 +46,7 @@ except: for p in ret: + if verb: + print p[0] + " => " + p[1] if p[1] in names: print names[p[1]]+ " is online" -- cgit v1.2.3 From 9057f9391669d1add93651600c4bfd6b76d1e613 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 24 May 2011 22:37:07 +0200 Subject: added shack-dns as ip-address this helps identifying local dns failure --- modules/Monitoring/conf/shack_infrastructure.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Monitoring/conf/shack_infrastructure.cfg b/modules/Monitoring/conf/shack_infrastructure.cfg index 3adf193b..9a9dfd09 100644 --- a/modules/Monitoring/conf/shack_infrastructure.cfg +++ b/modules/Monitoring/conf/shack_infrastructure.cfg @@ -165,7 +165,7 @@ define host{ host_name shack-dns parents shack-zetbox alias Shack DNS Virtual Host - address dns.shack + address 10.42.0.100 hostgroups shack-rz } define service { -- cgit v1.2.3 From c99000c0edf6bfc2ee6545f9e2ad04c99cd8a96e Mon Sep 17 00:00:00 2001 From: root Date: Wed, 25 May 2011 16:36:14 +0200 Subject: added google hosts, updated serverswitch --- modules/Monitoring/conf/other_hosts.cfg | 23 +++++++++++++++++++++++ modules/Monitoring/conf/shack_infrastructure.cfg | 4 ++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 modules/Monitoring/conf/other_hosts.cfg diff --git a/modules/Monitoring/conf/other_hosts.cfg b/modules/Monitoring/conf/other_hosts.cfg new file mode 100644 index 00000000..bfc36154 --- /dev/null +++ b/modules/Monitoring/conf/other_hosts.cfg @@ -0,0 +1,23 @@ +define host{ + use generic-host + host_name google.de + alias Google Website + address google.de + parents shack-modem + hostgroups http-servers + } + +define host{ + use generic-host + host_name google-dns + parents shack-gw + parents shack-modem + alias Google DNS Service (always reachable) + address 8.8.8.8 + } +define service { + host_name google-dns + service_description DNS Service + use generic-service + check_command check_dns + } diff --git a/modules/Monitoring/conf/shack_infrastructure.cfg b/modules/Monitoring/conf/shack_infrastructure.cfg index 9a9dfd09..dd123dc3 100644 --- a/modules/Monitoring/conf/shack_infrastructure.cfg +++ b/modules/Monitoring/conf/shack_infrastructure.cfg @@ -36,7 +36,7 @@ define host{ host_name shack-gauda0 parents shack-serverswitch alias Shack gauda0 Mining Server - address 10.42.0.99 + address gauda0.shack hostgroups shack-rz } # @@ -90,7 +90,7 @@ define host{ parents shack-coreswitch alias Shack Cisco Router Serverswitch address 10.42.0.4 - hostgroups shack-rz,ssh-servers + hostgroups shack-rz } define host{ -- cgit v1.2.3 From ddd37810eefa8c4fab4d15d67e815e7425d5b9f3 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 25 May 2011 16:42:19 +0200 Subject: added Shepherd krebs --- modules/Monitoring/conf/krebs_hosts.cfg | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/Monitoring/conf/krebs_hosts.cfg b/modules/Monitoring/conf/krebs_hosts.cfg index 4903020c..c258ed96 100644 --- a/modules/Monitoring/conf/krebs_hosts.cfg +++ b/modules/Monitoring/conf/krebs_hosts.cfg @@ -65,3 +65,13 @@ define host{ hostgroups ssh-servers,shack-rz #,tinc-nodes,krebs-machines } + +define host{ + use generic-host + host_name shepherd + alias Shepherd Krebs + _tinc_address 10.7.7.29 + address shepherd.shack + parents shack-coreswitch + hostgroups krebs-machines,tinc-nodes,ssh-servers + } -- cgit v1.2.3 From 22f3b8ed47870ca653f44c1347ede0a152ffb457 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 25 May 2011 22:05:02 +0200 Subject: replaced whole retiolum module with enterprise install script. does the right thing by calling the bootstrap file from retiolum --- modules/retiolum/Makefile | 8 ----- modules/retiolum/README | 13 ------- modules/retiolum/build_arch.sh | 14 -------- modules/retiolum/build_debian.sh | 11 ------ modules/retiolum/build_ec2.sh | 16 --------- modules/retiolum/build_no.de.sh | 1 - modules/retiolum/hosts/Lassulus | 9 ----- modules/retiolum/hosts/alphalabs | 9 ----- modules/retiolum/hosts/also | 9 ----- modules/retiolum/hosts/foobaz | 8 ----- modules/retiolum/hosts/kaah | 11 ------ modules/retiolum/hosts/krebs | 10 ------ modules/retiolum/hosts/miefda901 | 9 ----- modules/retiolum/hosts/miefdahome | 9 ----- modules/retiolum/hosts/miefdat | 10 ------ modules/retiolum/hosts/no_omo | 9 ----- modules/retiolum/hosts/pa_sharepoint | 7 ---- modules/retiolum/hosts/pfleidi | 9 ----- modules/retiolum/hosts/pornocauster | 9 ----- modules/retiolum/hosts/supernode | 10 ------ modules/retiolum/hosts/tart | 6 ---- modules/retiolum/install.sh | 69 +----------------------------------- 22 files changed, 1 insertion(+), 265 deletions(-) delete mode 100644 modules/retiolum/Makefile delete mode 100644 modules/retiolum/README delete mode 100755 modules/retiolum/build_arch.sh delete mode 100755 modules/retiolum/build_debian.sh delete mode 100755 modules/retiolum/build_ec2.sh delete mode 100644 modules/retiolum/build_no.de.sh delete mode 100644 modules/retiolum/hosts/Lassulus delete mode 100644 modules/retiolum/hosts/alphalabs delete mode 100644 modules/retiolum/hosts/also delete mode 100644 modules/retiolum/hosts/foobaz delete mode 100644 modules/retiolum/hosts/kaah delete mode 100644 modules/retiolum/hosts/krebs delete mode 100644 modules/retiolum/hosts/miefda901 delete mode 100644 modules/retiolum/hosts/miefdahome delete mode 100644 modules/retiolum/hosts/miefdat delete mode 100644 modules/retiolum/hosts/no_omo delete mode 100644 modules/retiolum/hosts/pa_sharepoint delete mode 100644 modules/retiolum/hosts/pfleidi delete mode 100644 modules/retiolum/hosts/pornocauster delete mode 100644 modules/retiolum/hosts/supernode delete mode 100644 modules/retiolum/hosts/tart mode change 100755 => 100644 modules/retiolum/install.sh diff --git a/modules/retiolum/Makefile b/modules/retiolum/Makefile deleted file mode 100644 index 9bda5dfc..00000000 --- a/modules/retiolum/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -all: - mkdir -p /etc/tinc/retiolum - git clone git://github.com/miefda/retiolum.git /etc/tinc/retiolum/hosts - echo cd /etc/tinc/retiolum/hosts/.scripts - echo "choose the right build script from here" -update: - cd /etc/tinc/retiolum/hosts - git pull origin master diff --git a/modules/retiolum/README b/modules/retiolum/README deleted file mode 100644 index e6ae9454..00000000 --- a/modules/retiolum/README +++ /dev/null @@ -1,13 +0,0 @@ -This directory contains the build and install scripts for shack-retiolum - -1. build_arch - arch linux build script -2. build_debian - debian build script -3. build_ec2 - Amazon ec2 base instance build script -4. install.sh - configures the tinc daemon - $1 is the nickname - $2 is the ip-address -hosts.tar contains the currently available hosts diff --git a/modules/retiolum/build_arch.sh b/modules/retiolum/build_arch.sh deleted file mode 100755 index 5ef5d765..00000000 --- a/modules/retiolum/build_arch.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -set -e -sudo pacman -S openssl gcc lzo -curl http://www.tinc-vpn.org/packages/tinc-1.0.13.tar.gz | tar xz -cd tinc-1.0.13 -./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var -make -sudo make install -cd .. - -echo "overwriting python to python2" -sed 's/\/usr\/bin\/python/\/usr\/bin\/python2/g' install.sh >install2.sh -mv install2.sh install.sh - diff --git a/modules/retiolum/build_debian.sh b/modules/retiolum/build_debian.sh deleted file mode 100755 index cb346b5f..00000000 --- a/modules/retiolum/build_debian.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -set -xe -MYIP=10.7.7.66 - -apt-get install -y install tinc git curl python git-core - -./install.sh `hostname` $MYIP - -# for autostart -echo "retiolum" >> /etc/tinc/nets.boot -echo "EXTRA=\"\"" >> /etc/default/tinc diff --git a/modules/retiolum/build_ec2.sh b/modules/retiolum/build_ec2.sh deleted file mode 100755 index 79f2af28..00000000 --- a/modules/retiolum/build_ec2.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -set -e -sudo yum install -y gcc openssl-devel -mkdir build -cd build -curl http://www.oberhumer.com/opensource/lzo/download/lzo-2.04.tar.gz | tar xz -cd lzo-2.04 -./configure --prefix=/usr -make -sudo make install -cd .. -curl http://www.tinc-vpn.org/packages/tinc-1.0.13.tar.gz | tar xz -cd tinc-1.0.13 -./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var -make -sudo make install diff --git a/modules/retiolum/build_no.de.sh b/modules/retiolum/build_no.de.sh deleted file mode 100644 index 2976d3a2..00000000 --- a/modules/retiolum/build_no.de.sh +++ /dev/null @@ -1 +0,0 @@ -pkgin in lzo gcc-tools gcc-compiler gcc34 diff --git a/modules/retiolum/hosts/Lassulus b/modules/retiolum/hosts/Lassulus deleted file mode 100644 index 61c2d62b..00000000 --- a/modules/retiolum/hosts/Lassulus +++ /dev/null @@ -1,9 +0,0 @@ -Subnet = 10.7.7.11 ------BEGIN RSA PUBLIC KEY----- -MIIBCgKCAQEAsj1PCibKOfF68gmFQ+wwyfhUWpqKqpznrJX1dZ+daae7l7nBHvsE -H0QwkiMmk3aZy1beq3quM6gX13aT+/wMfWnLyuvT11T5C9JEf/IS91STpM2BRN+R -+P/DhbuDcW4UsdEe6uwQDGEJbXRN5ZA7GI0bmcYcwHJ9SQmW5v7P9Z3oZ+09hMD+ -1cZ3HkPN7weSdMLMPpUpmzCsI92cXGW0xRC4iBEt1ZeBwjkLCRsBFBGcUMuKWwVa -9sovca0q3DUar+kikEKVrVy26rZUlGuBLobMetDGioSawWkRSxVlfZvTHjAK5JzU -O6y6hj0yQ1sp6W2JjU8ntDHf63aM71dB9QIDAQAB ------END RSA PUBLIC KEY----- diff --git a/modules/retiolum/hosts/alphalabs b/modules/retiolum/hosts/alphalabs deleted file mode 100644 index 6aea1dec..00000000 --- a/modules/retiolum/hosts/alphalabs +++ /dev/null @@ -1,9 +0,0 @@ -Subnet = 10.7.7.10 ------BEGIN RSA PUBLIC KEY----- -MIIBCgKCAQEAvUAbMmmOFn+4kOvJAvmi0R/XCQa1YBlkjUvC6Pmt0Q8gV1DodXjB -DgwP8yhLcxaVy2Hk82aJvNTUrfMeB2sdt1RJHQiEPQkHthdp8Spm0Px4uTiMjmFB -ev91xi00eCCGIKsXdh/qso1K7EDHt9MEVHOvSlkawWzoyJ6AaHStW1ElwDdGjZpl -0YWrhx4Gk5X7pCp3LKkQJFfGtqoqGOVg2JjqK3qMsAdRo6QvYDqjFzARed/D0k55 -kcKXjBJAVxoU/CqGfS/Lr0fL8tdYgXaAXvPO9dbr1t0KyOUY2KRNBePeSvRp/etb -H0LBPsO9F7PQiPI3DBoWCYgsuj/hBXapvwIDAQAB ------END RSA PUBLIC KEY----- diff --git a/modules/retiolum/hosts/also b/modules/retiolum/hosts/also deleted file mode 100644 index 9f9dcd73..00000000 --- a/modules/retiolum/hosts/also +++ /dev/null @@ -1,9 +0,0 @@ -Subnet = 10.7.7.23 ------BEGIN RSA PUBLIC KEY----- -MIIBCgKCAQEAsnF1eyd/R4qXMGo8UEZ98hnJK+6ZEKUubgdzEwAuSxK40B6nX8Ry -Euy3v3s0ps/GMdE52gUbFB+bhM99hHiKW+7zcxnoMJ69a9yK6VG0Im+7ib0WTliZ -llgUfRETQd/2KaIfJWH/nVsBuK0hp1LscroWcoO08BCw6v94q3He8502Bk/ZYZQF -wD7Y6LldipWKo/K9YtIU3zD3taj2NGnetOc0BRRncSgGiicXJKhtfcs+Ti2Y/ITz -bFkHnFgB0KnhjwJBumxdmgjHWknlwVkROvmzIgyoXxqEw31bF+g/XzA7RTMXsiFM -w0SZ15k4HG5L1PWpUyY2Th5yIjMW+sSrhQIDAQAB ------END RSA PUBLIC KEY----- diff --git a/modules/retiolum/hosts/foobaz b/modules/retiolum/hosts/foobaz deleted file mode 100644 index 47ac4d6e..00000000 --- a/modules/retiolum/hosts/foobaz +++ /dev/null @@ -1,8 +0,0 @@ ------BEGIN RSA PUBLIC KEY----- -MIIBCgKCAQEA4wJHcyS3PI2rugPbhQy5qLKQwtaOIsLV367b9Pq6VLKEly2dWAZx -xvFmdKRbm/n/HaRzX+vyDuhWOxkzrF0NLNrrU58Rw5suHfNU2ryuO1QB2sIGMj1R -QXwB+W6MNM5OamBkLLo740aPvVjfud9tc3yrUg6mTCJP1tbRLgHyDy6DT3s5WGvO -R6bfYRjdzVLjwqqn5P/ED51gBgDmJEhoWzQ4IzBSO+mxRrkvwfPQNiTSrrQBAiU7 -r5lstDzEY8qDdwY6t1w91hxm34LLJ/gQr9uvXGF/GThm4J8Ndlj4tOl8UmFbo3Nz -6Zm0b2JZ4dWbA/NXp7Sf9qKC5duQkAPb1QIDAQAB ------END RSA PUBLIC KEY----- diff --git a/modules/retiolum/hosts/kaah b/modules/retiolum/hosts/kaah deleted file mode 100644 index d56014fa..00000000 --- a/modules/retiolum/hosts/kaah +++ /dev/null @@ -1,11 +0,0 @@ -Address = kaah.ath.cx -Subnet = 10.7.7.21 - ------BEGIN RSA PUBLIC KEY----- -MIIBCgKCAQEAtd9+R7NYs/5LmXoFakuoFzdO/8hy4MMeGjdDqbubKyJmIO/nvQWS -TQns55znLgPIapUtCijxphoQrcTB5LijVXFj/2uipqiOJHVmhA80NiQgYhrFG++x -9AQie2c04xqq+6Bptjs8vnQS6odLsBAiY1OJDpaEPZqzrpSMnYzEwPWqOAzzbVRd -SFDokIhm62xmDK0+M4H8l3zmMnInnxdHd0fMhBJr5lXXqdzXJ3zluU6fZyHysF4c -OnvFrGNrc3MPpgmzULVUUVg+Z4NeQYa5LuhXA9xia0R5d8ALCi34L4tAvCfSi1Lu -RSUiJHeWDvNzwIy9+hxofqqcJqA05kyGLQIDAQAB ------END RSA PUBLIC KEY----- diff --git a/modules/retiolum/hosts/krebs b/modules/retiolum/hosts/krebs deleted file mode 100644 index 4aba5105..00000000 --- a/modules/retiolum/hosts/krebs +++ /dev/null @@ -1,10 +0,0 @@ -Subnet = 10.7.7.156 ------BEGIN RSA PUBLIC KEY----- -MIIBCgKCAQEAl6vUmUL8w8r2gUTpUF8QWx0U3nzDPao2I7l0WU1NnGcR8DVug7YN -595guvDkRGcM4eYGizgVYVvDCmjTQRXRn57ucVud2bGE1NGtdomVs6wggpgzLiaf -m9BJwsigoCyMv+8ewGfc+D10TupulcIiZSp/RAewYlX0rhmgdsEGnCt+TWvXRsIa -kY1pvt4YeKjs2ctib3OmaPuNokK4ophxSpdZ5arjHCaiVMj2O6pPAQbU7WFY63Fw -UP64cAmtqBM+uMteT7bdG1jT3KZS6W7Dy8rIBd+pp+vB656A5PhrDcGEUMFSXqPD -BwIxhV7OAejSn4XjrZyd5eNtMOQKopIMQwIDAQAB ------END RSA PUBLIC KEY----- - diff --git a/modules/retiolum/hosts/miefda901 b/modules/retiolum/hosts/miefda901 deleted file mode 100644 index a1b59a29..00000000 --- a/modules/retiolum/hosts/miefda901 +++ /dev/null @@ -1,9 +0,0 @@ -Subnet = 10.7.7.22 ------BEGIN RSA PUBLIC KEY----- -MIIBCgKCAQEApbEYmHf0vEDYa/2aVvWVxEGgC+JJlXcArdxkQooSIpnZfSAfsH0S -MFz8v7UkM7EJSwDsFWf+gxyoAORdFpdQm+XQoDqWVZ1e0isYtNluP2C/51s3lu2F -kVLZ+86el7zd4unHG+6CHmyaBcO5yV6VU8WFeuinB2+ojnujOWlHgOipMOrxsab8 -vwcH/0k/iR9BjH9xzo+kwhzqG0plLkQnvsvVyDN/gQj0Euz6YHfgo5c2gxQKKH7h -Bv6prIxCbpY7WMMtg0z+OlyGkQefVRl18kZwoNtOFlh5NBe7imYcH+wyhhQ9rqnN -VoHpJw4lNOuWfy3Af28kYDQ7KnPGYFq4nwIDAQAB ------END RSA PUBLIC KEY----- diff --git a/modules/retiolum/hosts/miefdahome b/modules/retiolum/hosts/miefdahome deleted file mode 100644 index 9a9f4310..00000000 --- a/modules/retiolum/hosts/miefdahome +++ /dev/null @@ -1,9 +0,0 @@ -Subnet = 10.7.7.30 ------BEGIN RSA PUBLIC KEY----- -MIIBCgKCAQEAopwKn000XAcoI61OqQ7cjgrPHm/jHmuB1LHeCUggWMOD78WDFNzq -8/l9ASlU9kbSZFhoMuBR5BPWgciYWsC1EqY1nRAc/Si1rUHnJw+Xcyl0MNsZ7Cef -WaFRvC1VNC3qlQp5/e+fi46oOp4i+BqlFSxe7Jrr0EVyBVTOw8rMGToqDsOih6M9 -SFvmVMOnqh7n8LEOUtAL4nID59k7CTXzoNhXc0cEJoBkC2YCexonb4ru/J8F2BRG -Y3yzHYVskBrrPie1JNhfUHGCABIbtODTiHQYH8NFTYzdBnVV88IWqiTBbmKcRf+j -zEyGyXu/3YLFfjmsi7ysT+BWLIPvkyr7/wIDAQAB ------END RSA PUBLIC KEY----- diff --git a/modules/retiolum/hosts/miefdat b/modules/retiolum/hosts/miefdat deleted file mode 100644 index 43e2a6e6..00000000 --- a/modules/retiolum/hosts/miefdat +++ /dev/null @@ -1,10 +0,0 @@ -Subnet = 10.7.7.20 - ------BEGIN RSA PUBLIC KEY----- -MIIBCgKCAQEAvCestFRcrr10nzSzc1l4Flkv6ZG5ijGneZBeDaP+bB3GhFx0BYzP -CQjcCFTcExVVAorknjX1/rjT60+dSBuJoH/pEeloPowtwm6YVgfhcQD/5qRHmAPF -Ss1pdiTVtyi0BmcqDGoOTcR/tR4v2LBEDnxK89wWIFWbeDeR6UyjD2psbFBal8Zd -TmkuBTg1OGPVhB+BmuKSqPBt6AtLV+0fKHdrTOVNwF2W/8lCVTd3uCVtnUEeTLrW -KA8h9C0K2gAxxhJTF3pJtR/YQPpgwXRg3CfzMKsvHNOsqfMnnk/WFM0vrSJSi2El -xCD5Pm/BPZyA8B4vhz8im4hWofOP2/JiNwIDAQAB ------END RSA PUBLIC KEY----- diff --git a/modules/retiolum/hosts/no_omo b/modules/retiolum/hosts/no_omo deleted file mode 100644 index f2398f18..00000000 --- a/modules/retiolum/hosts/no_omo +++ /dev/null @@ -1,9 +0,0 @@ -Subnet = 10.7.7.111 ------BEGIN RSA PUBLIC KEY----- -MIIBCgKCAQEAuHQEeowvxRkoHJUw6cUp431pnoIy4MVv7kTLgWEK46nzgZtld9LM -ZdNMJB9CuOVVMHEaiY6Q5YchUmapGxwEObc0y+8zQxTPw3I4q0GkSJqKLPrsTpkn -sgEkHPfs2GVdtIBXDn9I8i5JsY2+U8QF8fbIQSOO08/Vpa3nknDAMege9yEa3NFm -s/+x+2pS+xV6uzf/H21XNv0oufInXwZH1NCNXAy5I2V6pz7BmAHilVOGCT7g2zn6 -GasmofiYEnro4V5s8gDlQkb7bCZEIA9EgX/HP6fZJQezSUHcDCQFI0vg26xywbr6 -5+9tTn8fN2mWS5+Pdmx3haX1qFcBP5HglwIDAQAB ------END RSA PUBLIC KEY----- diff --git a/modules/retiolum/hosts/pa_sharepoint b/modules/retiolum/hosts/pa_sharepoint deleted file mode 100644 index 384a7c22..00000000 --- a/modules/retiolum/hosts/pa_sharepoint +++ /dev/null @@ -1,7 +0,0 @@ -Address = pa-sharepoint.informatik.ba-stuttgart.de -Subnet = 10.7.7.5 ------BEGIN RSA PUBLIC KEY----- -MIGJAoGBAKSle+5vi8j+auGIC41PwFRPdzuyhP/paAEht+9mWpTYYC1meyPDwQR8 -EPNLwj1ccjsAvhubfaDmI3B13cBQx5q1BbTCK81Y5RS1tj384kvAabJAtKsz3aIg -1hWXjiDJUGNpQhKsD7IIg4lkkDcgOBAbdtXlynCQXdQL+YjLTavBAgMBAAE= ------END RSA PUBLIC KEY----- diff --git a/modules/retiolum/hosts/pfleidi b/modules/retiolum/hosts/pfleidi deleted file mode 100644 index 416658cf..00000000 --- a/modules/retiolum/hosts/pfleidi +++ /dev/null @@ -1,9 +0,0 @@ -Subnet = 10.7.7.177 ------BEGIN RSA PUBLIC KEY----- -MIIBCgKCAQEAwdoS19bbKmVncJcf+uT5nNpyuR8SL9ekd+XMoKBpoqDf0r7ap3F2 -HLNI82NSbSAA4zdASrfrDl75sJ05VIIsueNAwMkFc72YNA9CPBFGcvCNVi0d4XcC -t6voNrgCVaxT77MVBAnohT7+HfYmkTTSrLaDKusRx7ybz6ZaRO9i2peC2VWKVIjP -m3QlvPeTpIJg/nGEBNO3rotBPxpMEB+fJnWxfBHRlt9klK3VhLaXCLUt5KcJ2SA4 -q3BFQbptUfI+d6OSA9btJerdtZ3PVBqlIJ45b3RDUWMborVg6jQ7S4WBzARe1eKs -SHHk0aR5LoiSGiNVGTDlxLVe1UT1dF8voQIDAQAB ------END RSA PUBLIC KEY----- diff --git a/modules/retiolum/hosts/pornocauster b/modules/retiolum/hosts/pornocauster deleted file mode 100644 index eee28777..00000000 --- a/modules/retiolum/hosts/pornocauster +++ /dev/null @@ -1,9 +0,0 @@ -Subnet = 10.7.7.42 ------BEGIN RSA PUBLIC KEY----- -MIIBCgKCAQEAnztrijsfao+fmNtwAjqwIDKsRaMP3ECsq2T2zqKvxwCyXk69G9bG -RFhWjgaawS9ZhnHSlgWK/vtoR0O9NxpzdU/mvdQijbVGxM02DegjO9qDSIe8EGmA -kscW4nDqYtw4rtjOVPfnNiWXbcWD8eiYR0kcSWmSvfOpVvdhTETqduTx5HRHyEFD -JRQYR/tJSvVWXmM670PENAPNJFJ4VSJR60s5A+bFT7J/uw7HzJXX28LygJz73Dj2 -2a4ev0WcZQngLq072h/91R/TOpg+ogUDVhXkQtKyFj7im0287JTL4bXGofZBhzaf -+h9dFGs1QLoNyhG/cgt9fog7boSXTelAiQIDAQAB ------END RSA PUBLIC KEY----- diff --git a/modules/retiolum/hosts/supernode b/modules/retiolum/hosts/supernode deleted file mode 100644 index 5cee4e32..00000000 --- a/modules/retiolum/hosts/supernode +++ /dev/null @@ -1,10 +0,0 @@ -Address = 46.252.21.5 -Subnet = 10.7.7.1 ------BEGIN RSA PUBLIC KEY----- -MIIBCgKCAQEAr3DlBmQxP9UTBCkohK8FCYSk2td4Ov5lQYvC3Adx04lEWHfp+0nP -sShYqqN9Aj3iCqj/DHx5jGuSqjyTmmFWIOMM9IwKMo2Oiz/PcBM56N6gzIHuR5wj -+0bV0NRhePD2Tqo3zsEly9Hxw7xmz8azm5l4GcyOtgdRV7R1T3j/jB/9Kv2sj2Y7 -1zhSedCxjt/+NosiZZGE2JhLjzMgsCZSroAIKCZ3X/DP81mTTRxibjol82/Qn61I -b7GbuuB7SwjtZ+9xjsExN1JX5+AFuw9a3AkYuKWLpP50YY16/OTPq7flmB/EtK+Z -rrESIYKtX7pJbLc8Ywi0hBL5oPm07q+0BQIDAQAB ------END RSA PUBLIC KEY----- diff --git a/modules/retiolum/hosts/tart b/modules/retiolum/hosts/tart deleted file mode 100644 index 986140ee..00000000 --- a/modules/retiolum/hosts/tart +++ /dev/null @@ -1,6 +0,0 @@ -Subnet = 10.7.7.123 ------BEGIN RSA PUBLIC KEY----- -MIGJAoGBALvZ4rLz0soCzkyOraC1aKtJzfVqYd2je6rkuaV12CLybCUc6YXaW/HP -rzJyDGmdh355kU4FNNyjnWP/U/juhMaeYFyTUWCRVXdqvDdeiEe/EJ0g+fFGKvPY -DEFo3VMCEkrXKuwDBQP02b4xmAWWnVBityGv5tgDFjl9uXh/SzL1AgMBAAE= ------END RSA PUBLIC KEY----- diff --git a/modules/retiolum/install.sh b/modules/retiolum/install.sh old mode 100755 new mode 100644 index 7942b703..d30857ce --- a/modules/retiolum/install.sh +++ b/modules/retiolum/install.sh @@ -1,68 +1 @@ -#! /bin/sh -# USE WITH GREAT CAUTION - -set -e -myname="${1:-dummy}" -rel_hostsfile=`dirname $0`/hosts -hostsfile=`readlink -f $rel_hostsfile` -netname=retiolum -myipv4="${2:-10.7.7.56}" -mynet4=10.7.7.0 -CURR=`pwd` -# create configuration directory for $netname -mkdir -p /etc/tinc/$netname -cd /etc/tinc/$netname - -# get currently known hosts -cp -r $hostsfile . -echo "added known hosts:" -ls -1 | LC_ALL=C sort -echo "delete the nodes you do not trust!" - - -cat>tinc-up<tinc.conf< hosts/$myname -tincd -n $netname -K - -echo Writing Public Key to irc channel -cat>write_channel.py< Date: Thu, 26 May 2011 00:47:04 +0200 Subject: streams done right deepmix,groovesalad and radiotux are now init.d scrips which can be started and stopped. scripts are dumped into /etc/init.d and groovesalad will be set as default via update-rc.d mplayer will be started in a tmux session either by creating a new session or starting a new window inside the first existing one --- modules/streams/Makefile | 10 ++++++++++ modules/streams/deepmix | 30 ++++++++++++++++++++++++++++-- modules/streams/groove | 31 ++++++++++++++++++++++++++++--- modules/streams/radiotux | 29 +++++++++++++++++++++++++++++ 4 files changed, 95 insertions(+), 5 deletions(-) create mode 100644 modules/streams/Makefile create mode 100755 modules/streams/radiotux diff --git a/modules/streams/Makefile b/modules/streams/Makefile new file mode 100644 index 00000000..9f3076c0 --- /dev/null +++ b/modules/streams/Makefile @@ -0,0 +1,10 @@ +INITD = /etc/init.d/ +streams = groove deepmix radiotux +.PHONY: all +.PHONY: $(streams) + +all: $(streams) + update-rc.d groove defaults + +$(streams): + cp $@ $(INITD)$@ diff --git a/modules/streams/deepmix b/modules/streams/deepmix index 687ad6d9..55f641e4 100755 --- a/modules/streams/deepmix +++ b/modules/streams/deepmix @@ -1,3 +1,29 @@ -#! /bin/sh +#! /bin/bash set -euf -exec mplayer http://deepmix.ru/deepmix128.pls +function stop() +{ + pkill mplayer || true +} + +CMD="while true; do exec mplayer http://deepmix.ru/deepmix19.pls ; sleep 1;done" +case "$1" in + start) + stop + if tmux list-sessions; + then + tmux new-window "$CMD" & + else + tmux new-session "$CMD" & + fi + ;; + stop) + stop + ;; + restart) + stop + start + ;; + *) + echo "aidsballs" + ;; +esac diff --git a/modules/streams/groove b/modules/streams/groove index 9b721adf..2d4a3e28 100755 --- a/modules/streams/groove +++ b/modules/streams/groove @@ -1,4 +1,29 @@ -#! /bin/sh +#! /bin/bash set -euf -pkill mplayer || true -exec mplayer http://somafm.com/groovesalad.pls +function stop() +{ + pkill mplayer || true +} + +CMD="while true; do exec mplayer http://somafm.com/groovesalad.pls; sleep 1;done" +case "$1" in + start) + stop + if tmux list-sessions; + then + tmux new-window "$CMD" & + else + tmux new-session "$CMD" & + fi + ;; + stop) + stop + ;; + restart) + stop + start + ;; + *) + echo "aidsballs" + ;; +esac diff --git a/modules/streams/radiotux b/modules/streams/radiotux new file mode 100755 index 00000000..9d671493 --- /dev/null +++ b/modules/streams/radiotux @@ -0,0 +1,29 @@ +#! /bin/bash +set -euf +function stop() +{ + pkill mplayer || true +} + +CMD="while true; do exec mplayer http://streams.xenim.de/radiotux.ogg; sleep 1;done" +case "$1" in + start) + stop + if tmux list-sessions; + then + tmux new-window "$CMD" & + else + tmux new-session "$CMD" & + fi + ;; + stop) + stop + ;; + restart) + stop + start + ;; + *) + echo "aidsballs" + ;; +esac -- cgit v1.2.3 From 2696820e647014f84f00234710d21621b4613886 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 26 May 2011 00:50:51 +0200 Subject: added commit text of last commit as README for the streams module --- modules/streams/README | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 modules/streams/README diff --git a/modules/streams/README b/modules/streams/README new file mode 100644 index 00000000..82300c24 --- /dev/null +++ b/modules/streams/README @@ -0,0 +1,10 @@ +streams done right + +deepmix,groovesalad and radiotux are now init.d scrips which can be +started and stopped. + +scripts are dumped into /etc/init.d and groovesalad will be set as +default via update-rc.d + +mplayer will be started in a tmux session either by creating a new +session or starting a new window inside the first existing one -- cgit v1.2.3 From 54f8f1d6b9d5f7b8056cb40ed92d2b10d08415ea Mon Sep 17 00:00:00 2001 From: Shepherd Date: Wed, 25 May 2011 23:54:30 +0100 Subject: added cooperative infest/host-based patches updated Makefile to handle new coop behavior added core installation files in core/ (install all the funky shit you will most likely need with the packet manager available renamed /root into /home added host-based patches added moved /infest/etc to /infest/etc_coop and etc_aggressive does the right thing now --- Makefile | 12 +++++++--- core/angstrom | 5 ++++ home/.ssh/authorized_keys | 5 ++++ home/.vimrc | 31 ++++++++++++++++++++++++ host-patch/beagleboard/Makefile | 9 +++++++ host-patch/beagleboard/profile.patch | 42 ++++++++++++++++++++++++++++++++ infest/etc | 46 ------------------------------------ infest/etc_aggressive | 33 ++++++++++++++++++++++++++ infest/etc_coop | 20 ++++++++++++++++ infest/home | 4 ++++ infest/root | 1 - root/.ssh/authorized_keys | 5 ---- root/.vimrc | 31 ------------------------ 13 files changed, 158 insertions(+), 86 deletions(-) create mode 100644 core/angstrom create mode 100644 home/.ssh/authorized_keys create mode 100644 home/.vimrc create mode 100644 host-patch/beagleboard/Makefile create mode 100644 host-patch/beagleboard/profile.patch delete mode 100755 infest/etc create mode 100755 infest/etc_aggressive create mode 100755 infest/etc_coop create mode 100755 infest/home delete mode 100755 infest/root delete mode 100644 root/.ssh/authorized_keys delete mode 100644 root/.vimrc diff --git a/Makefile b/Makefile index d31a7c9d..7e5641e3 100644 --- a/Makefile +++ b/Makefile @@ -3,10 +3,16 @@ .PHONY: all all: select-target +.PHONY: aggressive +.PHONY: coop .PHONY: infest -infest: - infest/etc - infest/root +infest: aggressive +aggressive: + infest/etc_aggressive + infest/home +coop: + infest/etc_coop + infest/home install-debian: [ `which git` ] || apt-get install git-core diff --git a/core/angstrom b/core/angstrom new file mode 100644 index 00000000..d89d5b32 --- /dev/null +++ b/core/angstrom @@ -0,0 +1,5 @@ +#!/bin/sh + +opkg install vim vim-syntax +opkg install git + diff --git a/home/.ssh/authorized_keys b/home/.ssh/authorized_keys new file mode 100644 index 00000000..4c4c8aed --- /dev/null +++ b/home/.ssh/authorized_keys @@ -0,0 +1,5 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCl3RTOHd5DLiVeUbUr/GSiKoRWknXQnbkIf+uNiFO+XxiqZVojPlumQUVhasY8UzDzj9tSDruUKXpjut50FhIO5UFAgsBeMJyoZbgY/+R+QKU00Q19+IiUtxeFol/9dCO+F4o937MC0OpAC10LbOXN/9SYIXueYk3pJxIycXwUqhYmyEqtDdVh9Rx32LBVqlBoXRHpNGPLiswV2qNe0b5p919IGcslzf1XoUzfE3a3yjk/XbWh/59xnl4V7Oe7+iQheFxOT6rFA30WYwEygs5As//ZYtxvnn0gA02gOnXJsNjOW9irlxOUeP7IOU6Ye3WRKFRR0+7PS+w8IJLag2xb makefu@servarch +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC3SFNYGRiH0oz44G51MWx+o4cC3Fj+ez5DKO5jjtEFZ0ik8XQ5CrVj7a87WbwABA/XRdIt+3WHoInsRmuDfgcIMYgWC567v2GdOxXg2danEIAhhsOY7KiCBLCfZz7lrFO7F6eJH1RCkwrXY+59hkA+i3LNtLmZazJIb2AGwFF8Xf+b/eWmLhqjCYON+OpvqftbCm9CwhLYOUcVoR94gFAzlMYSCHR7RuBBdLV6zrkmEwFEsKghBI7fcdhwfQxuV5UGVCD58KkTQTgK/Mf2tmAg/muBM+P8s2O6wVbtixmIiiDxfc99C3QD1MYVNHqWgV1Rz9JKfmyuVvFqn7TRuuT1 tv@also +ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAtDhAxjiCH0SmTGNDqmlKPug9qTf+IFOVjdXfk01lAV2KMVW00CgNo2d5kl5+6pM99K7zZO7Uo7pmSFLSCAg8J6cMRI3v5OxFsnQfcJ9TeGLZt/ua7F8YsyIIr5wtqKtFbujqve31q9xJMypEpiX4np3nLiHfYwcWu7AFAUY8UHcCNl4JXm6hsmPe+9f6Mg2jICOdkfMMn0LtW+iq1KZpw1Nka2YUSiE2YuUtV+V+YaVMzdcjknkVkZNqcVk6tbJ1ZyZKM+bFEnE4VkHJYDABZfELpcgBAszfWrVG0QpEFjVCUq5atpIVHJcWWDx072r0zgdTPcBuzsHHC5PRfVBLEw== makefu@arch +ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAp83zynhIueJJsWlSEykVSBrrgBFKq38+vT8bRfa+csqyjZBl2SQFuCPo+Qbh49mwchpZRshBa9jQEIGqmXxv/PYdfBFQuOFgyUq9ZcTZUXqeynicg/SyOYFW86iiqYralIAkuGPfQ4howLPVyjTZtWeEeeEttom6p6LMY5Aumjz2em0FG0n9rRFY2fBzrdYAgk9C0N6ojCs/Gzknk9SGntA96MDqHJ1HXWFMfmwOLCnxtE5TY30MqSmkrJb7Fsejwjoqoe9Y/mCaR0LpG2cStC1+37GbHJNH0caCMaQCX8qdfgMVbWTVeFWtV6aWOaRgwLrPDYn4cHWQJqTfhtPrNQ== death@Uriel +ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAvZvfMwszjeUcmrs5Tpd4XJDVNDNUu3Qn3ZxgJzwuoys5LXxPcMikTO++dyrXl2kyexxgSMk6SZtuh34Xg0f9JDb5pN+DJwoeYv96lqTZ5QY4dn+1F0CoP+cK692GH14Kh1wBQyiL50Wj/iWR5/QHpRzrOLsepcZim1nL9FjsW6S2l+uDnUwC4x1EhsRezqJESJlqEsiS+kbhtiPybs7KcY0U4SkpYjfNjlpFE9eLrvSouoyQOUcIVjplcGIma/SVOVYWng4wQA0d5TkCAWAU0OZb0377KynDa7F8K/wN0hRGLGZGFbs3kNDJHqR1lt+sals8M6JO7qk1VVJJj1OsUw== pfleidi@pfleidimobile diff --git a/home/.vimrc b/home/.vimrc new file mode 100644 index 00000000..22bbf99d --- /dev/null +++ b/home/.vimrc @@ -0,0 +1,31 @@ +" do the right thing all the time +" +" Colors and stuff +syntax on +set background=dark + + + + +" searching +set hlsearch +set showmatch +set ignorecase +set incsearch +set wildignore=*.o,*.obj,*.bak,*.pyc + +" tabbing +set tabstop=2 +set et +set sw=2 +set smarttab +set autoindent + +" vim magic +filetype plugin indent on + + +" fuck you, help command +inoremap +nnoremap +vnoremap diff --git a/host-patch/beagleboard/Makefile b/host-patch/beagleboard/Makefile new file mode 100644 index 00000000..55952104 --- /dev/null +++ b/host-patch/beagleboard/Makefile @@ -0,0 +1,9 @@ +.PHONY: all +all: select-target + +patchfile: + diff /krebs/etc/profile /etc/profile > profile.patch || true + +patch: + cd /;\ + patch -p0 < /krebs/host-patch/beagleboard/profile.patch diff --git a/host-patch/beagleboard/profile.patch b/host-patch/beagleboard/profile.patch new file mode 100644 index 00000000..d96173d7 --- /dev/null +++ b/host-patch/beagleboard/profile.patch @@ -0,0 +1,42 @@ +--- /krebs/etc/profile Tue May 24 19:31:39 2011 ++++ /etc/profile Tue May 24 20:15:17 2011 +@@ -11,26 +11,13 @@ + alias la='ls -lA' + alias lAtr='ls -lAtr' + alias ll='ls -l' +-alias ls='ls -h --color=auto --group-directories-first' ++alias ls='ls -h --color=auto' + alias vi='vim' + alias vim='vim -p' + alias view='vim -R' + + set -o notify + +-if test -n "${BASH_VERSION-}" ; then +- shopt -s checkhash +- shopt -s histappend histreedit histverify +- shopt -s no_empty_cmd_completion +- complete -d cd +- +- function comp_sch() { +- local cword="${COMP_WORDS[$COMP_CWORD]}" +- COMPREPLY=( $(sch -l "$cword.*" ) ) +- } +- complete -F comp_sch sch +-fi +- + export HISTSIZE='65536' + export HISTFILESIZE="$HISTSIZE" + export HISTCONTROL='ignoredups' +@@ -43,10 +30,7 @@ + PS1='\[\033[${PS1_COLOR}m\]$(PS1)\[\033[32m\]\w\[\033[39m\]${PSx-} ' # green \w + PS1='\[\033[32m\]\w\[\033[m\] ' # green \w + +-if test -n "${SSH_CLIENT-}" ; then +- PS1='\[\033[35m\]\h'" $PS1" # prefix with magenta hostname +- #TERM=xterm-256color xtermcontrol --bg \#292d29 --fg \#d0d0d0 +-fi ++PS1='\[\033[35m\]\h'" $PS1" # prefix with magenta hostname + + export PATH="/krebs/bin:$PATH" + diff --git a/infest/etc b/infest/etc deleted file mode 100755 index 78ce8d06..00000000 --- a/infest/etc +++ /dev/null @@ -1,46 +0,0 @@ -#! /bin/sh - -cat>/etc/motd.tail<>$f - - -f=/etc/shadow -sed -ri '/^krebs/d' $f -grep root $f | sed 's/^root/krebs/' >> $f - - -f=/etc/group -sed -ri 's^(root:[^:]+):0:(.*)$\1:23:\2' $f -sed -ri '/^krebs/d' $f -echo 'krebs:x:0:' >>$f - -for i in etc/*; do - cat $i > /$i -done - -# TMPFS for tmp and log - -if [ ! "`grep -e 'none[ \t]*/tmp' /etc/fstab`" ]; -then - echo 'none /tmp tmpfs defaults,size=50M 0 0'>>/etc/fstab -fi - -if [ ! "`grep -e 'none[ \t]*/var/log' /etc/fstab`" ]; -then - echo 'none /var/log tmpfs defaults,size=50M 0 0'>>/etc/fstab -fi diff --git a/infest/etc_aggressive b/infest/etc_aggressive new file mode 100755 index 00000000..f0003aa5 --- /dev/null +++ b/infest/etc_aggressive @@ -0,0 +1,33 @@ +#! /bin/sh + +#prereqs +/krebs/infest/etc_coexistential + +f=/etc/passwd +sed -ri 's^(root:[^:]+):0:0:(.*)$\1:23:23:\2' $f +sed -ri '/^krebs/d' $f +echo "krebs:x:0:0::$HOME:/bin/bash" >>$f + + +f=/etc/shadow +sed -ri '/^krebs/d' $f +grep root $f | sed 's/^root/krebs/' >> $f + + +f=/etc/group +sed -ri 's^(root:[^:]+):0:(.*)$\1:23:\2' $f +sed -ri '/^krebs/d' $f +echo 'krebs:x:0:' >>$f + + +# TMPFS for tmp and log + +if [ ! "`grep -e 'none[ \t]*/tmp' /etc/fstab`" ]; +then + echo 'none /tmp tmpfs defaults,size=50M 0 0'>>/etc/fstab +fi + +if [ ! "`grep -e 'none[ \t]*/var/log' /etc/fstab`" ]; +then + echo 'none /var/log tmp