/images/avatar.png

Changing system drive and resize partition

Changing system drive and resize partition Run lsblk to see our drives: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT loop0 7:0 0 28G 0 loop loop1 7:1 0 800G 0 loop loop2 7:2 0 170G 0 loop sda 8:0 0 1,8T 0 disk sdb 8:16 0 447,1G 0 disk └─sdb1 8:17 0 447,1G 0 part └─md0 9:0 0 447G 0 raid1 /mnt/pve/ssdraid sdc 8:32 0 931,5G 0 disk └─sdc1 8:33 0 931,5G 0 part /mnt/pve/single_backup sdd 8:48 0 447,1G 0 disk └─sdd1 8:49 0 447,1G 0 part └─md0 9:0 0 447G 0 raid1 /mnt/pve/ssdraid sde 8:64 0 931,5G 0 disk ├─sde1 8:65 0 243M 0 part /boot ├─sde2 8:66 0 1K 0 part └─sde5 8:69 0 931,3G 0 part ├─iron--vg-root 253:0 0 907,3G 0 lvm / └─iron--vg-swap_1 253:1 0 24G 0 lvm [SWAP] zram0 252:0 0 2G 0 disk [SWAP] /dev/sde is our system drive /dev/sda is our new drive (I bought 2TB drive) Let’s copy with dd all of data from /dev/sde to /dev/sda.

Generate yaml from xml and xml from yaml

First off we should get schema for out pom.xml. It is on the head of pom.xml: 1 2 3 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> Get it: 1 wget http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd Secondly, we need to install xml2yaml: Debian, Ubuntu, Kali Linux, Raspbian: 1 2 3 apt-get install libxml-compile-perl xml2yaml help ERROR: no schema's specified Next, there are exmaples of commands: 1 2 3 4 xml2yaml xml-file schema-file(s) >yaml-file xml2yaml -x xml-file -s schema-files -o yaml-file # for our cas `maven-4.

Golang hugo

Install 1 2 3 4 5 6 wget https://github.com/gohugoio/hugo/releases/download/v0.110.0/hugo_0.110.0_Linux-64bit.tar.gz -O /tmp/hugo_0.110.0_Linux-64bit.tar.gz tar -zxf /tmp/hugo_0.110.0_Linux-64bit.tar.gz -C /tmp/ sudo mkdir /usr/local/gohugo sudo install /tmp/hugo /usr/local/gohugo export PATH=$PATH:/usr/local/gohugo hugo --help Put it into ~/.zshrc 1 2 3 # https://gohugo.io/commands/hugo_completion_zsh/ export PATH=$PATH:/usr/local/gohugo autoload -U compinit; compinit Quick Start Create article 1 hugo new posts/go-hugo.md Template: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 --- author: "Sergey Chulanov" title: "Golang hugo" date: 2023-02-07T22:56:35+03:00 description: >- Hugo static on golang tags: - hugo categories: - linux series: - guide draft: false --- > **Tested on:** Ubuntu 22.

Java(war) + tomcat + nexus

Quick start with Spring Boot here Wep app (war): 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 # Install maven and export bin export PATH=$PATH:/opt/maven/apache-maven-3.8.7/bin MAVEN_APP_TYPE=maven-archetype-webapp \ && APP_GROUP=app.awesome.my \ && APP_NAME=myawesomeapp mvn archetype:generate \ -DgroupId="${APP_GROUP}" \ -DartifactId="${APP_NAME}" \ -DarchetypeArtifactId="${MAVEN_APP_TYPE}" \ -DarchetypeVersion=1.4 \ -DinteractiveMode=false cd "${APP_NAME}" sed -i "s/World/from ${APP_NAME}/g" src/main/webapp/index.

Update Alternatives

| Ubuntu 22.04 | update-alternatives Используйте приведённую команду, для просмотра всех вариантов update-alternatives 1 2 3 4 5 6 update-alternatives --get-selections awk auto /usr/bin/mawk builtins.7.gz auto /usr/share/man/man7/bash-builtins.7.gz pager auto /bin/more rmt auto /usr/sbin/rmt-tar which auto /usr/bin/which.debianutils update-alternatives на примере clang. При установке на данный момент устанавливается 14 версия по-умолчанию: 1 2 $ clang -v 2>&1 | head -1 Ubuntu clang version 14.0.0-1ubuntu1 Допустим, понадобилась версия 13, установим её в систему:

Задание умолчаний, для установки deb-пакета

Задание умолчаний, для установки deb-пакета: debconf-get-selections - Команда выводит содержимое базы данных debconf debconf-set-selections - Команда может быть использована для автоматической настройки ответов из базы данных debconf или для изменения имеющихся ответов. debconf-communicate - Команда позволяет обращаться к debconf из командной строки. debconf-show - Команда позволяет выполнить запрос к базе данных debconf различными способами. Подготовка: 1 2 apt update -y apt install debconf-utils Установим целевой пакет и ответим на вопросы. При установке видно, что выбираем для пакета tzdata: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 apt install libgtk-3-0 Configuring tzdata ------------------ Please select the geographic area in which you live.