Skip to content

Instantly share code, notes, and snippets.

@nledez
nledez / compare_checksums.py
Created August 23, 2021 15:42
Compare two checksum files
#!/usr/bin/env python3
import sys
a = {}
b = {}
for line in open(sys.argv[1]).readlines():
(checksum, filename) = line.rstrip().split(' ')
a[filename] = checksum
@nledez
nledez / webpack.config.js
Created September 20, 2020 20:17
working webpack.config.js for .js & .scss
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const path = require("path");
module.exports = {
entry: {
bundle: [
"./src/js/scripts.js",
"./src/styles/index.scss"
],
},
@nledez
nledez / index.html
Created April 16, 2020 08:14
Hello world
<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
<HEAD>
<TITLE>
A Small Hello
</TITLE>
</HEAD>
<BODY>
<H1>Hi</H1>
<P>This is very minimal "hello world" HTML document.</P>
ovh
pytest
pytest-mock
@nledez
nledez / cds.nomad
Created June 14, 2019 08:38
CDS Nomad (not working actualy)
job "cds" {
datacenters = ["dc1"]
type = "service"
group "cache" {
count = 1
task "redis" {
driver = "docker"
config {
@nledez
nledez / mult.py
Created March 26, 2019 13:54
Table mult
def table(number):
for i in range(1, 11):
print('{} * {} = {}'.format(i, number, i*number))
table(1)
table(5)
@nledez
nledez / export_project.sh
Created October 31, 2018 09:46
Export a CDS project
#!/bin/bash
PROJECT=${1}
if [ -z ${PROJECT} ]; then
echo "Give me a project:"
echo "${0} <project name>"
exit 1
fi
for t in environment pipeline application workflow; do
@nledez
nledez / install_plugins.sh
Created October 28, 2018 21:08
CDS install or update plugins
#!/bin/bash
RELEASE=${1:-0.36.1}
shift
echo "Install ${RELEASE}"
INSTALLED="$(cdsctl admin plugins list --format json | jq '.[].name' | xargs | sed 's/plugin-//g')"
if [ "$1" = "" ]; then
PLUGINS="${INSTALLED}"
elif [ "$1" = "all" ]; then
@nledez
nledez / config.py
Created September 7, 2018 21:46
Parse email to extract OVH token validation for account change
imap_account = 'user'
imap_passwd = 'pass'
imap_server = 'imap.truc.tld'
inbox_folder = 'INBOX'
@nledez
nledez / body.json
Created May 27, 2018 21:44
Gitlab webhook push
{
"object_kind": "push",
"before": "95790bf891e76fee5e1747ab589903a6a1f80f22",
"after": "da1560886d4f094c3e6c9ef40349f7d38b5d27d7",
"ref": "refs/heads/master",
"checkout_sha": "da1560886d4f094c3e6c9ef40349f7d38b5d27d7",
"user_id": 4,
"user_name": "John Smith",
"user_username": "jsmith",
"user_email": "john@example.com",