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
apiVersion: v1 | |
kind: DeploymentConfig | |
metadata: | |
name: prometheus | |
namespace: myproject | |
selfLink: /oapi/v1/namespaces/myproject/deploymentconfigs/prometheus | |
uid: f3524153-1ab0-11e7-926b-ce8a898d4953 | |
resourceVersion: '1219' | |
generation: 5 | |
creationTimestamp: '2017-04-06T10:08:15Z' |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from InstagramAPI import InstagramAPI | |
from time import sleep | |
import random | |
import pdb | |
import requests | |
# Get target account's Instagram ID |
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
# initialization file (not found) |
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 | |
apt-get remove --purge grafana | |
directories=(/opt/prometheus /etc/prometheus /var/log/prometheus /var/lib/prometheus /var/lib/pushgateway /var/lib/alertmanager /var/lib/node_exporter) | |
for i in "${directories[@]}" | |
do | |
: | |
rm -rf $i |
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
from jinja2 import Template | |
file = open('prometheus.yml', 'a') | |
templ = Template(u'''\ | |
- job_name: {{ name }} | |
metrics_path: /export | |
params: | |
command: [check_load] | |
static_configs: |
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
# This file is used by Rack-based servers to start the application. | |
require ::File.expand_path('../config/environment', __FILE__) | |
require 'rack' | |
require 'prometheus/middleware/collector' | |
require 'prometheus/middleware/exporter' | |
use Rack::Deflater | |
use Prometheus::Middleware::Collector | |
use Prometheus::Middleware::Exporter |
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
package main | |
import ( | |
"log" | |
"net/http" | |
"github.com/prometheus/client_golang/prometheus" | |
"github.com/prometheus/client_golang/prometheus/promhttp" | |
) |
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
# NOTES | |
# Worst case O(N^2) | |
# | |
# Selection Sort | |
# Best, Avg, Worst O(N^2) TC | |
# Worst SC O(1) | |
def selection_sort(arr) | |
for i in 0...(arr.length-1) |
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
def search(nums, target) | |
if nums.length == 0 | |
return -1 | |
end | |
low, high = 0, nums.length-1 | |
while low <= high | |
mid = (high+low)/2 | |
if nums[mid] == target | |
return mid |
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
# Quick Sort - Runtime: Average O(n log(n)), Worst O(n^2), Memory O(log(n)) | |
def quick_sort(arr, left, right) | |
index = partition(arr, left, right) | |
if left > index - 1 | |
quick_sort(arr, left, index - 1) | |
end | |
if index < right | |
quick_sort(arr, index, right) | |
end |
OlderNewer