Skip to content

Instantly share code, notes, and snippets.

View odra's full-sized avatar
💻

odra odra

💻
  • São Paulo, Brazil
View GitHub Profile
@odra
odra / README.md
Created July 27, 2021 08:53
reads and changes the default namespace for the current kubectl context

Usage

Get Current Default NS

$ kubectl ns
Current default namespace is "koji".

Sets New Default Namespace

- set_fact:
data: "{{ data | combine({'spec': 'foo': 'bar', recursive=true) }}"
This file has been truncated, but you can view the full file.
{"level":"info","ts":1586259278.428085,"logger":"cmd","msg":"Go Version: go1.13.8"}
{"level":"info","ts":1586259278.4281323,"logger":"cmd","msg":"Go OS/Arch: linux/amd64"}
{"level":"info","ts":1586259278.4281423,"logger":"cmd","msg":"Version of operator-sdk: v0.16.0"}
{"level":"info","ts":1586259278.4285197,"logger":"cmd","msg":"Watching single namespace.","Namespace":"default"}
{"level":"info","ts":1586259278.7432842,"logger":"controller-runtime.metrics","msg":"metrics server is starting to listen","addr":"0.0.0.0:8383"}
{"level":"info","ts":1586259278.7450504,"logger":"watches","msg":"Environment variable not set; using default value","envVar":"WORKER_MBOX_APPS_FEDORAPROJECT_ORG","default":1}
{"level":"info","ts":1586259278.7452688,"logger":"watches","msg":"Environment variable not set; using default value","envVar":"ANSIBLE_VERBOSITY_MBOX_APPS_FEDORAPROJECT_ORG","default":2}
{"level":"info","ts":1586259278.7453985,"logger":"watches","msg":"Environment variable not set; using default value","envVar":"WORKER
@odra
odra / spec.json
Last active March 30, 2020 20:32
sample client
{
"swagger": "2.0",
"info": {
"license": {
"name": "GPLv3",
"url": "https://www.gnu.org/licenses/quick-guide-gplv3.en.html"
},
"title": "Fedora Account Service JSON API",
"version": "0.0.1"
},

RPM Adventure

Tooling

  • A Spec file generator CLI would be nice
  • Submit the package for review from the terminal instead of manually openning a ticket
  • A CLI to host both Spec and Source RPM files somewhere in Fedora infrastructure instead of handling it myself

Docs

@odra
odra / main.rs
Created February 10, 2020 18:55
rust http client
use std::io::prelude::*;
use std::net::TcpStream;
fn main() {
let mut b = vec![0; 4096];
let mut s = String::new();
let headers = "GET /ip HTTP/1.1\r\nHost: httpbin.org\r\nUser-Agent: foobar/0.0.1\r\nAccept: */*\r\n\r\n";
let mut stream = TcpStream::connect("httpbin.org:80").unwrap();
stream.write(headers.as_bytes()).unwrap();
@odra
odra / caller.py
Last active November 7, 2019 23:03
celery stuff
import time
from celery import group
import sources as app
def wait_fn(fn):
is_ready = fn.ready()
while not is_ready:
{"level":"error","ts":1561705894.9195263,"logger":"kubebuilder.controller","msg":"Reconciler error","controller":"pushapplication-controller","request":"unifiedpush/mypushapp","error":"UPS responded with status code: 404, but expected 204","errorVerbose":"UPS responded with status code: 404, but expected 204\ngithub.com/aerogear/unifiedpush-operator/pkg/unifiedpush.UnifiedpushClient.DeleteApplication\n\t/home/lrossett/Work/go/src/github.com/aerogear/unifiedpush-operator/pkg/unifiedpush/client.go:130\ngithub.com/aerogear/unifiedpush-operator/pkg/controller/pushapplication.(*ReconcilePushApplication).Reconcile\n\t/home/lrossett/Work/go/src/github.com/aerogear/unifiedpush-operator/pkg/controller/pushapplication/pushapplication_controller.go:94\ngithub.com/aerogear/unifiedpush-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/home/lrossett/Work/go/src/github.com/aerogear/unifiedpush-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/co
@odra
odra / start.md
Created May 12, 2019 17:17
knative getting started

Kubernetes Cluster

Istio

Install istio from resource files:

#Install istio components
kubectl apply -f https://storage.googleapis.com/knative-releases/serving/latest/istio.yaml
#Check and wait for istio pod readiness
@odra
odra / template.yaml
Created April 18, 2019 11:03
testtemplate
---
apiVersion: v1
kind: Template
labels:
template: ionic-showcase-server
metadata:
name: mobile-develope-services-dataSync-demo-server
annotations:
openshift.io/display-name: Mobile Developer Services Data Sync Example