2019/06/26

How to generate date and time log in Windows batch script


for /f "skip=1 delims=" %%z in ('wmic os get localdatetime') do if not defined Z set Z=%%z
set DATE=%Z:~0,4%-%Z:~4,2%-%Z:~6,2%
set TIME=%Z:~8,2%-%Z:~10,2%-%Z:~12,2%
set timestamp=%DATE%_%TIME%.log

or

set timestamp=%DATE:/=-%@%TIME::=-%
set timestamp=%timestamp: =%
set timestamp=%timestamp:,=.%.log

or

set timestamp=%date:~0,4%%date:~5,2%%date:~8,2%@%TIME:~0,2%-%TIME:~3,2%-%TIME:~6,2%
set timestamp=%timestamp:,=.%.log

2019/06/14

How to install SonarQube 7.x on Ubuntu 18.04

Install required package
apt update && sudo apt upgrade -y
apt install -y unzip curl openjdk-8-jdk-headless mysql-server

Create Database
mysql -uroot -p
CREATE DATABASE sonarqube;
CREATE USER sonarqube@'localhost' IDENTIFIED BY 'sonarqube';
GRANT ALL ON sonarqube.* to sonarqube@'localhost';
FLUSH PRIVILEGES;
\q