Menu

Latest articles

How much time needed to transfer a file
I need to estimate the time required to transfer a file, here below: The file is 1000M and the transfer rate is 100MB/S, Amount to transfer / transfer rate [...]
Git: Recover a deleted file
Hi, To get a deleted file from git (whatever the reason could be), there the command: file="filepath" git checkout $(git rev-list -n 1 HEAD -- "$file")^ -- [...]
Postgresql-Get the number of rows affected
You will find a way below to get the number of rows affected by an UPDATE or a DELETE statement.   CREATE FUNCTION update_foobar(id INT, field1 [...]
Setup sftp server on debian8 (chroot)
Let’s start by: su - groupadd sftp_users usermod -G sftp_users my_usernamesu - groupadd sftp_users usermod -G sftp_users my_username Then: emacs [...]
Interesting link 1
http://www.pathname.com/fhs/pub/fhs-2.3.html https://github.com/gleu/pgstats
iterate over files in directory
To do not forget: FILES=/path/to/* for f in $FILES do filename=${f##*/} echo $filename done More informations: [...]
shell variable to execute a command
To do not forget: => variable=$(my_commands) json_files=$(find . -name "*.json") echo $json_file
SQL – From timestamptz A to timestamptz B
For PostgreSQL (tested on 9.4) CREATE TABLE tests(id serial not null, created_on timestamptz); INSERT INTO tests (created_on) VALUES (now()); 2016-02-16 [...]
shell – code de retour par une commande
Comment lire le code de retour d’une commande comme pwd ? chaque commande executée vous renverra un code d’erreur situé entre 0 et 255. 0 pour [...]
shell – La commande read
La commande read lit l’entrée standard et affecte à la variable passé en paramètre la valeur: ~ read variable_1 foobar ~ echo $variable_1 ~ foobar Si [...]