Wednesday, May 11, 2022

[NODEJS] Covert wiki text to html

 npm install wikity

const wikity = require('wikity');
wikity.parse('[[https://it-in-clouds.blogspot.com/]]');




[Html] What's the correct way to display multi line text?

Ref: https://stackoverflow.com/questions/10937218/how-to-show-multiline-text-in-a-table-cell 

You want to use the CSS white-space:pre applied to the appropriate <td>. To do this to all table cells, for example:

td { white-space:pre }

Alternatively, if you can change your markup, you can use a <pre> tag around your content. By default web browsers use their user-agent stylesheet to apply the same white-space:pre rule to this element.

The PRE element tells visual user agents that the enclosed text is "preformatted". When handling preformatted text, visual user agents:

  • May leave white space intact.
  • May render text with a fixed-pitch font.
  • May disable automatic word wrap.
  • Must not disable bidirectional processing.


Tuesday, May 10, 2022

Package 'mysql-client' has no installation candidate in php-fpm image build using docker compose

Ref: https://stackoverflow.com/questions/57048428/e-package-mysql-client-has-no-installation-candidate-in-php-fpm-image-build-u

 php:7.3-fpm now use Debian 10 (Buster) as its base image and Buster ships with MariaDB, so just replace mysql-client with mariadb-client should fix it.

[Docker] grep versions in BusyBox don't support "grep -oP"

 


Ref: https://github.com/firehol/firehol/issues/325

Working with "grep -E" seems to work. Maybe this could be a workaround.

How to set user and group in Docker Compose

 

How to set user and group in Docker Compose

Ref: https://blog.giovannidemizio.eu/2021/05/24/how-to-set-user-and-group-in-docker-compose/

version: '3' services: app: image: alpine user: "${UID}:${GID}"

Docker not found when building docker image using Docker Jenkins container pipeline

 


Ref: https://localcoder.org/docker-not-found-when-building-docker-image-using-docker-jenkins-container-pipel

Solution 5:

docker run -d \
--group-add docker \
-v $(pwd)/jenkins_home:/var/jenkins_home \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(which docker):/usr/bin/docker \
-p 8080:8080 -p 50000:50000 \
jenkins/jenkins:lts

Just add option --group-add docker when docker run.


Install and use xorg-server on macOS via Homebrew

  The instructions to install and use xorg-server on macOS via Homebrew: Install Homebrew (if you haven't already): /bin/bash -c ...