3667 shaares
385 results
tagged
dev
Je ne m'en souviens jamais...
du -sh -- * | sort -h
du -sh -- * | sort -h
Extrait:
"""
Caffeinate can prevent sleep for a certain length of time, measured in seconds. The following command prevents the Mac from sleeping for one hour - 60 x 60 seconds.
caffeinate -t 3600
Here is a command that prevents anything from sleeping for one hour:
caffeinate -dismu -t 3600
d = Prevent the display from sleeping
i = Prevent the system from idle sleeping
s = Prevent the system from sleeping on mains power
m = Prevent hard disks from sleeping
u = Says the user is active
"""
"""
Caffeinate can prevent sleep for a certain length of time, measured in seconds. The following command prevents the Mac from sleeping for one hour - 60 x 60 seconds.
caffeinate -t 3600
Here is a command that prevents anything from sleeping for one hour:
caffeinate -dismu -t 3600
d = Prevent the display from sleeping
i = Prevent the system from idle sleeping
s = Prevent the system from sleeping on mains power
m = Prevent hard disks from sleeping
u = Says the user is active
"""
Feuille très intéressante.
Snippets (bouts de code) en PHP.
À étudier plus tard...
-force_key_frames
-force_key_frames
Comment inverser des lignes sous vim ?
:g/^/m0
: start command-line mode.
g means you'll take an action on any lines where a regular expression matches
/ begins the regular expression (could have used any valid delimiter)
^ matches the start of a line (which matches all lines in the buffer)
the second / ends the regular expression; the rest is an Ex command to execute on all matched lines (i.e. all lines in buffer)
m means move (:help :move)
0 is the destination line (beginning of buffer)
:g/^/m0
: start command-line mode.
g means you'll take an action on any lines where a regular expression matches
/ begins the regular expression (could have used any valid delimiter)
^ matches the start of a line (which matches all lines in the buffer)
the second / ends the regular expression; the rest is an Ex command to execute on all matched lines (i.e. all lines in buffer)
m means move (:help :move)
0 is the destination line (beginning of buffer)
PB "lftp Erreur fatale: Certificate verification: Not trusted"
---------- ---------- ---------- ---------- ---------- ----------
SOLUTION 1) no certificate check
---------- ---------- ---------- ---------- ---------- ----------
echo "set ssl:verify-certificate no" >> ~/.lftp/rc
will solve the problem if you dont want the certificate to be checked
SOLUTION 2) The secure solution with certificate is
---------- ---------- ---------- ---------- ---------- ----------
What worked for me step by step with lftp:
get certificate of host with openssl s_client -connect <ftp_hostname>:21 -starttls ftp, at the begining of result I got something like -----BEGIN CERTIFICATE-----
MIIEQzCCAyu.....XjMO
-----END CERTIFICATE-----
copy that -----BEGIN CERTIFICATE-----
MIIEQzCCAyu.....XjMO
-----END CERTIFICATE----- into /etc/ssl/certs/ca-certificates.crt
Into lftp configuration reference this certificate file adding to /etc/lftp.conf for systemwide set ssl:ca-file "/etc/ssl/certs/ca-certificates.crt"
and then do your sync or whatever with lftp, on my case it is lftp -u "${FTP_USER},${FTP_PWD}" ${FTP_HOST} -e "set net:timeout 10;mirror ${EXCLUDES} -R ${LOCAL_SOURCE_PATH} ${REMOTE_DEST_PATH} ; quit"
---------- ---------- ---------- ---------- ---------- ----------
SOLUTION 1) no certificate check
---------- ---------- ---------- ---------- ---------- ----------
echo "set ssl:verify-certificate no" >> ~/.lftp/rc
will solve the problem if you dont want the certificate to be checked
SOLUTION 2) The secure solution with certificate is
---------- ---------- ---------- ---------- ---------- ----------
What worked for me step by step with lftp:
get certificate of host with openssl s_client -connect <ftp_hostname>:21 -starttls ftp, at the begining of result I got something like -----BEGIN CERTIFICATE-----
MIIEQzCCAyu.....XjMO
-----END CERTIFICATE-----
copy that -----BEGIN CERTIFICATE-----
MIIEQzCCAyu.....XjMO
-----END CERTIFICATE----- into /etc/ssl/certs/ca-certificates.crt
Into lftp configuration reference this certificate file adding to /etc/lftp.conf for systemwide set ssl:ca-file "/etc/ssl/certs/ca-certificates.crt"
and then do your sync or whatever with lftp, on my case it is lftp -u "${FTP_USER},${FTP_PWD}" ${FTP_HOST} -e "set net:timeout 10;mirror ${EXCLUDES} -R ${LOCAL_SOURCE_PATH} ${REMOTE_DEST_PATH} ; quit"
*PB*
Après réinstallation de VIM (version 8) sur un PC Windows (PRO), à chaque ouverture de fichier, VIM me faisait un :
set textwidth=78
malgré un
set textwidth=0
dans mon "_gvimrc"
*Solution*
Faire un
verbose set tw?
Qui permet de savoir dans quel fichier et à quelle ligne l'écriture de cette valeur s'est effectuée.
Pour moi c'était un
autocmd FileType text setlocal textwidth=78
dans un fichier _vimrc dans le répertoire d'install de VIM. Grrr !
J'ai donc rajouter un :
autocmd FileType text setlocal textwidth=0
dans mon _gvimrc.
*Conclusion*
- VIM est toujours parfait (ou presque)
- Merci Internet (encore) pour cette solution
Si cela peut aider...
Après réinstallation de VIM (version 8) sur un PC Windows (PRO), à chaque ouverture de fichier, VIM me faisait un :
set textwidth=78
malgré un
set textwidth=0
dans mon "_gvimrc"
*Solution*
Faire un
verbose set tw?
Qui permet de savoir dans quel fichier et à quelle ligne l'écriture de cette valeur s'est effectuée.
Pour moi c'était un
autocmd FileType text setlocal textwidth=78
dans un fichier _vimrc dans le répertoire d'install de VIM. Grrr !
J'ai donc rajouter un :
autocmd FileType text setlocal textwidth=0
dans mon _gvimrc.
*Conclusion*
- VIM est toujours parfait (ou presque)
- Merci Internet (encore) pour cette solution
Si cela peut aider...
Analyse de flux en direct sur les chaîne TV.
Très intéressant.
Via : https://dukeart.netlib.re/links/?w-8h4g
Très intéressant.
Via : https://dukeart.netlib.re/links/?w-8h4g
Zip de répertoires sans des sous-répertoire en ligne de commande.
$ zip -r myarchive.zip dir1 -x dir1/ignoreDir1/**\* dir1/ignoreDir2/**\*
$ zip -r myarchive.zip dir1 -x dir1/ignoreDir1/**\* dir1/ignoreDir2/**\*
Les verbes dans les exigences ("requirements") sont reliés à la RFC 2119.
Maintenant, je le sais...
"""
1. MUST This word, or the terms "REQUIRED" or "SHALL", mean that the
definition is an absolute requirement of the specification.
2. MUST NOT This phrase, or the phrase "SHALL NOT", mean that the
definition is an absolute prohibition of the specification.
3. SHOULD This word, or the adjective "RECOMMENDED", mean that there
may exist valid reasons in particular circumstances to ignore a
particular item, but the full implications must be understood and
carefully weighed before choosing a different course.
4. SHOULD NOT This phrase, or the phrase "NOT RECOMMENDED" mean that
there may exist valid reasons in particular circumstances when the
particular behavior is acceptable or even useful, but the full
implications should be understood and the case carefully weighed
before implementing any behavior described with this label.
5. MAY This word, or the adjective "OPTIONAL", mean that an item is
truly optional. One vendor may choose to include the item because a
particular marketplace requires it or because the vendor feels that
it enhances the product while another vendor may omit the same item.
An implementation which does not include a particular option MUST be
prepared to interoperate with another implementation which does
include the option, though perhaps with reduced functionality. In the
same vein an implementation which does include a particular option
MUST be prepared to interoperate with another implementation which
does not include the option (except, of course, for the feature the
option provides.)"""
Maintenant, je le sais...
"""
1. MUST This word, or the terms "REQUIRED" or "SHALL", mean that the
definition is an absolute requirement of the specification.
2. MUST NOT This phrase, or the phrase "SHALL NOT", mean that the
definition is an absolute prohibition of the specification.
3. SHOULD This word, or the adjective "RECOMMENDED", mean that there
may exist valid reasons in particular circumstances to ignore a
particular item, but the full implications must be understood and
carefully weighed before choosing a different course.
4. SHOULD NOT This phrase, or the phrase "NOT RECOMMENDED" mean that
there may exist valid reasons in particular circumstances when the
particular behavior is acceptable or even useful, but the full
implications should be understood and the case carefully weighed
before implementing any behavior described with this label.
5. MAY This word, or the adjective "OPTIONAL", mean that an item is
truly optional. One vendor may choose to include the item because a
particular marketplace requires it or because the vendor feels that
it enhances the product while another vendor may omit the same item.
An implementation which does not include a particular option MUST be
prepared to interoperate with another implementation which does
include the option, though perhaps with reduced functionality. In the
same vein an implementation which does include a particular option
MUST be prepared to interoperate with another implementation which
does not include the option (except, of course, for the feature the
option provides.)"""
Différentes méthodes pour calculer les décimales de PI.
Excellent article sur le Blum Blum Shub en génération de nombres pseudo-aléatoires pour la cryptographie.
Le tout avec des exemples en Python.
Le tout avec des exemples en Python.
Site très intéressant permettant de comparer les différents langages informatiques sur le même problème ou bout de code (snippet).
Contient plein de langages (liste non exhaustive) : Python, Rust, Perl, Ruby, Pascal, JS, Java, PHP, C#, C++, D, Fortan...
Voir aussi ici : https://www.programming-idioms.org/about#about-block-language-coverage
Contient plein de langages (liste non exhaustive) : Python, Rust, Perl, Ruby, Pascal, JS, Java, PHP, C#, C++, D, Fortan...
Voir aussi ici : https://www.programming-idioms.org/about#about-block-language-coverage
Script de compilation de ffmpeg avec libaom et libx265 pour av1.
EDIT : Erreur "ERROR: x265 not found using pkg-config"
Je verrai plus tard.
EDIT : Erreur "ERROR: x265 not found using pkg-config"
Je verrai plus tard.
Connaître la taille des flux vidéo + audio en kb.
ffmpeg -i INPUT -c copy -f null -
ffmpeg -i INPUT -c copy -f null -
HTOP permet d'afficher les processus sous forme d'arbre afin de stopper celui le plus niveau accessible.
Très utile pour arrêter les SHELL.
Très utile pour arrêter les SHELL.
Copier des fichiers + répertoires, sans déplacer les fichers de plus de 4Go.
Utile pour copier atomiquement, donc sans lien des uns aux autres, des fichiers vers un disque en FAT32, en respectant les dossiers de manière récursive.
Exemple sous MacOS :
caffeinate rsync -rv --update --max-size=4G /path/in/local/ server:~/project/
Utile pour copier atomiquement, donc sans lien des uns aux autres, des fichiers vers un disque en FAT32, en respectant les dossiers de manière récursive.
Exemple sous MacOS :
caffeinate rsync -rv --update --max-size=4G /path/in/local/ server:~/project/
Pleins d'outils Linux/Unix pour remplacer cat, ls, diff, du, find, grep
via : https://sebsauvage.net/links/?2ObGig
via : https://sebsauvage.net/links/?2ObGig
Screen est un de mes logiciels préférés sous Linux.
C'est extraordinaire.
Mais quand on fait un screen dans un screen, les commandes influent sur le screen de plus haut niveau englobant...
Pour faire un ctrl-A pour un screen à l'intérieur d'un screen, il faut envoyer vraiment un "CTRL-A" en faisant "Ctrl-A" + "A".
C'est extraordinaire.
Mais quand on fait un screen dans un screen, les commandes influent sur le screen de plus haut niveau englobant...
Pour faire un ctrl-A pour un screen à l'intérieur d'un screen, il faut envoyer vraiment un "CTRL-A" en faisant "Ctrl-A" + "A".