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
$ curl http://127.0.0.1:8080/apis/batch/v1 | |
{ | |
"kind": "APIResourceList", | |
"apiVersion": "v1", | |
"groupVersion": "batch/v1", | |
"resources": [ | |
{ | |
"name": "jobs", | |
"namespaced": true, | |
"kind": "Job" |
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
// A quick script for converting Medium HTML files to Markdown, suitable for use in a static file generator such as Hugo or Jekyll | |
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"log" | |
"os" | |
"path/filepath" | |
"regexp" |
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
// CheckEndOfMonth check end of month | |
func CheckEndOfMonth() bool { | |
return time.Now().Add(+24*time.Hour).Day() == 1 | |
} |
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 boto3 | |
import time | |
from botocore.client import ClientError | |
from datetime import datetime, timedelta, tzinfo | |
ec2 = boto3.client('ec2') | |
instances = ["i-xxxx1","i-xxxx4"] | |
image_prefix = "automatic_creation_" |
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
apt update -qq | |
g++ | |
export PROTOBUF_VERSION=3.5.1 | |
apt install unzip -y | |
mkdir ~/temp && cd ~/temp && wget "https://github.com/google/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-linux-x86_64.zip" && unzip protoc-$PROTOBUF_VERSION-linux-x86_64.zip && mv include/* /usr/local/include/ && mv bin/* /usr/local/bin/ && cd ~/ && rm -rf ~/temp | |
apt install wget -qq | |
cd .. | |
rm -rvf temp | |
mkdir ~/temp && cd ~/temp && wget "https://github.com/google/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-linux-x86_64.zip" && unzip protoc-$PROTOBUF_VERSION-linux-x86_64.zip && mv include/* /usr/local/include/ && mv bin/* /usr/local/bin/ && cd ~/ && rm -rf ~/temp | |
go |
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
module.exports = { | |
username: '<username>', | |
password: '<password>' | |
}; |
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
const fs = require('fs'); | |
const puppeteer = require('puppeteer'); | |
const speedline = require('speedline'); | |
const USERNAME_SELECTOR = 'body > grafana-app > div.main-view > div > div:nth-child(1) > div > div > div.login-inner-box > form > div:nth-child(1) > input'; | |
const PASSWORD_SELECTOR = '#inputPassword'; | |
const CLICK_BUTTON = 'body > grafana-app > div.main-view > div > div:nth-child(1) > div > div > div.login-inner-box > form > div.login-button-group > button'; | |
const CREDS = require('./creds'); |
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
# AlpineLinux 3.5 | |
new_http_archive( | |
name = "docker_alpinelinux", | |
url = "https://nl.alpinelinux.org/alpine/v3.5/releases/x86_64/alpine-minirootfs-3.5.1-x86_64.tar.gz", | |
build_file = "alpinelinux.BUILD", | |
sha256 = "fa17f25ded0b29d94d8cc2d9aabb6f737f4b987c42fe8a6d11e05cfe2c52a64c", | |
) |
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/sh | |
set -xe | |
RUBY_VERSION=$(grep "%define \+rubyver" $HOME/$CIRCLE_PROJECT_REPONAME/ruby.spec | awk '{print $3}') | |
need_to_release() { | |
http_code=$(curl -sL -w "%{http_code}\\n" https://github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/releases/tag/${RUBY_VERSION} -o /dev/null) | |
test $http_code = "404" | |
} |
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 | |
# Install Wavefront Proxy and configures standard telegraf plugin | |
# #### | |
function logo() { | |
cat << "EOT" | |
__ __ _____ __ | |
/ \ / \_____ ___ __ _____/ ____\______ ____ _____/ |_ | |
\ \/\/ /\__ \\ \/ // __ \ __\\_ __ \/ _ \ / \ __\ | |
\ / / __ \\ /\ ___/| | | | \( <_> ) | \ | |