Skip to content

Instantly share code, notes, and snippets.

View scottcrawford03's full-sized avatar
:octocat:
I said, "hey, what's going on?"

Scott Crawford scottcrawford03

:octocat:
I said, "hey, what's going on?"
View GitHub Profile

Keybase proof

I hereby claim:

  • I am scottcrawford03 on github.
  • I am scottcrawford (https://keybase.io/scottcrawford) on keybase.
  • I have a public key ASAAqBHNQ-EcBc7rc9OTIwwncOAQdfnQLI-t0uTbQ2l_oQo

To claim this, I am signing this object:

@scottcrawford03
scottcrawford03 / k8s-cluster-memory.md
Created January 16, 2019 19:23
This is a breakdown of the memory usage of a cluster with tiller, helm and a catalog.

nodes from a top level:

do-service-broker ❯❯❯ kc top nodes NAME CPU(cores) CPU% MEMORY(bytes) MEMORY% reverent-nash-8x97 44m 4% 613Mi 32% reverent-nash-8x9c 32m 3% 456Mi 23% reverent-nash-8x9m 45m 4% 485Mi 25%

FIRST NODe

Non-terminated Pods: (4 in total) Namespace Name CPU Requests CPU Limits Memory Requests Memory Limits

K8s Cluster Side of the House

Steps to add a service catalog to a kubernetes cluster on DigitalOcean

  1. log into do and provision a new cluster

  2. set up service catalog via helm (commands pulled from https://kubernetes.io/docs/tasks/service-catalog/install-service-catalog-using-helm/#before-you-begin)

    • helm repo add svc-cat https://svc-catalog-charts.storage.googleapis.com
select recommendations.link, recommendations.recommendation_type, recommendations.title, profile_question_options.option_data, recommendations.profile_question_option_id, recommendations.priority
from recommendations
inner join profile_question_options on profile_question_options.id = recommendations.profile_question_option_id
where (recommendations.priority=2 and recommendations.recommendation_type='article' and recommendations.profile_question_option_id in` + oneClickParams + `)
or (recommendations.recommendation_type='article' and recommendations.profile_question_option_id in` + questionOptionQueryParam + `)
order by recommendations.priority
limit 7;
-- I want records that match the first where clause to be returned at the top and then i want to order the results of the second where clause by their priority.
-- If i were to do this with two queries i'd basically just make the first where cluase and add it to an array and then make the second where clause and append it to that same array.
#!/bin/bash
cd ~
sudo apt-get update
sudo apt-get install -y nginx
sudo chown -R `whoami`:`id -gn` /var/www/html
mkdir static
cd static
#!/bin/bash
echo "updating and installing apache"
sudo apt-get update
sudo apt-get install -y apache2
sudo chown -R `whoami`:`id -gn` /var/www/html
sudo apt-get install git
echo "making proj"
mkdir ~/proj
@scottcrawford03
scottcrawford03 / errors.go
Last active May 14, 2018 20:41
go by example solutions
// This one was tough because I didn't know that you had to tell the function that it was going to return a float and an error.
// Once I figured that piece out then it started to make sense.
package main
import (
"fmt"
)
type ErrNegativeSqrt float64
@scottcrawford03
scottcrawford03 / Cursor.png
Last active December 8, 2017 21:37
pants picture
Cursor.png

How to make yourself desireable to a mentor

The importance of mentors

  • Help with projects
  • Learn from a working professional
  • Build your network

How to make initial contact

  • Reach out and get to know each other
  • Arrange to meet for coffee
@scottcrawford03
scottcrawford03 / positivity.md
Last active August 29, 2015 14:16
The Power of Positive Thinking