Thursday, May 19, 2022

Remove credentials from Git

 


Ref: https://stackoverflow.com/questions/15381198/remove-credentials-from-git

If this problem comes on a Windows machine, do the following.

  • Go to Credential Manager

    • in German, it is called: Anmeldeinformationsverwaltung
    • in French, it is called: Gestionnaire d'identification
    • in Polish, it is called: Menedżer poświadczeń
    • in Portuguese, it is called: Gerenciador de Credenciais
    • in Russian, it is called: Диспетчер учётных данных
    • in Spanish, it is called: Administrador de credenciales
  • Go to Windows Credentials

  • Delete the entries under Generic Credentials


  • Try connecting again. This time, it should prompt you for the correct username and password.

Configure your Git username/email

Ref:https://support.atlassian.com/bitbucket-cloud/docs/configure-your-dvcs-username-for-commits/ 

Configure your Git username/email

You typically configure your global username and email address after installing Git. However, you can do so now if you missed that step or want to make changes. After you set your global configuration, repository-specific configuration is optional.

Git configuration works the same across Windows, macOS, and Linux.

To set your global username/email configuration:

  1. Open the command line.

  2. Set your username:
    git config --global user.name "FIRST_NAME LAST_NAME"

  3. Set your email address:
    git config --global user.email "MY_NAME@example.com"

To set repository-specific username/email configuration:

  1. From the command line, change into the repository directory.

  2. Set your username:
    git config user.name "FIRST_NAME LAST_NAME"

  3. Set your email address:
    git config user.email "MY_NAME@example.com"

  4. Verify your configuration by displaying your configuration file:
    cat .git/config

Installing the trusted root certificate

Ref:https://docs.microsoft.com/en-us/skype-sdk/sdn/articles/installing-the-trusted-root-certificate

Adding certificate snap-ins

  1. Launch MMC (mmc.exe).

  2. Choose File > Add/Remove Snap-ins.

  3. Choose Certificates, then choose Add.

  4. Choose My user account.

  5. Choose Add again and this time select Computer Account.

  6. Move the new certificate from the Certificates-Current User > Trusted Root Certification Authorities into Certificates (Local Computer) > Trusted Root Certification Authorities.

Wednesday, May 18, 2022

Install Cygwin (without admin rights)

 

  1. Download setup-x86_64.exe.
  2. Open command line window (WIN+R and type cmd).
  3. Go to the download directory, e. g.:
    cd %USERPROFILE%\Downloads
    
  4. Run setup-x86_64.exe with the --no-admin option:
    setup-x86_64.exe --no-admin

How to Assign a Static IP to a Docker Container

 Ref: https://www.howtogeek.com/devops/how-to-assign-a-static-ip-to-a-docker-container/

Setting Up Static IPs

First, you’ll need to set up a Docker network, and since we care about the IP address, you’ll need to specify a fixed subnet:

docker network create --subnet=172.20.0.0/16 customnetwork

Then, you can run a container, specifying the network with the --net flag, and specifying the IP with the -ip flag:

docker run --net customnetwork --ip 172.20.0.10 -d container



Tuesday, May 17, 2022

Linux shell restricting access and disable shell with nologin


Ref: https://www.cyberciti.biz/tips/howto-linux-shell-restricting-access.html

To block shell access for the user named ‘vivek’. Please note that an account named ‘vivek’ must exist on your system. Run the usermod command or chsh command:
usermod -s /sbin/nologin vivek
Debain or Linux Linux user modify above command as follows:
usermod -s /usr/sbin/nologin vivek


 

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 ...