Skip to content

Instantly share code, notes, and snippets.

@gisjedi
gisjedi / upgrade-openshift.sh
Last active January 21, 2022 20:17
Generate upgrade manifest for OpenShift Container Platform
## Usage
# ./upgrade-openshift.sh 4.8.11
OCP_RELEASE_NUMBER=$1
ARCHITECTURE=x86_64
DIGEST="$(oc adm release info quay.io/openshift-release-dev/ocp-release:${OCP_RELEASE_NUMBER}-${ARCHITECTURE} | sed -n 's/Pull From: .*@//p')"
DIGEST_ALGO="${DIGEST%%:*}"
DIGEST_ENCODED="${DIGEST#*:}"
SIGNATURE_BASE64=$(curl -s "https://mirror.openshift.com/pub/openshift-v4/signatures/openshift/release/${DIGEST_ALGO}=${DIGEST_ENCODED}/signature-1" | base64 -w0 && echo)
echo test this update
echo new line
echo test 9:45
7/9/2020
7/10/2020
@gisjedi
gisjedi / private-agent-1.10.sh
Last active September 19, 2018 17:09
adding metrics for nodes
curl -o /opt/mesosphere/bin/dcos-metrics-prometheus -L https://downloads.mesosphere.io/dcos-metrics/plugins/prometheus
chmod +x /opt/mesosphere/bin/dcos-metrics-prometheus
curl -o /etc/systemd/system/dcos-metrics-prometheus.service -L https://downloads.mesosphere.io/dcos-metrics/plugins/prometheus.service
sed -i 's^master^agent^' /etc/systemd/system/dcos-metrics-prometheus.service
systemctl daemon-reload
systemctl start dcos-metrics-prometheus.service
systemctl enable dcos-metrics-prometheus.service
{
"info": {
"_postman_id": "4106cd1e-dc7f-4a7b-bf43-1620541e0d58",
"name": "Seed Scan Trigger Multie Job Recipe",
"description": "API collection for testing Scale APIs with sample Seed jobs",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Seed Input Workspace",
@gisjedi
gisjedi / haproxy.service
Created February 27, 2018 16:54
Haproxy Unit file for SystemD
[Unit]
Description=haProxy 1.6 Containerized Service
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
Restart=always
ExecStartPre=-/usr/bin/docker stop %n
ExecStartPre=-/usr/bin/docker rm %n
ADDRESS=http://10.3.2.183:9200/
TWOYEARMARK=$(($(date -v-24S +'%s * 1000 + %-N / 1000000')))
BUCKETNAME="ais-elasticsearch-snapshots"
AWSENDPOINT="s3.us-east-2.amazonaws.com"
AWSBASEPATH="snapshots/archives"
DELETEINDCIES=false
curl -s http://$ADDRESS/_cat/indices?h=i,cd > test.txt
while read OUTPUT
global
daemon
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
maxconn 20000
pidfile /var/run/haproxy.pid
defaults
log global
option dontlog-normal
mode http
@gisjedi
gisjedi / go-env.sh
Created April 13, 2017 13:42
go environment
# Install gotags
go get -u github.com/jstemmer/gotags
# Install pathogen
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
# Install vim-go
git clone https://github.com/fatih/vim-go.git ~/.vim/bundle/vim-go
  1. Proper heading in all files
  2. Properly organized imports in all files, organized first in three separate sections separated by a new line (section ordering below), import FOO statements precede from FOO import BAR statements and finally ordered alphabetically
    1. Standard Python imports (math, logging, etc)
    2. Python library imports (Django, etc)
    3. Scale code imports
  3. Add or update necessary unit tests for code updates
  4. All unit tests run successfully and there are no deprecation warnings (ignore warnings for dependencies)
  5. No Pep8 warnings in code