Daily Shaarli

All links of one day in a single page.

January 23, 2022

Reverse order of lines | Vim Tips Wiki | Fandom
thumbnail

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)
How to avoid lftp Certificate verification error? - Server Fault
thumbnail

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"