DNS
Les DNS de FDN :
80.67.169.12
80.67.188.188
Les DNS de FDN :
80.67.169.12
80.67.188.188
Redirects a youtube page to an invidio.us one. Copy and paste this into the url field of a browser bookmark.
javascript:(window.location.href.includes("www.youtube"))?location.href=window.location.href.replace("www.youtube.com","www.invidio.us"):console.log('not a youtube page')
function isAnyClassOutThere(class,tag){
// On transforme le string passé en paramètre en une expression régulière
//(sans cela, test() ne retournera rien)
var regExpClass = new RegExp(class);
// S'il n'y avait pas de tag passé en paramètre, on considère que l'on regarde
// tous les tags
var tag = tag || "all";
var elm = (tag == "all") ? document.all : document.getElementsByTagName(tag);
var result = false;
// Pour chaque élément que l'on a récupéré dans elm
for(var i=0; i < elm.length; i++){
// On test la correspondance
if(regExpClass.test(elm[i].className)){
result = true;
// On sort de la boucle (pas très joli, mais évite de faire un return
// dans une boucle)
i+=elm.length;
}
}
return result;
}
function loadJS(url){
// On crée un élément script
var elm=document.createElement("script");
// On lui attribue une url
elm.setAttribute("src", url);
// On renseigne le type
elm.setAttribute("type", "text/javascript");
// Enfin, on l'ajoute en temps qu'enfant de l'élément head
document.getElementsByTagName("head")[0].appendChild(elm);
}
window.onload=function(){
if(isAnyClassOutThere("galerie", "ul")){
loadJS("http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js");
loadJS("./gallery.js");
}
}
function filtre($string) {
$search = array ('@(é|è|ê|ë|Ê|Ë)@','@(á|ã|à|â|ä|Â|Ä)@i','@(ì|í|i|i|î|ï|Î|Ï)@i','@(ú|û|ù|ü|Û|Ü)@i','@(ò|ó|õ|ô|ö|Ô|Ö)@i','@(ñ|Ñ)@i','@(ý|ÿ|Ý)@i','@(ç)@i','@( )@i','@(^a-zA-Z0-9_)@', '@(\'|\.)@');
$replace = array ('e','a','i','u','o', 'n', 'y', 'c','-','', '');
$in = preg_replace($search, $replace, $string);
$in = preg_replace('/([^.a-z0-9]+)/i', '-', $string);
return strtolower($string);
}
#!/bin/bash
# Enable/Disable touchpad
# $device is found by using "xinput list"
device=13
property=132
mode="$(xinput --list-props $device | grep $property | cut -d':' -f2)"
if [ $mode -eq "1" ]
then
xinput --set-prop $device $property 0
else
xinput --set-prop $device $property 1
fi
Appuyer 3 fois sur Entrée
mènera au lien d'administration :
function keyboardAuth(redirection) {
var enterCount = 0;
//$(document).keypress(function(event){
document.addEventListener("keypress", function(event) {
var keycode = (event.keyCode ? event.keyCode : event.which);
if(keycode == '13'){
enterCount++;
if(enterCount >= 3){
enterCount = 0;
window.location = redirection;
}
setTimeout(function(){ enterCount = 0; },2000);
}
});
}
$('a[href*=#]').on('click', function(event){
event.preventDefault();
$('html,body').animate({scrollTop:$(this.hash).offset().top}, 700); });
<div class="relative">
<div class="toTop">
<a href="#top" title="Retour en haut">
Retour en haut
</a>
</div>
</div>
<footer id="footer">
…
</footer>
.relative {
position:relative;
}
.toTop {
display:none;
position:fixed;
right:20px;
bottom:20px;
z-index:1000;
}
function toTop(element,footer){
var scroll = $(window).scrollTop();
var maxScroll = $(window).height() * 0.4;
if(scroll > maxScroll)
$(element).show();
else
$(element).hide();
if($(element).offset().top + $(element).height() >= $(footer).offset().top - 10)
$(element).css('position', 'absolute');
if($(document).scrollTop() + window.innerHeight < $(footer).offset().top)
$(element).css('position', 'fixed');
}
$(window).scroll(function() {
toTop('.toTop',"#footer");
});
$(window).resize(function() {
toTop('.toTop',"#footer");
});
/*
* Adds a parallax effect to a background image
* (position:fixed;no-repeat;background-size:42%;)
*
* element : the element with a background image
* percent : percent of the background-size (0.42)
* height : height of the background image
* width : width of the background image
* factor : factor of speed (the lower the faster)
* reference : the element bottom-placed to get the total
* height of the page
*
* author : Guillaume Litaudon <guillaume.litaudon@gmail.com>
*/
function parallax(element,percent,height,width,factor,reference){
var winWidth = $(window).width();
var winHeight = $(window).height();
var sizePercent = percent == 1 ? height : ((winWidth*percent)/width)*height;
var maxScroll = -(sizePercent - winHeight);
var speed = factor*($(reference).offset().top / winHeight);
var yPos = -($(window).scrollTop() / speed);
yPos = yPos >= 0 ? 0 : yPos;
yPos = yPos >= maxScroll ? yPos : maxScroll;
var coords = '0 '+ yPos + 'px';
$(element).css({ backgroundPosition: coords });
}
function goGoParallaxEffect(){
/* La taille dépend de si l'on est en-dessous
* de pictureWidth ou non
*/
var pictureHeight = 1080;
var pictureWidth = 388;
if($(window).width() > pictureWidth)
parallax('#page',0.42,pictureWidth,pictureHeight,5,footer);
else
parallax('#page',1,pictureWidth,pictureHeight,5,footer);
}
$(window).scroll(function() {
goGoParallaxEffect();
});
$(window).resize(function() {
goGoParallaxEffect();
});
Après plusieurs tests, il apparait que la meilleure ligne de commande sur mon système soit :
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libGL.so.1 __GL_SYNC_TO_VBLANK=0 vblank_mode=0 PRIMUS_SYNC=1 primusrun %command%
## Alternative plus simple
env vblank_mode=0 __GL_SYNC_TO_VBLANK=0 VGL_READBACK=pbo optirun %command%
Pour GZDoom :
## 100+ fps but use Intel
vblank_mode=0 ENABLE_PRIMUS_LAYER=1 optirun -b primus gzdoom
## 75+ fps with Nvidia
vblank_mode=0 ENABLE_PRIMUS_LAYER=1 VGL_READBACK=pbo __GL_SYNC_TO_VBLANK=0 primusrun gzdoom
## Or simply
vblank_mode=0 primusrun gzdoom
Utiliser ceci comme options de lancement des jeux :
PROTON_NO_ESYNC=1 PROTON_USE_WINED3D=1 env vblank_mode=0 __GL_SYNC_TO_VBLANK=0 VGL_READBACK=pbo optirun %command%
php -f occ db:add-missing-indices
Faire une tâche cron pour actualiser la liste des périphériques qui se connectent :
1@hourly 0 nextcloud php -f /srv/data/web/vhosts/my-vhost/htdocs/cron.php > /tmp/nextcloud.log 2>&1
1@hourly 0 freshrss php -f /srv/data/web/vhosts/my-vhost/htdocs/rss/app/actualize_script.php > /tmp/nextcloud.log 2>&1
https://freshrss.github.io/FreshRSS/fr/users/03_Main_view.html#rafraichir-les-flux
On convertit avec iconv
(et détection automatique de l'encoding avec uchardet
), car certains sous-titres sont en utf16. Puis on supprime les retour chariot Windows qui empêchent de faire quoi que ce soit. On supprime alors les lignes commençant par un newline. On rajoute un newline aux lignes ne comportant que l'index. Enfin, on supprime la première ligne (qui alors ne contient qu'un newline).
for file in *.srt; do cp "$file" "$file.bak"; encoding=$(uchardet "$file"); iconv -f $encoding -t utf8 "$file" -o "$file.utf8"; tr -d '\r' < "$file.utf8" | sed '/^$/d' | sed 's/^\([[:digit:]]\+\)$/\n\1/gm' | tail -n +2 > "$file"; rm "$file.utf8"; done
php -f updater/updater.phar
lib/versioncheck.php
pour bypass PHP > 7.3./occ update
ou php -f occ update
./occ maintenance:mode --off
ou php -f occ maintenance:mode --off
mplayer -dumpstream dvdnav://1 -nocache -dumpfile my-duper-dvd.mpg
fdupes
fdupes /home/chris fdupes -r /home/chris # Recursive fdupes -d /home/chris # Delete the duplicates (interactive)
ffmpeg -i "concat:1.mp3|2.mp3|3.mp3|4.mp3|5.mp3|6.mp3|7.mp3|8.mp3|9.mp3|10.mp3|11.mp3|12.mp3|13.mp3|14.mp3|15.mp3|16.mp3|17.mp3|18.mp3|19.mp3|20.mp3" -codec copy test.mp3
\noindent
suppresses paragraph indentation when used at the beginning of a paragraph.
Also, you can always group things within a{}
so that any settings within their are not in effect after the group.
\noindent
This is my paragraph 2 but is not indented since it was started with noindent. Blah blah blah.
This is my paragraph 3 and is indented. Blah blah blah.
{\setlength{\parindent}{0cm}
This is my paragraph 4 but is not indented since parindent was set to 0 within this group. Blah blah blah.
}
gpg2 --expert --full-gen-key
gpg2 --expert --edit-key 1A8132B1
gpg> addkey
gpg2 --output 1A8132B1.rev --gen-revoke 1A8132B1
gpg2 --export --armor 1A8132B1 > 1A8132B1.pub.asc
gpg2 --export-secret-keys --armor 1A8132B1 > 1A8132B1.priv.asc
gpg2 --export-secret-subkeys --armor 1A8132B1 > 1A8132B1.sub_priv.asc
gpg2 --delete-secret-key 1A8132B1
gpg2 --import 1A8132B1.sub_priv.asc # Uniquement les sous-clés
~/.gnupg/gpg.conf
:
keyserver hkps://hkps.pool.sks-keyservers.net
keyserver-options ca-cert-file=/chemin/vers/CA/sks-keyservers.netCA.pem
keyserver-options no-honor-keyserver-url
dans ~/.gnupg/gpg.conf
.sudo apt-get install parcimonie
gpg --with-fingerprint <keyfile>