This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh /etc/rc.common | |
USE_PROCD=1 | |
START=99 | |
STOP=01 | |
start_service() { | |
procd_open_instance | |
procd_set_param command /usr/sbin/wwan0_loop.sh | |
procd_set_param stdout 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mettre à jour la release courante de Fedora (ex: 29) | |
sudo dnf upgrade | |
# Passer à la dernière release pour éviter les soucis avec RPM Fusion, on commence par télécharger l'utilitaire de migration de release | |
sudo dnf install dnf-plugin-system-upgrade -y | |
# Là on va télécharger la nouvelle release de Fedora, on va passer de 29 à 32, | |
# les sauts de version aussi grand c'est pas très bien | |
# répondez oui au moment où on vous demande si votre release courante (29) est à jour, on l'a fait ligne 2 | |
sudo dnf system-upgrade download --releasever=32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while true; do | |
to_wait=$(( (`date -d "$(date "+%Y-%m-%d %H:%M:56")" +%s` - `date +%s` + 60) % 60 + 1)) ; | |
sleep $to_wait ; | |
ip1=$(curl -sSkv --header "Host: api.stopcovid.gouv.fr" https://148.253.97.12/api/v1/status 2>&1 | grep x-ratelimit-remaining-minute | grep -Po "[0-9]+"); | |
ip2=$(curl -sSkv --header "Host: api.stopcovid.gouv.fr" https://148.253.97.16/api/v1/status 2>&1 | grep x-ratelimit-remaining-minute | grep -Po "[0-9]+"); | |
ip3=$(curl -sSkv --header "Host: api.stopcovid.gouv.fr" https://148.253.97.86/api/v1/status 2>&1 | grep x-ratelimit-remaining-minute | grep -Po "[0-9]+"); | |
ts=$(date +%s); | |
now=$(( $ip1 + $ip2 + $ip3 )); | |
extra=$(( (180000 - $now - 3) * 60/57 * 60 * 24 )); | |
if [ -z "$ip1" ] || [ -z "$ip2"] || [ -z "$ip3" ]; then now="" ; extra="" ; fi ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo firewall-cmd --permanent --zone=trusted --add-interface=docker0 | |
sudo firewall-cmd --reload | |
# solution: | |
# https://github.com/docker/for-linux/issues/955#issuecomment-620932240 | |
# | |
# other resources: | |
# https://www.reddit.com/r/Fedora/comments/fl4wkl/fedora_32_no_external_dns_in_docker_containers/ | |
# https://ask.fedoraproject.org/t/dns-resolution-errors-with-docker-in-fedora-32/6385 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: cweb-deployment | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: cweb | |
template: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
v=0; for e in `ls`; do v=$((v+1)) ; idx=$(printf "%06d" $v) ; mv $e $idx.jpg ; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import requests, sys, time, tweepy | |
consumer_key = "" | |
consumer_secret= "" | |
access_token = "" | |
access_token_secret = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const a = require('calls.json') | |
Object.entries( | |
a.result | |
.filter(e => 'missed' == e.type) | |
.reduce((acc, v) => { if (v.number in acc) acc[v.number] += 1; else acc[v.number] = 1; return acc}, {})) | |
.sort((a,b) => b[1] - a[1]) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Calculer la signature v2 : https://docs.aws.amazon.com/fr_fr/AmazonS3/latest/dev/RESTAuthentication.html | |
// hmac doc : https://nodejs.org/api/crypto.html#crypto_class_hmac | |
// http doc : https://nodejs.org/api/http.html#http_http_request_options_callback | |
const http = require("http") | |
const crypto = require('crypto'); | |
const access = '<change_me>' | |
const secret = '<change_me>' | |
const date = new Date().toUTCString() |