Skip to content

Instantly share code, notes, and snippets.

View jpigree's full-sized avatar
😊

Jonathan Pigree jpigree

😊
  • DevOps Experience
  • Polynésie
View GitHub Profile
#!/bin/bash -e
echo "Désactiver le forwarding vers syslog"
sudo sed -i '/ForwardToSyslog/ s/.*/ForwardToSyslog=no/g' /etc/systemd/journald.conf
echo "Redémmarrage de systemd"
sudo systemctl restart systemd-journald
echo "Désactiver syslog"
sudo systemctl stop rsyslog
@jpigree
jpigree / merge_dependabot-prs
Last active October 30, 2021 15:03
Merge dependabot prs. Useful when having a lot of those PRs across multiple repositories on Github. Need to clone all target repositories in same directory first.
#!/bin/bash -e
REPO_DIR="$(realpath ${1:-.})"
for repo in $(find "$REPO_DIR" -mindepth 1 -maxdepth 1 -type d)
do
if [ ! -d "$repo/.git" ]
then
echo "Skipping $repo. Not a git repo"
continue
@jpigree
jpigree / blue_slidebar
Created November 5, 2019 21:22
Google Slides blue slidebar
/**
* @OnlyCurrentDoc Adds progress bars to a presentation.
*/
var BAR_ID = 'PROGRESS_BAR_ID';
var BAR_HEIGHT = 5; // px
var presentation = SlidesApp.getActivePresentation();
/**
* Runs when the add-on is installed.
* @param {object} e The event parameter for a simple onInstall trigger. To
@jpigree
jpigree / demo_docker
Last active November 6, 2019 19:05
demo docker
# Get image ubuntu:16.04 from Docker's registry
docker pull ubuntu:16.04
# Run "cat /etc/os-release" into container spawned from image ubuntu:16.04
docker run ubuntu:16.04 cat /etc/os-release
cat /etc/os-release
# Show all containers
docker ps -a
@jpigree
jpigree / check_branch_duration.py
Created March 30, 2018 15:00
Check Git branches duration in a repository
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import operator
from subprocess import check_output, check_call, STDOUT
from datetime import timedelta
from time import time
@jpigree
jpigree / gen_s3_url.py
Created March 30, 2018 14:37
Generate an S3 signed URL
#!/usr/bin/env python
# Tested with Python 3
# Needs boto3 installed (pip install --user boto3)
import optparse
import sys
import boto3
def sign(bucket, path, expiry):
s3 = boto3.client('s3')
@jpigree
jpigree / 85-typematrix.rules
Created September 27, 2017 09:22 — forked from MichaelBitard/85-typematrix.rules
TypeMatrix auto set dvorak mapping when usb is plugged in
ACTION=="add", ATTR{idProduct}=="2030", RUN+="/usr/bin/set_typematrix_dvorak_mapping"
@jpigree
jpigree / LICENSE
Created May 18, 2016 15:56 — forked from shevron/LICENSE
Send EC2 instance memory usage stats to CloudWatch using boto and IAM Roles
Copyright (c) 2015, Shahar Evron
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,