Author Archives: Saïd

About Saïd

Software developer.

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 VARCHAR(40)) RETURNS INTEGER LANGUAGE plpgsql AS $$ DECLARE — some variables declarations BEGIN — … Continue reading

Posted in General | Leave a comment

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 /etc/ssh/sshd_config   # Search the line below and replace it Subsystem sftp /usr/lib/openssh/sftp-server # by this one Subsystem sftp internal-sftp … Continue reading

Posted in Server, SFTP | Leave a comment

Interesting link 1

http://www.pathname.com/fhs/pub/fhs-2.3.html https://github.com/gleu/pgstats

Posted in General | Leave a comment

Why I chose emberjs

https://www.airpair.com/js/javascript-framework-comparison   Great reading

Posted in Javascript | Leave a comment

iterate over files in directory

To do not forget: FILES=/path/to/* for f in $FILES do filename=${f##*/} echo $filename done More informations: http://www.gnu.org/software/bash/manual/bash.html#Shell-Parameter-Expansion

Posted in Shell | Leave a comment

shell variable to execute a command

To do not forget: => variable=$(my_commands) json_files=$(find . -name “*.json”) echo $json_file

Posted in Shell | Leave a comment

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 19:26:13.823126-05 I guess you have configured your timezone in your postgresql.conf file. I have for information ‘America/Toronto’. SELECT created_on  AT … Continue reading

Posted in Database, SQL | Leave a comment

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 opération réussie, sinon toute autre chiffre signifiera qu’une erreur s’est déroulée lors de l’exécution. … Continue reading

Posted in General | Leave a comment

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 vous voulez que le premier mot soit stocké dans la variable_1 et que le … Continue reading

Posted in Shell, Terminal | Leave a comment

Rien que la vérité sur le développement logiciel en France.

Pourquoi le développement logiciel se porte mal en France

Posted in General | Leave a comment