Skip to content

Instantly share code, notes, and snippets.

View vitoo's full-sized avatar

Victorien vitoo

  • Paris, France
  • 00:10 (UTC +02:00)
View GitHub Profile
@vitoo
vitoo / debug usb video device class.md
Last active June 10, 2024 13:06
Debug UVC (USB video device class) on linux
sudo nano /etc/systemd/system/uvcvideo-trace.service

Add the following content to the service file:

[Unit]
Description=Set uvcvideo trace parameter
After=systemd-modules-load.service

[Service]

Type=oneshot

@vitoo
vitoo / download_artifact.sh
Last active February 10, 2023 09:26
Download last github action artifact of a given repository and branch
#!/bin/bash
set -e
cd /tmp
# Define the repository and branch name
repo=$1
branch=$2
token=$3
@vitoo
vitoo / archv.user.js
Last active June 25, 2021 13:29
archv.user.js
// ==UserScript==
// @name archv.user.js
// @version 0.1
// @grant none
// @include /^(http|https):\/\/www\.jeuxvideo\.com\/forums\/(.*)$/
// ==/UserScript==
let topic410 = false;
if(document.getElementsByClassName("img-erreur")[0] && document.getElementsByClassName("img-erreur")[0].src == "https://www.jeuxvideo.com/img/erreurs/e410.png"){
@vitoo
vitoo / selecteur.md
Created September 22, 2017 09:08
Les sélecteurs selenium (xpath,css...) dans Cerberus

Les selecteurs dans Cerberus

Exemple avec le bouton de recherche norauto.fr

Code html du bouton :

<button id="search-submit-button" class="search" type="submit" name="search">Rechercher</button>

Le type de l'élément est ici un button, et il a plusieurs attribut : id, class, type, name.

@vitoo
vitoo / dni_portugal.js
Last active November 17, 2021 16:13
Generate DNI/NIF for Spain and Portugal, in javascript
//credit : https://github.com/asmarques/pt-id
function pad(value, length) {
var result = value + '';
while (result.length < length) {
result = '0' + result;
}
return result;
@vitoo
vitoo / sshrc
Last active August 2, 2017 18:31
Send discord webhook at ssh login (every user)
#/etc/ssh/sshrc
ip=`echo $SSH_CONNECTION | cut -d " " -f 1`
curl --silent -v \
-H "Content-Type: application/json" \
-X POST \
-d "{\"content\":\"new login $USER $ip \"}" \
https://discordapp.com/api/webhooks/_WEBOOK_URL > /dev/null 2>&1