Skip to content

Instantly share code, notes, and snippets.

View Shaked's full-sized avatar

Shaked Klein Orbach Shaked

View GitHub Profile
Buildkit Example
# Terminal 1
$ mkdir /tmp/buildkit-example
$ cd /tmp/buildkit-example
$ k3d cluster create buildkitexample
...
$ docker buildx create \
--driver kubernetes \
--name bkworker \
from flask import abort, jsonify
app = Blueprint('app', __name__)
@app.route("/save/name/:name", methods['POST'])
def save_file(name):
service = create_service()
result = service.save_name(name)
if result:
return jsonify(result=result)
@Shaked
Shaked / buildkitd.toml-configMap.yaml
Last active October 28, 2021 21:42
Kubernetes continuous integration using BuildKit, buildx and docker regisrty
apiVersion: v1
kind: ConfigMap
data:
buildkitd.toml: |
debug = true
root = "/var/lib/buildkit"
# see https://github.com/docker/buildx/issues/516#issuecomment-771236525
[registry."{{ .Values.localRegistryMirror }}"]
http = true
insecure = true
@Shaked
Shaked / README.md
Last active August 31, 2021 22:59
Rancher server with multipass and k3s multi node environment on macOS
  1. Create a VM for rancher server:
multipass launch --name rancher-server --cpus 4 --mem 4g --disk 20g
multipass exec rancher-server -- bash -c "curl -sfL https://get.k3s.io | K3S_KUBECONFIG_MODE="644" sh -"
multipass exec rancher-server sudo cat /etc/rancher/k3s/k3s.yaml > ~/.kube/rancher-server.yaml
RANCHER_SERVER_IP=$(multipass info k3s | grep IPv4 | awk '{print $2}')
sed -i '' "s/127.0.0.1/${RANCHER_SERVER_IP}/"  ~/.kube/rancher-server.yaml
kubie ctx default
  1. brew install helm@3
#!/usr/bin/env python
import cv2
import time
import skvideo.io
import time
#https://stackoverflow.com/questions/49138457/what-is-the-opposite-of-cv2-videowriter-fourcc
def decode_fourcc(cc):
return "".join([chr((int(cc) >> 8 * i) & 0xFF) for i in range(4)])
@Shaked
Shaked / ffuf.md
Last active December 30, 2019 15:54

I use this function in my .zshrc file

Fuzz with stdin

fuzz-in() {
	strip=$(echo $1|sed 's/:\/\///')
	strip=$(echo $strip| sed 's/\\/\-/g')
	strip=$(echo $strip| sed 's/\//-/g')
	ffuf -u $1 -t 10 -o $strip.fuzz.txt -of md -p 1 "${@:2}" -w -
@Shaked
Shaked / remote.php
Created October 6, 2019 11:03
SSRF ideas?
<?php
$url = $_GET['url'];
$xml = @file_get_contents($url);
$ret = [];
if ($xml) {
$doc = new DOMDocument();
libxml_use_internal_errors(true);
if ($doc->loadHTML($xml)) {
$ lsb_release  -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.2 LTS
Release:	18.04
Codename:	bionic

$ dpkg -l | grep strongswan
ii  libstrongswan                       5.6.2-1ubuntu2.4                            amd64        strongSwan utility and crypto library
FROM arm64v8/ubuntu:16.04
RUN apt-get update && \
apt-get install -y software-properties-common vim && \
add-apt-repository ppa:jonathonf/python-3.6
RUN apt-get update -y
RUN apt-get install -y build-essential python3.6 python3.6-dev python3-pip python3.6-venv && \
apt-get install -y git
# docker build -t ubuntu1604py36
FROM ubuntu:18.04
RUN apt-get update && \
apt-get install -y software-properties-common vim && \
add-apt-repository ppa:jonathonf/python-3.6
RUN apt-get update -y
RUN apt-get install -y build-essential python3.6 python3.6-dev python3-pip python3.6-venv && \
apt-get install -y git