Skip to content

Instantly share code, notes, and snippets.

View davlgd's full-sized avatar

David Legrand davlgd

View GitHub Profile
@davlgd
davlgd / sd_bench.fio
Created March 10, 2020 09:38
Raspberry Pi SD Card Speed Test files
# Use FIO to emulate the Apps Class A1 performance test.
# This isn't an exact benchmark as the card isn't in the state required by the
# specification, but is good enough as a sniff test.
#
[global]
ioengine=libaio
iodepth=4
size=64m
direct=1
end_fsync=1
@davlgd
davlgd / pi_soc_monitor.py
Created July 30, 2019 07:02
Raspberry Pi SoC monitoring script
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import csv
import time
delay = 2
csv_file = "pi_soc_results.csv"
@davlgd
davlgd / apps-init.cmd
Last active May 7, 2019 10:31
Apps init (via Chocolatey)
@ECHO OFF
TITLE Application initializer v0.1
COLOR 0A
ECHO ### Installation de Chocolatey ###
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
refreshenv
@davlgd
davlgd / Autounattend.xml
Last active April 14, 2024 12:15
Fichier d'automatisation de l'installation de Windows 10 Pro
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SetupUILanguage>
<UILanguage>fr-FR</UILanguage>
</SetupUILanguage>
<SystemLocale>fr-FR</SystemLocale>
<UILanguage>fr-FR</UILanguage>
<UILanguageFallback>fr-FR</UILanguageFallback>
@davlgd
davlgd / default
Last active April 1, 2022 01:20
Menu PXE Linux
DEFAULT menu.c32
MENU TITLE Serveur d'installation PXE
TIMEOUT 300
LABEL debian
MENU LABEL ^Debian 9.9 (Netboot)
LINUX memdisk
INITRD _iso/debian_9.9_netboot.iso
LABEL fedora30
@davlgd
davlgd / auto.preseed
Last active July 8, 2022 10:29
Ubuntu Desktop 19.04 Preseed File
### Fichier de préconfiguration pour l'installation d'Ubuntu Desktop 19.04 (Disco Dingo)
### Intègre les éléments liés à Ubiquity mais principalement basé sur Debian Installer
### Template complet : https://help.ubuntu.com/lts/installation-guide/example-preseed.txt
### Guide officiel : https://help.ubuntu.com/lts/installation-guide/s390x/apbs04.html
##########################################################
### Paramètres Ubiquity uniquement pour Ubuntu Desktop ###
##########################################################
### Reprise du contenu d'Ubuntu.seed
@davlgd
davlgd / preseed.cfg
Last active April 30, 2019 12:54
Preseed file for Debian 9.x (French)
### Fichier de préconfiguration pour l'installation de Debian 9.x (Stretch)
### Template complet : https://www.debian.org/releases/stable/example-preseed.txt
### Guide officiel : https://www.debian.org/releases/stable/i386/apbs04.html.fr
### Configuration du français comme langue d'installation
d-i debian-installer/locale string fr_FR
### Décommenter pour configurer chaque élément de manière distincte
### Peut être utile pour des combinaisons spécifiques
#d-i debian-installer/locale string fr_FR.UTF-8
@davlgd
davlgd / crontab
Created December 31, 2018 16:30
Vérificateur d'actus Python + Vocal
*/5 * * * * export DISPLAY=:0 && ~/ih_news_checker/ih_news_checker.py 2>&1 | /usr/bin/logger -t ih_news_checker
@davlgd
davlgd / hue_manager.py
Created December 29, 2018 09:58
Exercice de contrôle des Philips Hue en Python
import requests
import json
bridge_ip = "IP_du_pont"
username = "votre_jeton"
light_number = "ID_de_la_lampe"
lights_url = "http://{}/api/{}/lights".format(bridge_ip, username)
light_state_url = "{}/{}/state".format(lights_url, light_number)
@davlgd
davlgd / background.js
Last active September 10, 2018 08:45
Bad Search Engine Blocker - Projet final
chrome.webRequest.onBeforeRequest.addListener(function (request) {
const askedURL = new URL(request.url);
const keywords = askedURL.searchParams.get("q");
if (/bing.|google.|yahoo./.test(askedURL.hostname))
{
const destinationUrl = (keywords) ? "https://www.framabee.org?q=" + keywords : "https://www.framabee.org";
return { redirectUrl: destinationUrl };
}
},