Install MySQL server with Docker Compose

Posted in IT StuffTagged ,

Inside a new directory, create a data directory and docker-compose.yml with these rows: To start the container, run docker-compose up -d. To stop & remove the container, run docker-compose down. To connect from a MySql client use this:

Warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory

Posted in IT StuffTagged

After a recent Ubuntu update, I get this error. What finally helped was putting to the file /etc/environment: LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 For some reason, it was missing. The outputs for locale and other commands appeared like the variables were properly defined. In other words, don’t take for granted all the basic stuff is declared where….

How to fix a locale setting warning from Perl and/or *nix bash?

Posted in IT StuffTagged ,

Perl is sometime called by a *nix script and, after an update I get recently this warning message (in particular when I run apt or npm command): perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LC_CTYPE = "UTF-8", LANG = "en_US.UTF-8" are supported and….

Find on different collections to create a document using mongoose

Posted in IT StuffTagged , ,

I need to query multiple collections to prepare a MongoDB document and then save it using Mongoose and NodeJS. The solution is to use async.parallel I have two source collections, Robot, Target and the destination collection Activity. For first, async must be added: var async = require(’async’);var async = require(‘async’); then: async.parallel({   robotFind: function(cb)….

How to use Spring DataSource bean as data source for Log4j 2 JDBC appender

Posted in IT StuffTagged , ,

I would like to log log4j2 messages into a relational database using the datasource defined on application context and initialized using spring using log4j 2.10. One possibility is to add a JDBC appender inside log4j2 xml configuration but, Log4j is initialized before Spring so, dataSource won’t be available at runtime so the only solution is….

Warning about SSL connection when connecting to MySQL database

Posted in IT StuffTagged ,

After a recent update of mySql, I get this warning: WARN: Establishing SSL connection without server’s identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn’t set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to….

Convert timestamp long to normal date format

Posted in IT StuffTagged

One simply way to convert a Long time stamp into a formatted string is (time paramter is Long timestamp): Date date = new Date(time); Format format = new SimpleDateFormat("yyyy MM dd HH:mm:ss"); return format.format(date);Date date = new Date(time); Format format = new SimpleDateFormat("yyyy MM dd HH:mm:ss"); return format.format(date); These packages must be included. import java.sql.Date;….

Date based query using milliseconds (Java long) time on MongoDB

Posted in IT StuffTagged

Let’s suppose I need to search all records that match a date condition. On MongoDB I’ve a bunch of data like this: { "_id" : "9ed3b937-0f43-4613-bd58-cb739a8c5bf6", "userModels" : { "5080" : { "generated_date_timestamp" : NumberLong(1413382499442), "model_id" : 5080, }, } "values" : {} }{ "_id" : "9ed3b937-0f43-4613-bd58-cb739a8c5bf6", "userModels" : { "5080" : { "generated_date_timestamp" :….

Industria 4.0

Posted in Financial

Uno degli interrogativi più importanti di tutte le rivoluzioni industriali a cui l’umanità ha assistito è: ’innovazione porta o toglie occupazione? Personalmente ritengo che molto più semplicemente la cambi. Cambiano i profili, cambiano gli skill necessari, cambiano gli scenari in cui queste nuove competenze devono essere applicate, cambiano le problematiche da risolvere. Il lavoratore è….

Gap di competenze per Industria 4.0

Posted in Financial, IT StuffTagged

«Non vedo un rischio di disoccupazione maggiore provocato dalle tecnologie, il saldo non sarà negativo», spiega ancora l’economista Ocse che però vede una minaccia nell’aumento delle diseguaglianze – «sia come stipendi che come prospettive di carriera» – tra chi ha competenze adeguate e chi no: «I lavori intermedi già negli ultimi venti anni sono stati colpiti,….