Skip to content

Instantly share code, notes, and snippets.

View EmilienM's full-sized avatar
🚀

Emilien Macchi EmilienM

🚀
View GitHub Profile
@EmilienM
EmilienM / infra.go
Last active February 6, 2023 21:19
loadBalancer in OpenShift Infra
type PlatformLoadBalancerOpenShiftManaged struct {
// Type is the type of the OpenShift managed load balancer used by the cluster.
// The default value is Default.
// +default="Default"
// +kubebuilder:default:="Default"
// +kubebuilder:validation:Enum=Default
// +kubebuilder:validation:Required
// +optional
Type PlatformLoadBalancerOpenShiftManagedType `json:"type,omitempty"`
}
@EmilienM
EmilienM / worker-dpdk.sh
Last active November 17, 2021 23:48
Enable DPDK on a worker
#!/usr/bin/env bash
DPDK_NETWORK_NAME="hostonly"
HUGEPAGES="1"
cat > 01-pao-namespace.yaml <<EOF
apiVersion: v1
kind: Namespace
metadata:
name: openshift-performance-addon-operator
@EmilienM
EmilienM / Netcat
Created June 17, 2013 16:39
Netcat
Write text :
Server side : nc -l 3333
Client side : nc X.X.X.X 3333
Transfert a file :
Server side : cat file | nc -l 3333
Client side : nc X.X.X.X 3333 > file
@EmilienM
EmilienM / ram_consume.c
Created June 4, 2013 23:19
C script that consumes memory, 512M per 512M, every time it runs, it'll consume 512M of RAM:
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#define K 1024
#define M 1024*K
#define MAX_MEM 500
#define BLK_SIZE M
@EmilienM
EmilienM / Screen HowTo
Created May 23, 2013 07:41
Screen HowTo
screen -S emilien
CTRL + A and C : Create a new terminal
CTRL + A and SHIFT + A : Rename the current terminal
@EmilienM
EmilienM / gist:5554031
Created May 10, 2013 12:11
Debug in Python
1) Add at the beginning of the script :
import pdb
2) Add pdb.set_trace() where we want to stop the script to give the end at the user in prompt.
3) Run the script :
python -m pbd script.py
@EmilienM
EmilienM / gist:5507988
Created May 3, 2013 08:43
Drop comments
sed -e 's/#.*$//' -e '/^$/d' nova.conf |pastebinit