Skip to content

Instantly share code, notes, and snippets.

🤓
Going to Go

Chris Suszynski cardil

🤓
Going to Go
Block or report user

Report or block cardil

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View activator-947bd7448-9mxxv-activator.log
2020/01/03 14:36:38 Registering 5 clients
2020/01/03 14:36:38 Registering 2 informer factories
2020/01/03 14:36:38 Registering 3 informers
{"level":"info","ts":"2020-01-03T14:36:38.541Z","caller":"logging/config.go:108","msg":"Successfully created the logger.","knative.dev/jsonconfig":"{\n \"level\": \"info\",\n \"development\": false,\n \"outputPaths\": [\"stdout\"],\n \"errorOutputPaths\": [\"stderr\"],\n \"encoding\": \"json\",\n \"encoderConfig\": {\n \"timeKey\": \"ts\",\n \"levelKey\": \"level\",\n \"nameKey\": \"logger\",\n \"callerKey\": \"caller\",\n \"messageKey\": \"msg\",\n \"stacktraceKey\": \"stacktrace\",\n \"lineEnding\": \"\",\n \"levelEncoder\": \"\",\n \"timeEncoder\": \"iso8601\",\n \"durationEncoder\": \"\",\n \"callerEncoder\": \"\"\n }\n}"}
{"level":"info","ts":"2020-01-03T14:36:38.541Z","caller":"logging/config.go:109","msg":"Logging level set to info"}
{"level":"info","ts":"2020-01-03T14:36:38.541Z","caller":"logging/config.go:76","msg":"Fetch
@cardil
cardil / knative-serving-operator.log
Created Nov 26, 2019
knative-serving-operator.log
View knative-serving-operator.log
{"level":"info","ts":1574791351.2938538,"logger":"cmd","msg":"Go Version: go1.13.4"}
{"level":"info","ts":1574791351.2938857,"logger":"cmd","msg":"Go OS/Arch: linux/amd64"}
{"level":"info","ts":1574791351.2938917,"logger":"cmd","msg":"Version of operator-sdk: v0.8.0"}
{"level":"info","ts":1574791351.2943332,"logger":"leader","msg":"Trying to become the leader."}
{"level":"info","ts":1574791351.4278533,"logger":"leader","msg":"No pre-existing lock was found."}
{"level":"info","ts":1574791351.4339006,"logger":"leader","msg":"Became the leader."}
{"level":"info","ts":1574791351.5361984,"logger":"cmd","msg":"Registering Components."}
{"level":"info","ts":1574791351.536406,"logger":"manifestival","msg":"Reading file","name":"deploy/resources"}
{"level":"info","ts":1574791351.552737,"logger":"openshift","msg":"Detected","gvk":"route.openshift.io/v1, Kind=route"}
{"level":"info","ts":1574791351.5529993,"logger":"openshift","msg":"Dropping APIService for v1beta1.custom.metrics.k8s.io"}
@cardil
cardil / aws-vpc-limits.groovy
Created Oct 17, 2019
A littple script that fetches VPC releated AWS quotas
View aws-vpc-limits.groovy
import groovy.json.JsonSlurper
def regions = ["us-west-1", "us-west-2", "us-east-1", "us-east-2", "eu-west-1"]
def vpcService = 'vpc'
def vpcCode = 'L-F678F1CE'
def elasticIpService = 'ec2'
def elasticIpCode = 'L-0263D0A3'
println "Current AWS limits"
println "------------------"
@cardil
cardil / JEP.md
Last active Jan 17, 2020
[Draft] JEP - Change name of imported type (aliasing)
View JEP.md

Summary

Change name of imported type (aliasing)

Goals

The goal is to make code more productive and clean in cases where multiple classes with same name must be used in code. It should relief a developers frustration in that

@cardil
cardil / BOM_JS.md
Last active Jan 15, 2019
Bill of Materials (BOM) dla JS [PL]
View BOM_JS.md

Chciałem opisać koncept pracy nad dużym projektem. Wyobraźmy sobie duży projekt, wiele osób, wiele zakresów biznesowych, wiele osobnych backendów, wszystko powinno być zintegrowane do jednej spójnej aplikacji. Przy takim projekcie proponowałbym pracę w z użyciem projektu BOM (Bill of Materials).

Ten koncept wywodzi się z skomplikowanych projektów ze świata Java.

Poniżej graf przedstawiający taką strukturę.

View Example fact with error checking.rb
Fact.new(:databases) do
setcode do
output = Facter::Util::Resolution.exec('pgsql listdb')
if $?.success?
{
status: :ok,
list: output.split("\n")
}
else:
raise output
@cardil
cardil / modules.rb
Created Feb 21, 2018
Example custom fact for Facter 3+ with 2 implementations
View modules.rb
Facter.add(:modules) do
setcode { simple }
def simple
codedir = Facter::Core::Execution.exec('puppet config print codedir')
list = Facter::Core::Execution.exec("ls #{codedir}/modules").split("\n")
{
count: list.size,
list: list.freeze
@cardil
cardil / Vagrantfile
Created Sep 19, 2017
Example Vagrantfile to test puppet agent-server connections
View Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = 'boxcutter/centos7'
config.vm.define :master do |m|
m.vm.network "private_network", ip: "192.168.50.4"
m.vm.provider "virtualbox" do |v|
v.memory = 768
v.cpus = 2
end
end
@cardil
cardil / git-list-merged-branches
Last active May 16, 2017
git-list-merged-branches - A script that can find already merged branches and provide git command to remove them
View git-list-merged-branches
#!/bin/bash
getopt --test > /dev/null
if [[ $? -ne 4 ]]; then
echo "I’m sorry, `getopt --test` failed in this environment."
exit 1
fi
SHORT=d:b:e:h
LONG=date:,branches:,excluded:,help
@cardil
cardil / change-ts-to-human-readable.groovy
Created Jun 30, 2016
Changing Date from timestame to human readable Date from String
View change-ts-to-human-readable.groovy
import java.nio.file.Files
import java.nio.file.Path
import java.nio.file.Paths
directory = args[0] // directory
d = Paths.get(directory)
stream = Files.newDirectoryStream(d)
stream.each {
p = it as Path;
println "file -> ${p}"
You can’t perform that action at this time.