Showing posts with label devops. Show all posts
Showing posts with label devops. Show all posts

Monday, November 27, 2023

[DevOps] Hint for running portainer under podman


Officially the Portainer is supports only docker, but on some systems we can use only Podman (RHEL systems), with this is hint you can run portainer under podman:

systemctl enable podman
systemctl start podman

#You will need to enable linger for this user in order for the socket to work when the user is not logged in.
loginctl enable-linger $USER

docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /run/podman/podman.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest

Friday, June 2, 2023

[DevOps] Debug MongoDB pipelines

Sometime, MongoDB server is crash when tried to run some pipelines (aggregations). The main problem – it's happens without logs and hardly to detect it and debug. 

For debugging, you can use this command in MongoDB client for getting latest logs before crash and for detecting what aggregation is evoking error.

db.adminCommand( { getLog:"global" })

This command requires some additional admin permissions for getting logs and not available for regular users

[DevOps] Remove all docker logs

Sometimes are needs to remove logs for all containers, for example, when you not have enough disk space

sudo sh -c "truncate -s 0 /var/lib/docker/containers/*/*-json.log"

Sunday, May 15, 2022

[DevOps][Note] How enable ssh authentication without password on Fedora


cd ~/.ssh

 Should be <fileName>.pub and <fileName> (private key) 

ssh-copy-id -f -i <filename>.pub <username>@<host>

Based on:

  1. link 1
  2. link 2

Saturday, January 22, 2022

[Mac] brew using on M1

— How to use brew on Mac with M1 processor?
— Just add arch -x86_64 before brew command.

For example, the final result will be:  arch -x86_64 brew upgrade

Saturday, September 18, 2021

[DevOps] Small tricks for debugging docker images

Sometimes you are needed to be got what of consists of in the docker image. So you can convert this is an image to archive and unpack this is an archive to a file system.

For understanding
docker build --tag site:latest .

docker tag site:latest _name/site:latest

docker push _name/site:latest

# This is keyvalues strings

docker run -d -p 3000:3000 --name container_name site:latest

docker export container_name > contents.tar

[DevOps] How detect version of CentOS

Just run it:

cat /etc/centos-release

Sunday, October 18, 2020

Saturday, October 17, 2020

[DevOps] NodeJS installation script for hot update

Hello, this is script is needed for the hot switch versions of Node.js on machine. You can have two installed different versions of Node.js. For example, it can be v12 and v14.

So is possible to switch on a different version using only one command. Currently, I work only on Linux based (and macOS as a client system) systems and code will be targeted on these systems

# Install Node.js 14.2.0
sudo su
yum install -y git
curl | bash
source ~/.bashrc
nvm install v14.13.0
# Relevant for some OSes
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/" ] && . "$NVM_DIR/" # This loads nvm
For getting a list of all installed nodes, you can use
nvm ls #list all nodes
nvm use <version># switch to specific version
  1. More information you can get on official repo
  2. Or on another site (first link in google)