Skip to content

Instantly share code, notes, and snippets.

View Yoshyn's full-sized avatar
🇫🇷
Graou

Sylvestre Antoine Yoshyn

🇫🇷
Graou
View GitHub Profile
@Yoshyn
Yoshyn / .Manage Kubernete
Last active November 19, 2018 14:13
.Manage Kubernete
# Contains :
# * attachment-rc.yml : How to attach a console to a process inside a pod
# * script.sh : Set of script for managing pods easily
# * minikube_on-mac.sh : Install minikube on macos
# Strace & Docker
# https://medium.com/@rothgar/how-to-debug-a-running-docker-container-from-a-separate-container-983f11740dc6
@Yoshyn
Yoshyn / debug_controller_callback_chain.rb
Last active April 5, 2019 13:49
Give backtraces for all callback related to self and inherited rails controller where the module is included.
module DebugControllerCallbackChain
def self.included(base)
class << base
prepend ClassMethods
end
end
module ClassMethods
def inherited(base)
super
@Yoshyn
Yoshyn / gist:2fd029d57c2e8871730fe4481493c753
Last active April 21, 2020 18:19
Minimal test case to perform an override with newrelic on httpotion
defmodule Base do
defmacro __using__(_) do
quote do
def process, do: "Base.process"
def request, do: "Base.request"
defoverridable Module.definitions_in(__MODULE__)
end
end
end
@Yoshyn
Yoshyn / openssl.md
Last active October 22, 2021 15:15
Verify a certificat (crt) and a private key

Let's check

Check the certificat openssl x509 -in certificate.crt -text -noout

Compare the certificat & the private key; This :

openssl x509 -modulus -noout -in mycomp.com.crt | openssl md5

Should return the same as :

@Yoshyn
Yoshyn / coding_game.rb
Last active May 10, 2020 13:01
Sample stuff for gaming with coding_game
require "minitest/autorun"
require "pry-byebug"
class Position
DIRECTIONS= %i(north east south west)
class Radius
include Enumerable
def initialize(value); @value =value; end
@Yoshyn
Yoshyn / sqlite3.Dockerfile
Created March 5, 2021 19:17
Docker & Sqlite3 backup. Volume manipulation
# docker build -f sqlite3.Dockerfile -t sqlite3:local .
# docker run --rm -it -v sqlite-db-volume:/db sqlite3:local my_app.db
FROM alpine:latest
RUN apk add --update sqlite
RUN mkdir /db
WORKDIR /db
ENTRYPOINT ["sqlite3"]
CMD ["my_app.db"]
@Yoshyn
Yoshyn / .Description
Last active September 2, 2021 12:37
Rails last version & docker-compose setup easy
Rails last version & docker-compose setup easy
@Yoshyn
Yoshyn / .Description
Last active September 5, 2023 12:32
Setup mac
Main step to the setup of my mac.
@Yoshyn
Yoshyn / gist:0dab97ab9cb54b4a0cf66a1d59b54b9d
Created February 4, 2022 10:28
Kind, istio and localhost access
# Kind installation : https://istio.io/latest/docs/setup/platform-setup/kind/
kind create cluster --name istio-testing
kubectl config use-context kind-istio-testing
# Istio installation : https://istio.io/latest/docs/setup/getting-started/
istioctl install --set profile=demo -y
...
@Yoshyn
Yoshyn / AWS SSO : Auto-allow.js
Created November 18, 2022 17:45
Tampermonkey scripts
// ==UserScript==
// @name AWS SSO : Auto-allow
// @namespace https://skillsoftsso.awsapps.com/
// @version 0.1
// @description Auto allow
// @author You
// @match https://skillsoftsso.awsapps.com/start/user-consent/authorize.html?clientId=*
// @grant none
// ==/UserScript==