From 979ddbf38fcc4985a8c902bf1b89b5ab6a119e16 Mon Sep 17 00:00:00 2001 From: Felix Richter Date: Thu, 16 Jun 2011 12:24:12 +0200 Subject: added bestuecker/serverswitch2 to Monitoring --- Monitoring/TODO | 2 ++ Monitoring/conf/shack_infrastructure.cfg | 32 ++++++++++++++++++++------------ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/Monitoring/TODO b/Monitoring/TODO index e69de29b..a3f31ff7 100644 --- a/Monitoring/TODO +++ b/Monitoring/TODO @@ -0,0 +1,2 @@ +check_external_commands=0 -> =1 in nagios.cfg +--> rwx -> /var/lib/nagios3/rw/nagios.cmd diff --git a/Monitoring/conf/shack_infrastructure.cfg b/Monitoring/conf/shack_infrastructure.cfg index 78c220b1..b463978a 100644 --- a/Monitoring/conf/shack_infrastructure.cfg +++ b/Monitoring/conf/shack_infrastructure.cfg @@ -64,6 +64,15 @@ define host{ hostgroups shack-rz } +define host{ + use generic-host + host_name shack-serverswitch2 + parents shack-serverswitch + alias Shack switch Rack 2 (cisco 3524) + address 10.42.0.5 + hostgroups shack-rz,ssh-servers + } + define service { host_name shack-gw service_description DNS Service @@ -86,14 +95,6 @@ define host{ hostgroups shack-rz } -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 @@ -145,10 +146,6 @@ define service{ check_command check_sip } - - - - # # Shack DNS Server # @@ -222,3 +219,14 @@ define service { check_command check_ldap!shammunity } +# +# Random stuff (not necessary located in RZ) +# +define host{ + use generic-host + host_name shack-pnp + alias Shack Bestueckungsautomat + address 10.42.100.5 + parents shack-coreswitch + #hostgroups shack-rz + } -- cgit v1.2.3 From 344d69185af53427be0dc1243066ed04e8001879 Mon Sep 17 00:00:00 2001 From: Felix Richter Date: Thu, 16 Jun 2011 12:55:08 +0200 Subject: updated mining rigs, RZ Guests in Monitoring Monitoring/conf/shack_guests: mining rigs updated (ip),moved pnp Monitoring/conf/shack_infrastructure: Bestuecker moved to guests --- Monitoring/conf/shack_guests.cfg | 32 +++++++++++++++++++++++++------- Monitoring/conf/shack_infrastructure.cfg | 8 -------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/Monitoring/conf/shack_guests.cfg b/Monitoring/conf/shack_guests.cfg index 75e92f17..d134150c 100644 --- a/Monitoring/conf/shack_guests.cfg +++ b/Monitoring/conf/shack_guests.cfg @@ -6,31 +6,49 @@ define host{ host_name gauda0 parents shack-serverswitch alias Gauda0 Bitcoin Mining Rig 0 - address 10.42.1.16 + address 10.42.0.99 hostgroups bitcoin-miner } define host{ use generic-host host_name gauda1 - parents shack-serverswitch + parents shack-serverswitch2 alias Gauda0 Bitcoin Mining Rig 1 - address 10.42.1.20 + address 10.42.0.98 hostgroups bitcoin-miner } define host{ use generic-host host_name gauda2 - parents shack-serverswitch + parents shack-serverswitch2 alias Gauda0 Bitcoin Mining Rig 2 - address 10.42.1.17 + address 10.42.0.97 hostgroups bitcoin-miner } +define host{ + use generic-host + host_name chinaman + parents shack-serverswitch2 + alias Chinaman Bitcoin Mining Rig + address 10.42.0.96 + hostgroups bitcoin-miner,tinc-nodes + } + define host{ use generic-host host_name SaschaPC parents shack-serverswitch - alias Saschas Bitcoin Miner + alias Sascha Server address 10.42.23.100 - hostgroups bitcoin-miner + #hostgroups bitcoin-miner + } + +define host{ + use generic-host + host_name shack-pnp + alias Shack Bestueckungsautomat + address 10.42.100.5 + parents shack-coreswitch + #hostgroups shack-rz } diff --git a/Monitoring/conf/shack_infrastructure.cfg b/Monitoring/conf/shack_infrastructure.cfg index b463978a..2a250efc 100644 --- a/Monitoring/conf/shack_infrastructure.cfg +++ b/Monitoring/conf/shack_infrastructure.cfg @@ -222,11 +222,3 @@ define service { # # Random stuff (not necessary located in RZ) # -define host{ - use generic-host - host_name shack-pnp - alias Shack Bestueckungsautomat - address 10.42.100.5 - parents shack-coreswitch - #hostgroups shack-rz - } -- cgit v1.2.3 From 7449e5e3192ad9128bd73c32e06927bdb8dcbc0f Mon Sep 17 00:00:00 2001 From: Felix Richter Date: Thu, 16 Jun 2011 13:04:21 +0200 Subject: Monitoring/conf/shack_guests: added tinc addr --- Monitoring/conf/shack_guests.cfg | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Monitoring/conf/shack_guests.cfg b/Monitoring/conf/shack_guests.cfg index d134150c..869583f7 100644 --- a/Monitoring/conf/shack_guests.cfg +++ b/Monitoring/conf/shack_guests.cfg @@ -13,7 +13,7 @@ define host{ use generic-host host_name gauda1 parents shack-serverswitch2 - alias Gauda0 Bitcoin Mining Rig 1 + alias Gauda1 Bitcoin Mining Rig 1 address 10.42.0.98 hostgroups bitcoin-miner } @@ -21,7 +21,7 @@ define host{ use generic-host host_name gauda2 parents shack-serverswitch2 - alias Gauda0 Bitcoin Mining Rig 2 + alias Gauda2 Bitcoin Mining Rig 2 address 10.42.0.97 hostgroups bitcoin-miner } @@ -32,6 +32,7 @@ define host{ parents shack-serverswitch2 alias Chinaman Bitcoin Mining Rig address 10.42.0.96 + _TINC_ADDRESS 10.7.7.6 hostgroups bitcoin-miner,tinc-nodes } -- cgit v1.2.3 From da094087224d9822ace3cb83a49eaa96492737ef Mon Sep 17 00:00:00 2001 From: Felix Richter Date: Thu, 16 Jun 2011 13:08:06 +0200 Subject: Monitoring/conf/shack_guests.cfg: added ssh-servers --- Monitoring/conf/shack_guests.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Monitoring/conf/shack_guests.cfg b/Monitoring/conf/shack_guests.cfg index 869583f7..ba460366 100644 --- a/Monitoring/conf/shack_guests.cfg +++ b/Monitoring/conf/shack_guests.cfg @@ -33,7 +33,7 @@ define host{ alias Chinaman Bitcoin Mining Rig address 10.42.0.96 _TINC_ADDRESS 10.7.7.6 - hostgroups bitcoin-miner,tinc-nodes + hostgroups bitcoin-miner,tinc-nodes,ssh-servers } define host{ -- cgit v1.2.3 From c5712707d569d64abe96d46929b30b7293d18381 Mon Sep 17 00:00:00 2001 From: Felix Richter Date: Thu, 16 Jun 2011 14:29:37 +0200 Subject: added myself to contacts --- Monitoring/conf/shack_contacts.cfg | 17 +++++++++++++++++ Monitoring/conf/shack_guests.cfg | 13 ++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 Monitoring/conf/shack_contacts.cfg diff --git a/Monitoring/conf/shack_contacts.cfg b/Monitoring/conf/shack_contacts.cfg new file mode 100644 index 00000000..c8b63a56 --- /dev/null +++ b/Monitoring/conf/shack_contacts.cfg @@ -0,0 +1,17 @@ +define contact{ + contact_name makefu + alias makefu + service_notification_period 24x7 + host_notification_period 24x7 + service_notification_options w,u,c,r + host_notification_options d,u,r + service_notification_commands notify-by-email + host_notification_commands host-notify-by-email,host-notify-by-epager + email shack_nagios_notification@syntax-fehler.de + } +define contactgroup{ + contactgroup_name krebsminers + alias Krebsminers + members makefu + } + diff --git a/Monitoring/conf/shack_guests.cfg b/Monitoring/conf/shack_guests.cfg index ba460366..5c0a4cbf 100644 --- a/Monitoring/conf/shack_guests.cfg +++ b/Monitoring/conf/shack_guests.cfg @@ -34,17 +34,27 @@ define host{ address 10.42.0.96 _TINC_ADDRESS 10.7.7.6 hostgroups bitcoin-miner,tinc-nodes,ssh-servers + contactgroups krebsminers } define host{ use generic-host - host_name SaschaPC + host_name Sascha privater Server parents shack-serverswitch alias Sascha Server address 10.42.23.100 #hostgroups bitcoin-miner } +define host{ + use generic-host + host_name Telefonzelle + parents shack-coreswitch + alias Telefonzelle + address 10.42.23.101 + #hostgroups bitcoin-miner + } + define host{ use generic-host host_name shack-pnp @@ -53,3 +63,4 @@ define host{ parents shack-coreswitch #hostgroups shack-rz } + -- cgit v1.2.3 From 7a454abe517dace9a9e717e09df2436ec1dfa378 Mon Sep 17 00:00:00 2001 From: Felix Richter Date: Thu, 16 Jun 2011 14:53:53 +0200 Subject: migrated all necessary configuration used the Debian config for krebs to provide a generic environment without dependencies to other nagios systems --- Monitoring/Makefile | 3 +- Monitoring/conf/extinfo.cfg | 9 ++++++ Monitoring/conf/hostgroups_generic.cfg | 28 +++++++++++++++++++ Monitoring/conf/services.cfg | 26 ++++++++++++++++++ Monitoring/conf/shack_contacts.cfg | 4 +-- Monitoring/conf/shack_guests.cfg | 2 +- Monitoring/conf/templates.cfg | 45 ++++++++++++++++++++++++++++++ Monitoring/conf/timeperiods.cfg | 50 ++++++++++++++++++++++++++++++++++ 8 files changed, 162 insertions(+), 5 deletions(-) create mode 100644 Monitoring/conf/extinfo.cfg create mode 100644 Monitoring/conf/hostgroups_generic.cfg create mode 100644 Monitoring/conf/services.cfg create mode 100644 Monitoring/conf/templates.cfg create mode 100644 Monitoring/conf/timeperiods.cfg diff --git a/Monitoring/Makefile b/Monitoring/Makefile index a42707e3..90c7e0c1 100644 --- a/Monitoring/Makefile +++ b/Monitoring/Makefile @@ -5,8 +5,7 @@ HTDOCS = /usr/share/nagios3/htdocs .phony: debian debian: [ `which nagios3` ] || apt-get install nagios3 - rm $(NAGDIR)/conf.d/localhost_nagios2.cfg || true - rm $(NAGDIR)/conf.d/host-gateway_nagios3.cfg || true + rm $(NAGDIR)/conf.d/* || true cp -r conf/* $(NAGDIR)/conf.d/ htpasswd -bc htpasswd.users nagiosadmin krebs htpasswd -b htpasswd.users shack shackit diff --git a/Monitoring/conf/extinfo.cfg b/Monitoring/conf/extinfo.cfg new file mode 100644 index 00000000..e4300b72 --- /dev/null +++ b/Monitoring/conf/extinfo.cfg @@ -0,0 +1,9 @@ +define hostextinfo{ + hostgroup_name debian-servers + notes Debian GNU/Linux servers +# notes_url http://webserver.localhost.localdomain/hostinfo.pl?host=netware1 + icon_image base/debian.png + icon_image_alt Debian GNU/Linux + vrml_image debian.png + statusmap_image base/debian.gd2 + } diff --git a/Monitoring/conf/hostgroups_generic.cfg b/Monitoring/conf/hostgroups_generic.cfg new file mode 100644 index 00000000..4e3625c5 --- /dev/null +++ b/Monitoring/conf/hostgroups_generic.cfg @@ -0,0 +1,28 @@ +# A simple wildcard hostgroup +define hostgroup { + hostgroup_name all + alias All Servers + members * + } + +# A list of your Debian GNU/Linux servers +define hostgroup { + hostgroup_name debian-servers + alias Debian GNU/Linux Servers + members localhost + } + +# A list of your web servers +define hostgroup { + hostgroup_name http-servers + alias HTTP servers + members localhost + } + +# A list of your ssh-accessible servers +define hostgroup { + hostgroup_name ssh-servers + alias SSH servers + members localhost + } + diff --git a/Monitoring/conf/services.cfg b/Monitoring/conf/services.cfg new file mode 100644 index 00000000..e3a61eb0 --- /dev/null +++ b/Monitoring/conf/services.cfg @@ -0,0 +1,26 @@ +# check that web services are running +define service { + hostgroup_name http-servers + service_description HTTP + check_command check_http + use generic-service + notification_interval 0 ; set > 0 if you want to be renotified +} + +# check that ssh services are running +define service { + hostgroup_name ssh-servers + service_description SSH + check_command check_ssh + use generic-service + notification_interval 0 ; set > 0 if you want to be renotified +} + +# check that ping-only hosts are up +define service { +# hostgroup_name ping-servers + service_description PING + check_command check_ping!100.0,20%!500.0,60% + use generic-service + notification_interval 0 ; set > 0 if you want to be renotified +} diff --git a/Monitoring/conf/shack_contacts.cfg b/Monitoring/conf/shack_contacts.cfg index c8b63a56..e46c539a 100644 --- a/Monitoring/conf/shack_contacts.cfg +++ b/Monitoring/conf/shack_contacts.cfg @@ -5,8 +5,8 @@ define contact{ host_notification_period 24x7 service_notification_options w,u,c,r host_notification_options d,u,r - service_notification_commands notify-by-email - host_notification_commands host-notify-by-email,host-notify-by-epager + service_notification_commands notify-service-by-email + host_notification_commands notify-host-by-email email shack_nagios_notification@syntax-fehler.de } define contactgroup{ diff --git a/Monitoring/conf/shack_guests.cfg b/Monitoring/conf/shack_guests.cfg index 5c0a4cbf..45617461 100644 --- a/Monitoring/conf/shack_guests.cfg +++ b/Monitoring/conf/shack_guests.cfg @@ -34,7 +34,7 @@ define host{ address 10.42.0.96 _TINC_ADDRESS 10.7.7.6 hostgroups bitcoin-miner,tinc-nodes,ssh-servers - contactgroups krebsminers + contact_groups krebsminers } define host{ diff --git a/Monitoring/conf/templates.cfg b/Monitoring/conf/templates.cfg new file mode 100644 index 00000000..41807e1c --- /dev/null +++ b/Monitoring/conf/templates.cfg @@ -0,0 +1,45 @@ +# generic service template definition +define service{ + name generic-service ; The 'name' of this service template + active_checks_enabled 1 ; Active service checks are enabled + passive_checks_enabled 1 ; Passive service checks are enabled/accepted + parallelize_check 1 ; Active service checks should be parallelized (disabling this can lead to major performance problems) + obsess_over_service 1 ; We should obsess over this service (if necessary) + check_freshness 0 ; Default is to NOT check service 'freshness' + notifications_enabled 1 ; Service notifications are enabled + event_handler_enabled 1 ; Service event handler is enabled + flap_detection_enabled 1 ; Flap detection is enabled + failure_prediction_enabled 1 ; Failure prediction is enabled + process_perf_data 1 ; Process performance data + retain_status_information 1 ; Retain status information across program restarts + retain_nonstatus_information 1 ; Retain non-status information across program restarts + notification_interval 0 ; Only send notifications on status change by default. + is_volatile 0 + check_period 24x7 + normal_check_interval 5 + retry_check_interval 1 + max_check_attempts 4 + notification_period 24x7 + notification_options w,u,c,r + contact_groups admins + register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE! + } +# Generic host definition template - This is NOT a real host, just a template! + +define host{ + name generic-host ; The name of this host template + notifications_enabled 1 ; Host notifications are enabled + event_handler_enabled 1 ; Host event handler is enabled + flap_detection_enabled 1 ; Flap detection is enabled + failure_prediction_enabled 1 ; Failure prediction is enabled + process_perf_data 1 ; Process performance data + retain_status_information 1 ; Retain status information across program restarts + retain_nonstatus_information 1 ; Retain non-status information across program restarts + check_command check-host-alive + max_check_attempts 10 + notification_interval 0 + notification_period 24x7 + notification_options d,u,r + contact_groups admins + register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE! + } diff --git a/Monitoring/conf/timeperiods.cfg b/Monitoring/conf/timeperiods.cfg new file mode 100644 index 00000000..55ecf9df --- /dev/null +++ b/Monitoring/conf/timeperiods.cfg @@ -0,0 +1,50 @@ +############################################################################### +# timeperiods.cfg +############################################################################### + +# This defines a timeperiod where all times are valid for checks, +# notifications, etc. The classic "24x7" support nightmare. :-) + +define timeperiod{ + timeperiod_name 24x7 + alias 24 Hours A Day, 7 Days A Week + sunday 00:00-24:00 + monday 00:00-24:00 + tuesday 00:00-24:00 + wednesday 00:00-24:00 + thursday 00:00-24:00 + friday 00:00-24:00 + saturday 00:00-24:00 + } + +# Here is a slightly friendlier period during work hours +define timeperiod{ + timeperiod_name workhours + alias Standard Work Hours + monday 09:00-17:00 + tuesday 09:00-17:00 + wednesday 09:00-17:00 + thursday 09:00-17:00 + friday 09:00-17:00 + } + +# The complement of workhours +define timeperiod{ + timeperiod_name nonworkhours + alias Non-Work Hours + sunday 00:00-24:00 + monday 00:00-09:00,17:00-24:00 + tuesday 00:00-09:00,17:00-24:00 + wednesday 00:00-09:00,17:00-24:00 + thursday 00:00-09:00,17:00-24:00 + friday 00:00-09:00,17:00-24:00 + saturday 00:00-24:00 + } + +# This one is a favorite: never :) +define timeperiod{ + timeperiod_name never + alias Never + } + +# end of file -- cgit v1.2.3 From 555a47958bf17130680f7e55670c74103e134a3e Mon Sep 17 00:00:00 2001 From: Felix Richter Date: Thu, 16 Jun 2011 15:29:11 +0200 Subject: Monitoring/conf: removed redundant host groups --- Monitoring/conf/hostgroups_nagios2.cfg | 31 ------------------------------- Monitoring/conf/shack_contacts.cfg | 5 +++++ 2 files changed, 5 insertions(+), 31 deletions(-) delete mode 100644 Monitoring/conf/hostgroups_nagios2.cfg diff --git a/Monitoring/conf/hostgroups_nagios2.cfg b/Monitoring/conf/hostgroups_nagios2.cfg deleted file mode 100644 index 63acbf50..00000000 --- a/Monitoring/conf/hostgroups_nagios2.cfg +++ /dev/null @@ -1,31 +0,0 @@ -# Some generic hostgroup definitions - -# A simple wildcard hostgroup -define hostgroup { - hostgroup_name all - alias All Servers - members * - } - -# A list of your Debian GNU/Linux servers -define hostgroup { - hostgroup_name debian-servers - alias Debian GNU/Linux Servers - members localhost - } - -# A list of your web servers -define hostgroup { - hostgroup_name http-servers - alias HTTP servers - members localhost - } - -# A list of your ssh-accessible servers -define hostgroup { - hostgroup_name ssh-servers - alias SSH servers - members localhost - } - - diff --git a/Monitoring/conf/shack_contacts.cfg b/Monitoring/conf/shack_contacts.cfg index e46c539a..832a215e 100644 --- a/Monitoring/conf/shack_contacts.cfg +++ b/Monitoring/conf/shack_contacts.cfg @@ -15,3 +15,8 @@ define contactgroup{ members makefu } +define contactgroup{ + contactgroup_name admins + alias admins + } + -- cgit v1.2.3 From fc7eb1ebb3f922beff6fa164a9a427754362e555 Mon Sep 17 00:00:00 2001 From: Felix Richter Date: Thu, 16 Jun 2011 15:40:53 +0200 Subject: Monitoring/conf: fixed switch service --- Monitoring/conf/shack_infrastructure.cfg | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Monitoring/conf/shack_infrastructure.cfg b/Monitoring/conf/shack_infrastructure.cfg index 2a250efc..f404f3e4 100644 --- a/Monitoring/conf/shack_infrastructure.cfg +++ b/Monitoring/conf/shack_infrastructure.cfg @@ -63,16 +63,33 @@ define host{ address 10.0.10.2 hostgroups shack-rz } - +# +# Serverswitch 2 +# define host{ use generic-host host_name shack-serverswitch2 parents shack-serverswitch alias Shack switch Rack 2 (cisco 3524) address 10.42.0.5 - hostgroups shack-rz,ssh-servers + hostgroups shack-rz + } + +define service { + host_name shack-serverswitch2 + service_description Telnet + use generic-service + check_command check_telnet + } + +define service { + host_name shack-serverswitch2 + service_description Admin HTTP Terminal + use generic-service + check_command check_http } + define service { host_name shack-gw service_description DNS Service -- cgit v1.2.3 From 498ba8daa5af889389114d9cf37b3e7927a2d083 Mon Sep 17 00:00:00 2001 From: Felix Richter Date: Thu, 16 Jun 2011 15:50:03 +0200 Subject: Monitoring: implemented TODOs --- Monitoring/Makefile | 5 +++++ Monitoring/TODO | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Monitoring/Makefile b/Monitoring/Makefile index 90c7e0c1..72269101 100644 --- a/Monitoring/Makefile +++ b/Monitoring/Makefile @@ -10,7 +10,12 @@ debian: htpasswd -bc htpasswd.users nagiosadmin krebs htpasswd -b htpasswd.users shack shackit sed -i 's/\(authorized_for_all_hosts=nagiosadmin\)$$/\1,shack/' $(NAGDIR)/cgi.cfg + sed -i 's/\(check_external_commands=\)0$$/\11/' $(NAGDIR)/nagios.cfg sed -i 's/\(authorized_for_all_services=nagiosadmin\)$$/\1,shack/' $(NAGDIR)/cgi.cfg cp -R htdocs/* $(HTDOCS) cp -r plugins $(NAGLIBDIR) /etc/init.d/nagios3 reload + chown nagios:www-data /var/lib/nagios3 || true + chown nagios:www-data /var/lib/nagios3/rw || true + chmod g+x /var/lib/nagios3 || true + chmod ug=rwx /var/lib/nagios3/rw/nagios.cmd || true diff --git a/Monitoring/TODO b/Monitoring/TODO index a3f31ff7..e69de29b 100644 --- a/Monitoring/TODO +++ b/Monitoring/TODO @@ -1,2 +0,0 @@ -check_external_commands=0 -> =1 in nagios.cfg ---> rwx -> /var/lib/nagios3/rw/nagios.cmd -- cgit v1.2.3 From 6592ad0bd9a8cb806b296998d26ecd8c230487e8 Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 18 Jun 2011 16:34:52 +0200 Subject: initial commit of miner repo --- mining/README | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 mining/README diff --git a/mining/README b/mining/README new file mode 100644 index 00000000..ad8c3468 --- /dev/null +++ b/mining/README @@ -0,0 +1,9 @@ +What to do: +format the usb-stick: +Device Boot Start End Blocks Id System +/dev/sda1 * 1 254 976345 c W95 FAT32 (LBA) +/dev/sda2 255 1017 2932972 83 Linux + +1. install coinlinux live system on sda1. +2. mkfs.ext3 /dev/sda2 -L live-rw +3. install grub on /dev/sda -- cgit v1.2.3 From ce7db5e30ae49de3356249229a1025d055606e78 Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 18 Jun 2011 17:06:11 +0200 Subject: mining/: added all mining scripts and configs mining/Makefile: format - how to format the usb stick (or hard drive) install - installs all necessary components, writes ati_license, copies files in home dir configure - how to configure the miner mining/user/*: files to be dumped in the miners home directory --- mining/CONFIGURE | 5 +++++ mining/Makefile | 11 +++++++++++ mining/user/.config/autostart/startup.desktop | 6 ++++++ mining/user/mining.odvr | 16 ++++++++++++++++ mining/user/startup.sh | 16 ++++++++++++++++ 5 files changed, 54 insertions(+) create mode 100644 mining/CONFIGURE create mode 100644 mining/Makefile create mode 100644 mining/user/.config/autostart/startup.desktop create mode 100644 mining/user/mining.odvr create mode 100644 mining/user/startup.sh diff --git a/mining/CONFIGURE b/mining/CONFIGURE new file mode 100644 index 00000000..6ddce386 --- /dev/null +++ b/mining/CONFIGURE @@ -0,0 +1,5 @@ +How to Configure +=============== + +1. change the mining-url in ~/startup.sh +2. sudo /etc/init.d/gdm restart diff --git a/mining/Makefile b/mining/Makefile new file mode 100644 index 00000000..c673ee3e --- /dev/null +++ b/mining/Makefile @@ -0,0 +1,11 @@ +.PHONY: all format install +select-target: + @echo "You are made of stupid!" +format: + cat README +install: + echo '#!/bin/bash' > /usr/bin/ati_license + echo 'sudo tar xvf /opt/AMD-APP-SDK-v2.4-lnx64/icd-registration.tgz -C /' >> /usr/bin/ati_license + cp -r user /home +configure: + cat CONFIGURE diff --git a/mining/user/.config/autostart/startup.desktop b/mining/user/.config/autostart/startup.desktop new file mode 100644 index 00000000..67c35ef8 --- /dev/null +++ b/mining/user/.config/autostart/startup.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Name=LXDE Autostart +Exec=/home/user/startup.sh +Terminal=true +Type=Application +Categories=Configuration diff --git a/mining/user/mining.odvr b/mining/user/mining.odvr new file mode 100644 index 00000000..d6cf6fec --- /dev/null +++ b/mining/user/mining.odvr @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/mining/user/startup.sh b/mining/user/startup.sh new file mode 100644 index 00000000..c330b984 --- /dev/null +++ b/mining/user/startup.sh @@ -0,0 +1,16 @@ +sudo pkill xscreensaver +sudo pkill tmux +sleep 1 +export DISPLAY=:0 + +export URL="http://txgen_chinaman:lolwut@uk.btcguild.com:8332" +#export URL="http://txgen:qJrXefWX@bitcoinpool.com:8334" +slock & +tmux start-server +tmux new-session -d -s mining -n mining +printenv > /home/user/environment +tmux new-window -t mining:1 'AMDOverdriveCtrl -i 0 mining.ovdr' +tmux new-window -t mining:2 'AMDOverdriveCtrl -i 3 mining.ovdr' +sleep 5 +tmux new-window -t mining:3 "cd /opt/miners/phoenix; while sleep 1; do sudo python phoenix.py -u $URL -k phatk DEVICE=0 VECTORS BFI_INT WORKSIZE=256 AGGRESSION=12 FASTLOOPS=false;done" +tmux new-window -t mining:4 "cd /opt/miners/phoenix; while sleep 1;do sudo python phoenix.py -u $URL -k phatk DEVICE=1 VECTORS BFI_INT WORKSIZE=256 AGGRESSION=10 FASTLOOPS=false ; done" -- cgit v1.2.3 From 3ad199a3be4838b3311b77378a8124d3a5a493cb Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 19 Jun 2011 20:39:58 +0200 Subject: temper/*: updated Makefile --- temper/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/temper/Makefile b/temper/Makefile index 3ada08de..18165772 100644 --- a/temper/Makefile +++ b/temper/Makefile @@ -6,9 +6,12 @@ CFLAGS = -O2 -Wall temper: temper.c ${CC} -DUNIT_TEST -o $@ $^ -lusb chmod +s temper + install temper /usr/bin clean: rm -f temper *.o rules-install: # must be superuser to do this cp 99-tempsensor.rules /etc/udev/rules.d +debian-prereq: + apt-get install libusb-dev -- cgit v1.2.3 From 23f3c58d32754fa82b337ab95143988dce946f49 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 19 Jun 2011 23:11:33 +0200 Subject: node: use curl instead of cur --- node/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/Makefile b/node/Makefile index 00e27b6f..6428ff0f 100644 --- a/node/Makefile +++ b/node/Makefile @@ -5,4 +5,4 @@ all: node-v0.4.8 cd $< && ./configure && make && make install node-%: - cur http://nodejs.org/dist/$@.tar.gz | tar zx + curl http://nodejs.org/dist/$@.tar.gz | tar zx -- cgit v1.2.3 From 09db66a749e2cf420c496d25df396dbcb8e7894b Mon Sep 17 00:00:00 2001 From: user Date: Sun, 19 Jun 2011 23:42:50 +0000 Subject: node: install curl --- node/Makefile | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/node/Makefile b/node/Makefile index 6428ff0f..20e15c70 100644 --- a/node/Makefile +++ b/node/Makefile @@ -1,8 +1,24 @@ -.PHONY: all -all: node-v0.4.8 - cd $< && ./configure && make && make install +.PHONY: all build install -node-%: +all: + @echo "You are made of stupid!"; exit 23 + +build: node node/build/default/node + cd node && ./configure && make + +install: build + cd node && make install + +node: node-git + ln -vsnf $< $@ + +node-git: + git clone https://github.com/joyent/node node-git + +node-%: /usr/bin/curl curl http://nodejs.org/dist/$@.tar.gz | tar zx + +/usr/bin/curl: + apt-get install --yes curl -- cgit v1.2.3 From 08f2116d6edd8f0f620a9b2de1e9607cade0a284 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 19 Jun 2011 23:56:55 +0200 Subject: btcguild: initial commit --- btcguild/index.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 btcguild/index.js diff --git a/btcguild/index.js b/btcguild/index.js new file mode 100644 index 00000000..1f33db06 --- /dev/null +++ b/btcguild/index.js @@ -0,0 +1,20 @@ +api_key = process.env.api_key; + +var options = { + host: 'www.btcguild.com', + port: 80, + path: '/api.php?api_key=' + api_key +}; + +http = require('http'); +http.get(options, function(res) { + var data = ''; + res.on('data', function (chunk) { + data += chunk; + }); + res.on('end', function () { + console.log(JSON.parse(data)); + }); +}).on('error', function(e) { + console.error('Error: ' + e.message); +}); -- cgit v1.2.3 From 699a0472a4d18505fa989deffbca5a6b4f86a927 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 20 Jun 2011 00:37:12 +0200 Subject: cobra: initial README --- cobra/README | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 cobra/README diff --git a/cobra/README b/cobra/README new file mode 100644 index 00000000..145ecd14 --- /dev/null +++ b/cobra/README @@ -0,0 +1,33 @@ + +# usage +cobra [target...] + +# description +cobra tries to satisfies all specified targets and all of it dependencies. + +# targets +targets can be a lot of different things, e.g. directories + +## dirctory targets +try to do the right thing when the cobra search path contains a directory +that contains an index.{js,sh,py,etc.} file. + +## cobra search path +like your sh's PATH + +## example: cobra as some kind of make +$ echo $COBRA_PATH +. +$ ls . +foo/ bar/ baz/ +$ cat foo/cobra.json +{ "deps": "bar", "baz" } +$ cat bar/cobra.json +No such file or directory +$ cat baz/cobra.json +No such file or directory +$ cobra foo +[cobra bar] +[cobra baz] +[cobra foo] +$ exit -- cgit v1.2.3 From ac6754f5ff14254e871b8e100a8f990387df9f0b Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 20 Jun 2011 00:49:35 +0200 Subject: cobra: initial index.sh --- cobra/hello/index.sh | 1 + cobra/index.sh | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 cobra/hello/index.sh create mode 100755 cobra/index.sh diff --git a/cobra/hello/index.sh b/cobra/hello/index.sh new file mode 100644 index 00000000..df2dea7c --- /dev/null +++ b/cobra/hello/index.sh @@ -0,0 +1 @@ +echo 'Hello, world!' diff --git a/cobra/index.sh b/cobra/index.sh new file mode 100755 index 00000000..e3c5a1ea --- /dev/null +++ b/cobra/index.sh @@ -0,0 +1,20 @@ +#! /bin/sh +set -euf +trap "echo 'You are made of stupid!' >&2; exit 23" EXIT +disarm() { + trap - EXIT +} + +COBRA_PATH="${COBRA_PATH-$PWD}" + +## main +for target; do + for path in $COBRA_PATH; do + if test -d "$path/$target"; then + if index="$path/$target/index.sh" && test -f "$index"; then + exec /bin/sh "$index" + disarm + fi + fi + done +done -- cgit v1.2.3 From 1dc3083211674137b8667b489f39ad8d2f9db5e3 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 20 Jun 2011 00:52:46 +0200 Subject: cobra needs no disarm --- cobra/index.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cobra/index.sh b/cobra/index.sh index e3c5a1ea..1118a823 100755 --- a/cobra/index.sh +++ b/cobra/index.sh @@ -1,9 +1,6 @@ #! /bin/sh set -euf trap "echo 'You are made of stupid!' >&2; exit 23" EXIT -disarm() { - trap - EXIT -} COBRA_PATH="${COBRA_PATH-$PWD}" @@ -13,7 +10,6 @@ for target; do if test -d "$path/$target"; then if index="$path/$target/index.sh" && test -f "$index"; then exec /bin/sh "$index" - disarm fi fi done -- cgit v1.2.3 From 3e568365deb80e33d79f66f7ccd4a916472086e3 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 20 Jun 2011 22:56:09 +0200 Subject: retiolum/bin/install: initial commit --- retiolum/bin/install | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 retiolum/bin/install diff --git a/retiolum/bin/install b/retiolum/bin/install new file mode 100755 index 00000000..9e4459fb --- /dev/null +++ b/retiolum/bin/install @@ -0,0 +1,18 @@ +#! /bin/sh +# +# +# +set -euf + +trap 'echo "${comment+$comment +}You are made of stupid!">&2; exit 23' EXIT + +if ! test -e /usr/sbin/tincd; then + if grep -iq ubuntu /etc/issue; then + sudo apt-get install --yes tinc + else + comment='Install tinc to continue.' exit + fi +fi + +trap - EXIT -- cgit v1.2.3 From c82a486a65d881579a71ac36c14cdf2cb83529e0 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 21 Jun 2011 21:19:01 +0200 Subject: mining/user/mining.o{dv -> vd}r --- mining/user/mining.odvr | 16 ---------------- mining/user/mining.ovdr | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-) delete mode 100644 mining/user/mining.odvr create mode 100644 mining/user/mining.ovdr diff --git a/mining/user/mining.odvr b/mining/user/mining.odvr deleted file mode 100644 index d6cf6fec..00000000 --- a/mining/user/mining.odvr +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/mining/user/mining.ovdr b/mining/user/mining.ovdr new file mode 100644 index 00000000..d6cf6fec --- /dev/null +++ b/mining/user/mining.ovdr @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + -- cgit v1.2.3 From 471d596f7fb9a8e344af4d8967bfd3a3ab4ba688 Mon Sep 17 00:00:00 2001 From: Felix Richter Date: Wed, 22 Jun 2011 00:05:54 +0200 Subject: added ati_temper --- mining/user/bin/ati_temper | 5 +++++ 1 file changed, 5 insertions(+) create mode 100755 mining/user/bin/ati_temper diff --git a/mining/user/bin/ati_temper b/mining/user/bin/ati_temper new file mode 100755 index 00000000..283a6024 --- /dev/null +++ b/mining/user/bin/ati_temper @@ -0,0 +1,5 @@ +#displays: CARD1TEMP CARD2TEMP CPUTEMP OUTSIDE +echo -n "`DISPLAY=:0 aticonfig --adapter=1 --od-gettemperature | grep Temperature | sed -n 's/.*Temperature - \([0-9.]*\) C/\1/;p'` " +echo -n "`DISPLAY=:0 aticonfig --adapter=2 --od-gettemperature | grep Temperature | sed -n 's/.*Temperature - \([0-9.]*\) C/\1/;p'` " +echo -n "`sensors | grep temp1 | sed -e 's/temp1: *+\([0-9.]*\).*/\1/'` " +echo "`temper`" -- cgit v1.2.3 From e54a21f2247130db78b38d01567080011c1775a2 Mon Sep 17 00:00:00 2001 From: Felix Richter Date: Wed, 22 Jun 2011 00:15:03 +0200 Subject: Makefile: does more of the right things now Makefile will patch quirks from the live system: 1. /etc/init.d/live-boot 2. ati_license Makefile will install and configure lm-sensors --- mining/Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mining/Makefile b/mining/Makefile index c673ee3e..0fab7b1f 100644 --- a/mining/Makefile +++ b/mining/Makefile @@ -1,11 +1,18 @@ .PHONY: all format install select-target: @echo "You are made of stupid!" + echo "look here" + @cat Makefile format: cat README install: + apt-get install --yes lm-sensors echo '#!/bin/bash' > /usr/bin/ati_license + echo '#!/bin/sh' > /etc/init.d/live-boot + echo 'wall "going down"' >> /etc/init.d/live-boot + chmod 755 /etc/init.d/live-boot echo 'sudo tar xvf /opt/AMD-APP-SDK-v2.4-lnx64/icd-registration.tgz -C /' >> /usr/bin/ati_license cp -r user /home configure: - cat CONFIGURE + sensors-detect + @cat CONFIGURE -- cgit v1.2.3 From 9ab87e479e1f75665bc69623eeb740758acb3f0a Mon Sep 17 00:00:00 2001 From: user Date: Wed, 22 Jun 2011 00:19:00 +0000 Subject: mining/user/startup.sh: use URL from env --- mining/user/startup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mining/user/startup.sh b/mining/user/startup.sh index c330b984..eb2ce13a 100644 --- a/mining/user/startup.sh +++ b/mining/user/startup.sh @@ -3,7 +3,7 @@ sudo pkill tmux sleep 1 export DISPLAY=:0 -export URL="http://txgen_chinaman:lolwut@uk.btcguild.com:8332" +export URL="${URL-http://txgen_chinaman:lolwut@uk.btcguild.com:8332}" #export URL="http://txgen:qJrXefWX@bitcoinpool.com:8334" slock & tmux start-server -- cgit v1.2.3