Skip to content

Instantly share code, notes, and snippets.

Petr Ruzicka ruzickap

Block or report user

Report or block ruzickap

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View openwrt_watchcat.sh
opkg install luci-app-watchcat
/etc/uci-defaults/50-watchcat
uci set system.@watchcat[0].period=1h
/etc/init.d/watchcat enable
@ruzickap
ruzickap / openwrt_rainbow.sh
Created Apr 11, 2014
OpenWrt Rainbow - set led colors
View openwrt_rainbow.sh
uci set rainbow.wifi=led
uci set rainbow.@led[-1].color=blue
uci set rainbow.@led[-1].status=auto
uci set rainbow.pwr=led
uci set rainbow.@led[-1].color=red
uci set rainbow.@led[-1].status=auto
uci set rainbow.lan=led
uci set rainbow.@led[-1].color=green
@ruzickap
ruzickap / openwrt_turris_thetmometer.sh
Last active Aug 29, 2015
OpenWrt - Graph internal Turris thermometers (CPU, Board)
View openwrt_turris_thetmometer.sh
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
@ruzickap
ruzickap / create_graphs.sh
Created Sep 3, 2014
OpenStack's create_graphs script installation
View create_graphs.sh
#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/
@ruzickap
ruzickap / cacti_installation.sh
Created Sep 3, 2014
Cacti non-interactive installation
View cacti_installation.sh
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
@ruzickap
ruzickap / vCenter_install_configure.sh
Last active Aug 29, 2015
VMware vCenter Server 5.x Appliance installtion and configuration
View vCenter_install_configure.sh
# 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 ..."
@ruzickap
ruzickap / cz01-psql02_installation.sh
Created Oct 25, 2014
cz01-psql02 PostgreSQL database installation
View cz01-psql02_installation.sh
#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/
@ruzickap
ruzickap / cz01-pgpool0{1,2}_installation.sh
Created Oct 25, 2014
cz01-pgpool0{1,2} pgpool servers installation
View cz01-pgpool0{1,2}_installation.sh
#pgpool 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 pgpool-II-93 postgresql93
scp -r cz01-psql01.example.com:/root/{.ssh,.pgpass} /root/
scp cz01-psql01.example.com:/root/.pgpass /root/
cp /etc/pgpool-II-93/pcp.conf.sample /etc/pgpool-II-93/pcp.conf
echo "admin:`pg_md5 password123`" >> /etc/pgpool-II-93/pcp.conf
@ruzickap
ruzickap / cz01-pgpool01_installation.sh
Created Oct 25, 2014
cz01-pgpool01 primary pgpool server installation
View cz01-pgpool01_installation.sh
sed \
-e "s/^wd_hostname =.*/wd_hostname = 'cz01-pgpool01.example.com'/" \
-e "s/^heartbeat_destination0 =.*/heartbeat_destination0 = 'cz01-pgpool02.example.com'/" \
-e "s/^#other_pgpool_hostname0 =.*/other_pgpool_hostname0 = 'cz01-pgpool02.example.com'/" \
-i /etc/pgpool-II-93/pgpool.conf
service pgpool-II-93 start
@ruzickap
ruzickap / cz01-pgpool02_installation.sh
Created Oct 25, 2014
cz01-pgpool02 secondary pgpool server installation
View cz01-pgpool02_installation.sh
sed \
-e "s/^wd_hostname =.*/wd_hostname = 'cz01-pgpool02.example.com'/" \
-e "s/^heartbeat_destination0 =.*/heartbeat_destination0 = 'cz01-pgpool01.example.com'/" \
-e "s/^#other_pgpool_hostname0 =.*/other_pgpool_hostname0 = 'cz01-pgpool01.example.com'/" \
-i /etc/pgpool-II-93/pgpool.conf
service pgpool-II-93 start
You can’t perform that action at this time.