Skip to content

Instantly share code, notes, and snippets.

View judavi's full-sized avatar

Juan judavi

  • Palet Town
View GitHub Profile
@judavi
judavi / command.yaml
Created July 20, 2023 08:10
What I can do as a Kubernetes SA or User?
kubectl auth can-i --list --as=system:serviceaccount:wcp-sampleapp-clsc:cf-wcp-sampleapp-clsc -n wcp-sampleapp-clsc
@judavi
judavi / test.go
Created June 5, 2020 12:40
Log golang Db query?
package main
import (
"regexp"
"fmt"
"strings"
)
func main() {
var re = regexp.MustCompile(`:\d`)
@judavi
judavi / wallet.py
Created May 17, 2020 09:08
BTC seed guesser
from bitcoinlib.wallets import HDWallet
from bitcoinlib.wallets import HDWalletKey
from bitcoinlib.wallets import HDKey
from bitcoinlib.mnemonic import Mnemonic
# 11 word seed
seed = "please help hard puzzle will become crazy valid seed must sleep"
# here be gold
gold = "bc1qj7467e7r5pdfpypm03wyvguupdrld0ul2gcutg"
@judavi
judavi / .vimrc
Last active January 25, 2021 08:12
Resources CKAD
" Yaml file handling
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
filetype plugin indent on
autocmd FileType yaml setl indentkeys-=<:>
" Copy paste with ctr+c, ctr+v, etc
:behave mswin
:set clipboard=unnamedplus
:smap <Del> <C-g>"_d
:smap <C-c> <C-g>y
@judavi
judavi / note.json
Created March 19, 2020 16:59
Image Notes and Occurrences in Grafeas Model
{
"name": "/projects/images/notes/rhel7_7.14",
"shortDescription": "Base image note for RHEL 7 7.14",
"longDescription": "",
"kind": "baseImage",
"relatedUrl": [
{
"url": "",
"label": "Artifactory URL",
}
@judavi
judavi / occurrence.json
Last active March 19, 2020 13:42
Build Occurrence Grafeas
{
"name": "projects/my-project/occurrences/randomID",
"noteName": "providers/verified-builder/notes/buildID",
"createTime": "2017-06-15T15:28:40.142107Z",
"updateTime": "2017-06-15T15:28:40.142107Z",
"kind": "BUILD",
"resourceUrl": {
"uri": "https://myregistry/image@sha256:hash",
},
"build": {
@judavi
judavi / query.sql
Created February 20, 2020 15:09
Grafeas get URI
SELECT
o.data.noteName AS "note_name",
o.data AS "data",
o.data."resource".uri AS "image"
FROM OCCURRENCES o
@judavi
judavi / main.go
Created February 11, 2020 16:39
Basic Grafeas List Occurrences Client
package main
import (
"context"
"crypto/tls"
"crypto/x509"
"io/ioutil"
"log"
"fmt"