3 liens privés
Reduce mp4 size
ffmpeg -i input.mp4 -vcodec h264 -acodec mp3 output.mp4
Extract mp3
ffmpeg -i input.mp4 -vn -ar 44100 -ac 2 -ab 192 -f mp3 output.mp3
Ansible list inventory
ansible all -u root -i hosts.yml -m setup
Via geek (merci Ludovic !). Audit sécurité automatisé.
wget -O - https://packages.cisofy.com/keys/cisofy-software-public.key | sudo apt-key add -
sudo apt-get install lynis -y
sudo lynis audit system
Some RPG books
Liste de films pour "hackers" :)
Save opendns stats
Speak of GC
To read
Redirect all except let's encrypt directory
RedirectMatch Permanent "^(/(?!\.well-known/).*)" https://example.net/$1
Réduire l'usage du swap
cat /proc/sys/vm/swappiness
#/etc/sysctl.conf
vm.swappiness = 10
swapoff -a
swapon -a
sysctl vm.swappiness
10
sysctl vm.swappiness=10
sysctl -w vm.swappiness=10
Windows UBS bootable depuis linux
gparted
format all in fat32
activate flag boot, esp (pour uefi)
copie de l'iso
sudo dd bs=4M if=path/to/input.iso of=/dev/sd<?> conv=fdatasync status=progress
ou unetbootin |sur debian](https://wiki.debian-fr.xyz/Unetbootin)
# wget https://github.com/unetbootin/unetbootin/releases/download/655/unetbootin-linux64-655.bin
# mv unetbootin-linux64-655.bin /usr/local/bin/unetbootin
# chmod +x /usr/local/bin/unetbootin
Entre les barrières de bulles et Ocean's cleanup, on devrait bien réussi à faire quelque chose pour commencer à réparer nos bêtises !
Reste à apprendre et ne pas refaire les mêmes....
C'est pas près d'arriver ici... mais déjà ça arrive ailleurs !
Apres upgrade de debian d'un vieux serveur, le fail2ban ne marchait plus :
update-alternatives --set iptables /usr/sbin/iptables-legacy
#suppression de imap3 des filter fail2ban
Rôle ansible pour gérer son serveur openvpn.
Génération des clés :
/etc/openvpn/build-client.sh
Génération de password
htpasswd -d /etc/openvpn/users <user>
Résumé des commandes
netsh wlan show profile NOM_DU_RESEAU_WIFI key=clear
security find-generic-password -wa NOM_DU_RESEAU_WIFI
sudo cat /etc/NetworkManager/system-connections/NOM_DU_RESEAU_WIFI | grep psk=
Ressource complète sur les index dans les bases de données
Export des data Appdynamics format US dans un fichier Excel FR
# Sélectionner tous les champs de type : 123,456
(.*),"([^",]+),([^"]+)",(.*)$
# Les remplacer par : 123456
\1,"\2\3",\4
Curl shortcut to display time :
curl -w '\nsize_download=%{size_download}\nsize_header=%{size_header}\nsize_request=%{size_request}\nsize_upload=%{size_upload}\nspeed_download=%{speed_download}\nspeed_upload=%{speed_upload}\nssl_verify_result=%{ssl_verify_result}\n\ntime_namelookup=%{time_namelookup}\ntime_connect=%{time_connect}\ntime_appconnect=%{time_appconnect}\ntime_pretransfer=%{time_pretransfer}\ntime_redirect=%{time_redirect}\ntime_starttransfer=%{time_starttransfer}\ntime_total=%{time_total}\nurl_effective=%{url_effective}\n\n' -o /dev/null -s <URL>
Avec l'explication du blog :
Variable | Description |
---|---|
content_type | The Content-Type of the requested document, if there was any. |
filename_effective | The ultimate filename that curl writes out to. This is only meaningful if curl is told to write to a file with the --remote-name or --output option. It's most useful in combination with the --remote-header-name option. |
ftp_entry_path | The initial path curl ended up in when logging on to the remote FTP server. |
http_code | The numerical response code that was found in the last retrieved HTTP(S) or FTP(s) transfer. In 7.18.2 the alias response_code was added to show the same info. |
http_connect | The numerical code that was found in the last response (from a proxy) to a curl CONNECT request. |
local_ip | The IP address of the local end of the most recently done connection - can be either IPv4 or IPv6. |
local_port | The local port number of the most recently done connection. |
num_connects | Number of new connects made in the recent transfer. |
num_redirects | Number of redirects that were followed in the request. |
redirect_url | When an HTTP request was made without -L to follow redirects, this variable will show the actual URL a redirect would take you to. |
remote_ip | The remote IP address of the most recently done connection - can be either IPv4 or IPv6. |
remote_port | The remote port number of the most recently done connection. |
size_download | The total amount of bytes that were downloaded. |
size_header | The total amount of bytes of the downloaded headers. |
size_request | The total amount of bytes that were sent in the HTTP request. |
size_upload | The total amount of bytes that were uploaded. |
speed_download | The average download speed that curl measured for the complete download. Bytes per second. |
speed_upload | The average upload speed that curl measured for the complete upload. Bytes per second. |
ssl_verify_result | The result of the SSL peer certificate verification that was requested. 0 means the verification was successful. |
time_appconnect | The time, in seconds, it took from the start until the SSL/SSH/etc connect/handshake to the remote host was completed. |
time_connect | The time, in seconds, it took from the start until the TCP connect to the remote host (or proxy) was completed. |
time_namelookup | The time, in seconds, it took from the start until the name resolving was completed. |
time_pretransfer | The time, in seconds, it took from the start until the file transfer was just about to begin. This includes all pre-transfer commands and negotiations that are specific to the particular protocol(s) involved. |
time_redirect | The time, in seconds, it took for all redirection steps include name lookup, connect, pretransfer and transfer before the final transaction was started. time_redirect shows the complete execution time for multiple redirections. |
time_starttransfer | The time, in seconds, it took from the start until the first byte was just about to be transferred. This includes time_pretransfer and also the time the server needed to calculate the result. |
time_total | The total time, in seconds, that the full operation lasted. The time will be displayed with millisecond resolution. |
url_effective | The URL that was fetched last. This is most meaningful if you've told curl to follow location: headers. |
Note pour les images sur site mobile :
max-width: 100%; // pour ne pas dépasser la taille réelle de l'image
height:auto; // pour le redimensionnement si width ne marche pas
width: 100vw // 100% du viewport. Ne pas confondre avec 100% qui ne marche pas forcément bien
Pour avoir la taille du viewport (et non pas de l'écran) :
<script>alert(Math.max(document.documentElement.clientWidth, window.innerWidth || 0));</script>