This file contains hidden or 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
#!/usr/bin/env python | |
# | |
#Find the pattern and complete the function: | |
#int[][] spiral(int n); | |
#where n is the size of the 2D array. | |
#Sample Result | |
#input = 3 | |
#123 | |
#894 | |
#765 |
This file contains hidden or 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 | |
now=$(date) | |
NAGIOS_CONFIG_FOLDER="/usr/local/nagios/etc" | |
files=`find $NAGIOS_CONFIG_FOLDER -type f -mmin -1` | |
if [[ $files == "" ]] ; then | |
echo "no change noticed in nagios config $now" | |
else | |
echo "Reloading nagios to load changed contents $NAGIOS_CONFIG_FOLDER at $now" | |
config_test=$(/usr/local/nagios/bin/nagios -f $NAGIOS_CONFIG_FOLDER/nagios.cfg) | |
if [ $? -eq 0 ] |
This file contains hidden or 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
#!/usr/bin/env bash | |
sudo groupadd -g 3000 nagios | |
sudo useradd -u 3000 -g nagios -d /usr/local/nagios -c 'Nagios Admin' nagios | |
sudo apt-get install apache2 | |
sudo adduser www-data nagios | |
VERSION=4.3.4 | |
wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-$VERSION.tar.gz | |
tar xzf nagios-$VERSION.tar.gz | |
sudo apt-get install checkinstall unzip -qq --yes --force-yes | |
cd nagios-$VERSION && { |
This file contains hidden or 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
git clone https://github.com/openstack/openstack-helm.git | |
cd openstack-helm/tools/vagrant | |
vagrant up | |
vagrant ssh | |
#list running pods | |
sudo kubectl get pods --all-namespaces | |
#list endpoints setup | |
sudo kubectl get endpoints --all-namespaces | |
helm repo add stable http://storage.googleapis.com/kubernetes-charts |
This file contains hidden or 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
import java.awt.BorderLayout; | |
import java.awt.Dimension; | |
import java.awt.event.KeyEvent; | |
import java.awt.event.KeyListener; | |
import javax.swing.JFrame; | |
import javax.swing.JScrollPane; | |
import javax.swing.JTextArea; | |
import javax.swing.JTextField; |
This file contains hidden or 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
import termios, fcntl, sys, os | |
fd = sys.stdin.fileno() | |
oldterm = termios.tcgetattr(fd) | |
newattr = termios.tcgetattr(fd) | |
newattr[3] = newattr[3] & ~termios.ICANON & ~termios.ECHO | |
termios.tcsetattr(fd, termios.TCSANOW, newattr) | |
oldflags = fcntl.fcntl(fd, fcntl.F_GETFL) | |
fcntl.fcntl(fd, fcntl.F_SETFL, oldflags | os.O_NONBLOCK) |
This file contains hidden or 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
VERSION="0.10-0.10.1-1" | |
#wget https://3a98d2877cb62a6e6b14-93babe93196056fe375611ed4c1716dd.ssl.cf5.rackcdn.com/l/c/lma_collector-0.9-0.9.0-1.noarch.rpm | |
wget https://3a98d2877cb62a6e6b14-93babe93196056fe375611ed4c1716dd.ssl.cf5.rackcdn.com/sl0.10-0.10.1-1/lma_collector-0.10-0.10.1-1.noarch.rpm | |
#wget https://3a98d2877cb62a6e6b14-93babe93196056fe375611ed4c1716dd.ssl.cf5.rackcdn.com/e/k/elasticsearch_kibana-0.9-0.9.0-1.noarch.rpm | |
wget https://3a98d2877cb62a6e6b14-93babe93196056fe375611ed4c1716dd.ssl.cf5.rackcdn.com/sl0.10-0.10.1-1/elasticsearch_kibana-0.10-0.10.1-1.noarch.rpm | |
#wget https://3a98d2877cb62a6e6b14-93babe93196056fe375611ed4c1716dd.ssl.cf5.rackcdn.com/i/g/influxdb_grafana-0.9-0.9.0-1.noarch.rpm | |
wget https://3a98d2877cb62a6e6b14-93babe93196056fe375611ed4c1716dd.ssl.cf5.rackcdn.com/sl0.10-0.10.1-1/influxdb_grafana-0.10-0.10.1-1.noarch.rpm | |
#wget https://3a98d2877cb62a6e6b14-93babe93196056fe375611ed4c1716dd.ssl.cf5.rackcdn.com/l/n/lma_infrastructure_alerting-0.9-0.9.0-1.noarch.rpm | |
wget https://3a98d2877cb |
This file contains hidden or 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
SOURCE_BRANCH=stable/0.8 | |
yum -y install createrepo rpm rpm-build dpkg-devel git | |
easy_install pip | |
pip install fuel-plugin-builder | |
git clone https://github.com/openstack/fuel-plugin-lma-collector.git | |
git clone https://github.com/openstack/fuel-plugin-lma-infrastructure-alerting.git | |
git clone https://github.com/openstack/fuel-plugin-influxdb-grafana.git | |
git clone https://github.com/openstack/fuel-plugin-elasticsearch-kibana.git | |
cd /root/fuel-plugin-lma-collector | |
git checkout $SOURCE_BRANCH |
This file contains hidden or 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
wget http://plugins.mirantis.com/repository/l/m/lma_collector/lma_collector-0.8-0.8.0-1.noarch.rpm | |
wget http://plugins.mirantis.com/repository/e/l/elasticsearch_kibana/elasticsearch_kibana-0.8-0.8.0-1.noarch.rpm | |
wget http://plugins.mirantis.com/repository/i/n/influxdb_grafana/influxdb_grafana-0.8-0.8.0-1.noarch.rpm | |
wget http://plugins.mirantis.com/repository/l/m/lma_infrastructure_alerting/lma_infrastructure_alerting-0.8-0.8.0-1.noarch.rpm | |
fuel plugins --install lma_collector-0.8-0.8.0-1.noarch.rpm | |
fuel plugins --install elasticsearch_kibana-0.8-0.8.0-1.noarch.rpm | |
fuel plugins --install influxdb_grafana-0.8-0.8.0-1.noarch.rpm | |
fuel plugins --install lma_infrastructure_alerting-0.8-0.8.0-1.noarch.rpm | |
fuel plugins |
This file contains hidden or 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 | |
nrpe="/usr/local/nagios/libexec/check_nrpe" | |
hostname="127.0.0.1" | |
check_one="$1" | |
check_two="$2" | |
$nrpe -H $hostname -c $check_one | |
return_one=$? |
NewerOlder