Skip to content

Instantly share code, notes, and snippets.

View kinoute's full-sized avatar
🐉
playing with Ghidra

Yann Defretin kinoute

🐉
playing with Ghidra
View GitHub Profile
@kinoute
kinoute / .Dockerfile
Last active March 28, 2024 04:44
Example of Ruby on Rails 6 Multi-stage builds with Docker. Development/production environments share the same Dockerfile.
FROM ruby:2.7.1-slim AS base
LABEL maintainer="Yann Defretin <yann@defret.in"
# Common dependencies
RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq \
--no-install-recommends \
build-essential=12.6 \
gnupg2=2.2.12-1+deb10u1 \
@kinoute
kinoute / docker.tf
Created November 29, 2023 06:36 — forked from phumberdroz/docker.tf
Terraform populate Docker Credentials in all Namespaces
variable "docker_password" {}
data "kubernetes_all_namespaces" "allns" {}
resource "kubernetes_secret" "docker_secrets" {
for_each = toset(data.kubernetes_all_namespaces.allns.namespaces)
metadata {
name = "gitlab-cloud"
namespace = each.value
}
@kinoute
kinoute / style.css
Created April 21, 2021 22:46
Add a wrapper around tables to allow overflow on Jekyll websites
.table-wrapper {
overflow: auto;
padding-top: 10px;
padding-bottom: 10px;
}
@kinoute
kinoute / get-md-images.sh
Last active June 11, 2023 11:33
Download remote images from markdown/jupyter notebooks files and update paths from remote to local.
#!/bin/bash
###################################################################
# Script Name : get-md-images.sh
# Description : Download all remote images written as markdown
# in our files and replace URLs by local path.
# Author : Yann Defretin
# Email : yann@defret.in
###################################################################
@kinoute
kinoute / kill-idle-rabbitmq-connections.sh
Last active December 27, 2022 14:30
Kill idle RabbitMQ connections
#!/usr/bin/env bash
check_connection() {
PID=$(echo "$1" | awk '{print $1}')
SOURCE=$(echo "$1" | awk '{print $2}')
SOURCE_STATUS=$(curl --silent --fail "$SOURCE" --max-time 1 > /dev/null)
# Status code returned when a timeout occurs
if [[ $? -eq 28 ]]; then
@kinoute
kinoute / helpers.c
Created June 10, 2020 21:04
Harvard CS50 filters
#include "helpers.h"
#include <stdio.h>
#include <math.h>
// Convert image to grayscale
void grayscale(int height, int width, RGBTRIPLE image[height][width])
{
for (int i = 0; i < height; i++)
{
for (int j = 0; j < width; j++)
@kinoute
kinoute / syntax-highlighting-languages.md
Created June 21, 2020 16:47
A list of code blocks from many languages to, for example, test a custom theme and see how it renders the code for each language.

Syntax Highlighting in Markdown

A list of code blocks from many languages to, for example, test a custom theme and see how it renders the code for each language.

Bash

#!/bin/bash
@kinoute
kinoute / substitution.c
Last active June 11, 2020 15:44
Harvard CS50 substitution
#include <cs50.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main(int argc, string argv[])
{
// the user must provide one and only argument
if (argc != 2)
{
@kinoute
kinoute / plurality.c
Created June 9, 2020 12:42
Harvard CS50 Plurality
#include <cs50.h>
#include <stdio.h>
#include <string.h>
// Max number of candidates
#define MAX 9
// Candidates have name and vote count
typedef struct
{
# EditorConfig is awesome: http://EditorConfig.org
# https://github.com/jokeyrhyme/standard-editorconfig
# top-most EditorConfig file
root = true
# defaults
[*]
charset = utf-8