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 ( | |
"github.com/prometheus/client_golang/prometheus" | |
"github.com/prometheus/client_golang/prometheus/promauto" | |
"github.com/prometheus/common/model" | |
"github.com/prometheus/prometheus/prompb" | |
"github.com/golang/snappy" | |
"net/http" | |
"log" |
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 consequitive_max_sum(int_list): | |
# last_seq = [] | |
max_sum = sum(int_list) | |
for index, val in enumerate(int_list): | |
new_sum = sum(int_list[index:]) | |
if new_sum > max_sum: | |
max_sum = new_sum | |
# for index, val in enumerate(int_list): | |
# last_sum = sum(last_seq) |
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 jenkins/jenkins:2.150.3 | |
# Install plugins | |
RUN /usr/local/bin/install-plugins.sh \ | |
git:3.9.1 \ | |
git-client:2.7.3 \ | |
amazon-ecs:1.19 \ | |
job-dsl:1.69 \ | |
configuration-as-code:1.7 \ | |
configuration-as-code-support:1.7 \ |
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
root@8d3475ae6b05:/opt/Downloads/PyOxidizer# ls -lah target/debug/pyapp | |
-rwxr-xr-x 2 root root 86M Feb 20 07:40 target/debug/pyapp | |
root@8d3475ae6b05:/opt/Downloads/PyOxidizer# ldd target/debug/pyapp | |
linux-vdso.so.1 (0x00007ffca7ddd000) | |
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f56f1ea7000) | |
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f56f1ca3000) | |
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f56f1a9b000) | |
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f56f187e000) | |
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f56f1667000) | |
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f56f12c8000) |
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 -e | |
if [ $# -ne 2 ]; then | |
echo "Usage: $0 <instance-id> <volume-size-gb> [PARITION_NAME=/dev/xvda2]" | |
exit 2 | |
fi | |
INSTANCE="$1" | |
VOLUME_SIZE="$2" | |
PARTITION="${3:-/dev/xvda2}" |
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 -*- | |
import boto3 | |
from multiprocessing.dummy import Pool as ThreadPool | |
import sys | |
import time | |
group_name = sys.argv[1] | |
ag = boto3.client('autoscaling') |
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 | |
#set -eo pipefail | |
# | |
# Sample for getting temp session token from AWS STS | |
# | |
# aws --profile youriamuser sts get-session-token --duration 3600 \ | |
# --serial-number arn:aws:iam::012345678901:mfa/user --token-code 012345 | |
# | |
# 1 or 2 args ok |
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 -*- | |
import re | |
import json | |
import argparse | |
from datetime import datetime | |
from subprocess import Popen, PIPE | |
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 | |
### Script to start selenium grid | |
function usage() { | |
echo -e "Usage: $0 [OPTION]... | |
Options: | |
<-a|--action start|stop>\tstart or stop cluster | |
[-c|--count 2]\tnumber of nodes to start | |
[-n|--node chrome|firefox]\tselenium node type | |
[-v|--version 3.0.1-fermium]\tselenium version |
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 -*- | |
import string | |
def join_punctuation(seq): | |
characters = set(string.punctuation) | |
seq = iter(seq) | |
current = next(seq) |
NewerOlder