Skip to content

Instantly share code, notes, and snippets.

f := fake.NewSimpleClientset(objects...)
f.PrependReactor(
"patch",
"deployments",
func(action clienttesting.Action) (handled bool, ret runtime.Object, err error) {
pa := action.(clienttesting.PatchAction)
if pa.GetPatchType() == types.ApplyPatchType {
// Apply patches are supposed to upsert, but fake client fails if the object doesn't exist,
// if an apply patch occurs for a deployment that doesn't yet exist, create it.
// However, we already hold the fakeclient lock, so we can't use the front door.
@196Ikuchil
196Ikuchil / extender-policy.yaml
Created September 8, 2022 11:05
This policy used to debug of extender support on kube-scheduler-simulator.
# export KUBE_SCHEDULER_CONFIG_PATH=~/go_project/kube-scheduler-simulator/extender-policy.yaml
apiVersion: kubescheduler.config.k8s.io/v1beta2
kind: KubeSchedulerConfiguration
leaderElection:
leaderElect: false
profiles:
- schedulerName: default-scheduler
extenders:
- urlPrefix: "http://localhost:8080/scheduler/"
filterVerb: "predicates/always_true"
<template>
<v-container fluid>
<v-radio-group v-model="viewTypeComputed" row>
<v-radio
v-for="(_, i) in radioLabels.length"
:key="i"
:label="radioLabels[i]"
:value="i"
></v-radio>
</v-radio-group>
/bin/bash -c "printf '
\e[48;2;194;194;194m\e[38;2;26;43;21m▄\e[48;2;159;158;159m\e[38;2;58;91;50m▄\e[48;2;130;130;130m\e[38;2;68;119;56m▄\e[48;2;116;117;116m\e[38;2;86;143;70m▄\e[48;2;98;98;98m\e[38;2;100;153;87m▄\e[48;2;63;65;63m\e[38;2;102;164;86m▄\e[48;2;46;49;44m\e[38;2;98;168;79m▄\e[48;2;43;45;43m\e[38;2;91;155;75m▄\e[48;2;61;62;61m\e[38;2;78;137;63m▄\e[48;2;102;101;102m\e[38;2;64;112;52m▄\e[48;2;134;134;134m\e[38;2;38;67;32m▄\e[48;2;164;164;164m\e[38;2;20;35;16m▄\e[48;2;188;187;188m\e[38;2;10;20;8m▄\e[48;2;223;223;223m\e[38;2;15;21;13m▄\e[0m
\e[48;2;230;230;230m\e[38;2;49;80;41m▄\e[48;2;132;132;133m\e[38;2;73;133;59m▄\e[48;2;20;21;20m\e[38;2;91;163;72m▄\e[48;2;14;27;12m\e[38;2;96;174;76m▄\e[48;2;51;92;41m\e[38;2;98;177;78m▄\e[48;2;86;155;68m\e[38;2;98;177;78m▄\e[48;2;96;173;77m\e[38;2;98;177;78m▄\e[48;2;98;177;78m \e[48;2;98;177;78m \e[48;2;98;177;78m \e[48;2;98;177;78m \e[48;2;98;177;78m \e[48;2;98;177;78m \e[48;2;98;177;78m \e[48;2;98;177;78m \e[48;2;98;177;78m \e[48
@196Ikuchil
196Ikuchil / gzipper.sh
Created April 26, 2020 04:51
houseplantctf recursive zip extracting tar gz zip v1 v2 with bash
#/bin/bash
name=$1
gzip -cd $name > out
./selector.sh out
@196Ikuchil
196Ikuchil / javascriptkiddle2.rb
Created October 26, 2019 15:51
pico2019 javascriptkiddle2
result = []
File.open("q2.txt","r") do |f|
bytes = f.readline.split(" ")
LEN = 16
# key = "6059204266803763"
key ="0"*32
if key.length !=32
p "長さが違うよ"
return
@196Ikuchil
196Ikuchil / javascriptkiddle.rb
Last active October 25, 2019 17:20
JavaScriptKiddle pico2019
result = []
File.open("q.txt","r") do |f|
bytes = f.readline.split(" ")
LEN = 16
# key = "6059204266803763"
key ="0"*16
if key.length !=16
p "長さが違うよ"
return
@196Ikuchil
196Ikuchil / Hello.c
Last active September 18, 2019 17:03
UEFI mini camp
#include <Uefi.h>
#include <Library/UefiLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/PrintLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/SimpleFileSystem.h>
#include "Memory_map.h"
//省略..
@196Ikuchil
196Ikuchil / neko_loader.php
Created August 12, 2019 23:08
interkosenctf2019
<?php
if (empty($_POST['ext']) || empty($_POST['name'])) {
// Missing parameter(s)
header("HTTP/1.1 404 Not Found");
print("404 Not Found");
exit;
} else {
$ext = strtolower($_POST['ext']); // Extension
$name = strtolower($_POST['name']); // Filename
}
@196Ikuchil
196Ikuchil / Image Extractor.rb
Created August 12, 2019 15:14
interkosenctf2019
require 'sinatra'
require 'securerandom'
require 'fileutils'
set :environment, :production
before do
if Dir.exists?("workdir")
du = `du -s workdir`.split[0].to_i
if du * 512 >= 1024 * 1024 * 10