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
mkdir -p /data/temperature_sensors /www3/temperature_sensors | |
#The graphs can be accessed: http://192.168.1.1/myadmin/temperature_sensors | |
ln -s /www3/temperature_sensors /www3/myadmin/temperature_sensors | |
#Create RRDtool database to store the values every 10 minutes (600 seconds) for 10 years (525600 * 600 seconds) | |
rrdtool create /data/temperature_sensors/temperature_sensors.rrd --step 600 \ | |
DS:temp0:GAUGE:1000:-273:5000 DS:temp1:GAUGE:1000:-273:5000 RRA:AVERAGE:0.5:1:525600 \ | |
RRA:MIN:0.5:1:525600 RRA:MAX:0.5:1:525600 | |
#Add cron entry to put the temperatures into the database |
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
mkdir -p /data/mydigitemp /www3/mydigitemp | |
#The graphs can be accessed: http://192.168.1.1/myadmin/mydigitemp | |
ln -s /www3/mydigitemp /www3/myadmin/mydigitemp | |
#Create RRDtool database to store the values every 10 minutes (600 seconds) for 10 years (525600 * 600 seconds) | |
rrdtool create /data/mydigitemp/mydigitemp.rrd --step 600 \ | |
DS:temp0:GAUGE:1000:-273:5000 DS:temp1:GAUGE:1000:-273:5000 RRA:AVERAGE:0.5:1:525600 \ | |
RRA:MIN:0.5:1:525600 RRA:MAX:0.5:1:525600 | |
#Script getting the data from termometers |
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
uci set network.wifi_open=interface | |
uci set network.wifi_open.type=bridge | |
uci set network.wifi_open.proto=static | |
uci set network.wifi_open.ipaddr=10.0.0.1 | |
uci set network.wifi_open.netmask=255.255.255.0 | |
uci add wireless wifi-iface | |
uci set wireless.@wifi-iface[-1].device=radio0 | |
uci set wireless.@wifi-iface[-1].mode=ap | |
uci set wireless.@wifi-iface[-1].ssid=medlanky.xvx.cz |
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
#Download the nodosplash compiled for Turris router (mpc85xx) [if it's not already in the "main repository"] | |
curl -L --insecure "https://github.com/ruzickap/linux.xvx.cz/raw/gh-pages/files/turris_configured/root/nodogsplash_0.9_beta9.9.8-2_mpc85xx.ipk" -O /tmp/nodogsplash_0.9_beta9.9.8-2_mpc85xx.ipk | |
#Install the package (try first: opkg install nodogsplash) | |
opkg install /tmp/nodogsplash_0.9_beta9.9.8-2_mpc85xx.ipk | |
#Backup the original config file | |
mv /etc/nodogsplash/nodogsplash.conf /etc/nodogsplash/nodogsplash.conf-orig | |
#Create main config file |
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 install -y cacti mysql-server | |
# MySQL configuration | |
service mysqld start | |
chkconfig mysqld on | |
mysqladmin -u root password admin123 | |
mysql --password=admin123 --user=root << EOF | |
#Taken from /usr/bin/mysql_secure_installation |
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
#modify the script to work with othe VMs (not just KVM based) + small bugfix | |
wget https://git.openstack.org/cgit/openstack-infra/config/plain/modules/openstack_project/files/cacti/create_graphs.sh -O - | sed 's/All Hosts/Default Tree/;s/add_device.php --description/add_device.php --ping_method=icmp --description/;s/grep "Known"/grep -E "Known|Device IO"/;s@xvd\[a\-z\]\$@-E "\(sd\|xvd\)\[a-z\]\$"@' > /root/create_graphs.sh | |
chmod a+x /root/create_graphs.sh | |
wget https://git.openstack.org/cgit/openstack-infra/config/plain/modules/openstack_project/files/cacti/linux_host.xml -P /var/lib/cacti/ | |
/usr/bin/php -q /usr/share/cacti/cli/import_template.php --filename=/var/lib/cacti/linux_host.xml --with-template-rras | |
wget https://git.openstack.org/cgit/openstack-infra/config/plain/modules/openstack_project/files/cacti/net-snmp_devio.xml -P /usr/local/share/cacti/resource/snmp_queries/ |
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
#Download OVF tools | |
wget -q ftp://ftp.example.com/software/vmware/installation_scripts/vmware-ovftool.tar.gz -O /vmfs/volumes/My_Datastore/vmware-ovftool.tar.gz | |
# Extract ovftool content to /vmfs/volumes/My_Datastore | |
tar -xzf /vmfs/volumes/My_Datastore/vmware-ovftool.tar.gz -C /vmfs/volumes/My_Datastore/ | |
rm /vmfs/volumes/My_Datastore/vmware-ovftool.tar.gz | |
# Modify the ovftool script to work on ESXi | |
sed -i 's@^#!/bin/bash@#!/bin/sh@' /vmfs/volumes/My_Datastore/vmware-ovftool/ovftool |
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
# Deploy OVF from remote HTTP source | |
/vmfs/volumes/My_Datastore/vmware-ovftool/ovftool --diskMode=thin --datastore=My_Datastore --noSSLVerify --acceptAllEulas --skipManifestCheck "--net:Network 1=VMware Management Network" --prop:vami.ip0.VMware_vCenter_Server_Appliance=10.29.49.99 --prop:vami.netmask0.VMware_vCenter_Server_Appliance=255.255.255.128 --prop:vami.gateway.VMware_vCenter_Server_Appliance=10.29.49.1 --prop:vami.DNS.VMware_vCenter_Server_Appliance=10.1.1.44 --prop:vami.hostname=vcenter.example.com "ftp://ftp.example.com/software/vmware/VMware-vCenter-Server-Appliance-5.5.0.10000-1624811_OVF10.ova" "vi://root:mypassword@127.0.0.1" | |
echo "Accepting EULA ..." | |
/usr/sbin/vpxd_servicecfg eula accept | |
echo "Configuring Embedded DB ..." | |
/usr/sbin/vpxd_servicecfg db write embedded | |
echo "Configuring SSO..." | |
/usr/sbin/vpxd_servicecfg sso write embedded | |
echo "Starting VCSA ..." |
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
#PostgreSQL installation | |
yum localinstall -y http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-redhat93-9.3-1.noarch.rpm | |
yum install -y postgresql93-server repmgr | |
yum install -y --enablerepo=centos-base postgresql93-contrib | |
service postgresql-9.3 initdb | |
chkconfig postgresql-9.3 on | |
sed -i.orig \ | |
-e "s/^#listen_addresses = 'localhost'/listen_addresses = '*'/" \ | |
-e "s/^#shared_preload_libraries = ''/shared_preload_libraries = 'repmgr_funcs'/" \ |
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
#PostgreSQL installation | |
yum localinstall -y http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-redhat93-9.3-1.noarch.rpm | |
yum install -y postgresql93-server repmgr | |
yum install -y --enablerepo=centos-base postgresql93-contrib | |
chkconfig postgresql-9.3 on | |
echo 'PATH=/usr/pgsql-9.3/bin:$PATH' >> /var/lib/pgsql/.bash_profile | |
scp -r cz01-psql01.example.com:/root/{.pgpass,.ssh} /root/ | |
cp -r /root/{.pgpass,.ssh} /var/lib/pgsql/ |