This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --- Update things to make sure we have the latest patches --- | |
# Add EPEL so we can get reasonably recent packages | |
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm | |
# --- Install all the packages --- # | |
yum -y install python-whisper python-carbon graphite-web graphite-web-selinux python-memcached python-ldap httpd memcached | |
yum -y groupinstall "Development Tools" | |
# ===== Firewall and Security ===== | |
sed -i '/REJECT/ i\-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport http -j ACCEPT' /etc/sysconfig/iptables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configure Graphite Carbon | |
# | |
# Add UDP:2003 port to Firewall (before reject line) | |
sed -i '/REJECT/ i\-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 2003 -j ACCEPT' /etc/sysconfig/iptables | |
# Turn on UDP in Carbon Aggregator | |
sed -i 's/ENABLE_UDP_LISTENER = False/ENABLE_UDP_LISTENER = True/g' /etc/carbon/carbon.conf | |
# ===== Restart services ===== | |
service carbon-cache restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Create multiple html files from csv file using a template | |
# CSV file has the structure: | |
# filename href | |
# | |
INPUT=data.csv | |
OLDIFS=$IFS | |
IFS=, | |
[ ! -f $INPUT ] && { echo "$INPUT file not found"; exit 99; } | |
while read flname href |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: Stop services, archive logs and start them again | |
:: Create date variables | |
for /f "tokens=2-4 delims=. " %%a in ('date /T') do set year=%%c | |
for /f "tokens=2-4 delims=. " %%a in ('date /T') do set month=%%b | |
for /f "tokens=2-4 delims=. " %%a in ('date /T') do set day=%%a | |
:: Set Log File location |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "USE dbname; SELECT COUNT(*) FROM votes;" | mysql --skip-column-names --user=dbuser --password=dbpassword dbname | awk '{ print strftime("%Y-%m-%d %H:%M:%S"), "application:", "Number of votes:", $0;fflush(); }' | mail -s "Number of votes" [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum update -y | |
yum install -y epel-release | |
yum clean all | |
# Add repos | |
rpm -Uvh "https://labs.consol.de/repo/stable/rhel7/i386/labs-consol-stable.rhel7.noarch.rpm" | |
rpm -ihv http://opensource.is/repo/ok-release.rpm | |
yum update -y ok-release | |
######################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum update -y | |
yum install -y epel-release | |
yum clean all | |
# Add repos | |
rpm -Uvh "https://labs.consol.de/repo/stable/rhel6/i386/labs-consol-stable.rhel6.noarch.rpm" | |
rpm -ihv http://opensource.is/repo/ok-release.rpm | |
yum update -y ok-release | |
######################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rpm -ihv http://opensource.is/repo/ok-release.rpm | |
yum install ok-release | |
yum install epel-release | |
yum install nagios-okconfig-nrpe | |
sed -i 's|allowed_hosts=127.0.0.1|allowed_hosts=127.0.0.1,nagios_server_ip_address|g' /etc/nagios/nrpe.cfg | |
sed -i 's|dont_blame_nrpe=0|dont_blame_nrpe=1|g' /etc/nagios/nrpe.cfg | |
sed -i 's|command\[check_load\]|#command\[check_load\]|g' /etc/nagios/nrpe.cfg | |
sudo /etc/init.d/nrpe restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum update -y | |
yum install -y epel-release | |
yum update -y | |
yum clean all | |
# Add repos | |
rpm -Uvh "https://labs.consol.de/repo/stable/rhel7/i386/labs-consol-stable.rhel7.noarch.rpm" | |
rpm -ihv http://opensource.is/repo/ok-release.rpm | |
yum update -y ok-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Convert icelandic weather html data (all stations) from html table to csv format | |
$ curl "http://brunnur.vedur.is/athuganir/athtafla/2015081210.html" 2>/dev/null | grep -i -e '</\?TABLE\|</\?TD\|</\?TR'| tr -d '\n' | sed 's/<\ /TR[^>]*>/\n/Ig' | sed 's/<\/\?\(TABLE\|TR\)[^>]*>//Ig' | sed 's/^<T[DH][^>]*>\|<\/\?T[DH][^>]*>$//Ig' | sed 's/<\/T[DH][^>]*><T[DH][^>]*>/,/Ig' | sed 's/<[^>] \+>//Ig' | sed 's/^[\ \t]*//g' | sed 's/^[\ \t]*//g' | sed '/^\s*$/d' | sed 's/^/2015081210,/' | |
Output: | |
2015081210,33751,Siglufjarðarvegur_Herkonugil,-99,6.9,6.9,7.9,80,6.7,7.1,10.2,92,-99 | |
2015081210,33643,Stafá,40,9.3,8.9,9.5,38,4.9,4.9,7.1,79,-99 | |
2015081210,32474,Steingrímsfjarðarheiði,440,4.4,3.9,4.5,65,11.5,11.6,14.2,99,-99 | |
2015081210,31950,Stórholt,70,9.9,9.3,9.9,81,6.7,6.7,8.5,82,-99 |
OlderNewer