Skip to main content

Primary links

  • Home
  • AI
  • Kubernetes
  • Incus
  • Ansible
  • Terraform
  • OpenStack
  • Virtualization
  • Linux
  • SmartHome
  • HowTo

Misc

  • Linux
  • Hardware
  • Programming
  • Databases
  • Multimedia
  • Windows

Cloud

  • OpenStack
  • cloud-config
  • nextcloud

Virtualization

  • Virtualization
  • Incus
  • Docker
  • KVM
  • Kubernetes
  • LXC
  • LXD
  • QEMU
  • VMware
  • VirtualBox
  • multipass
  • podman
  • vagrant
  • XEN

Network

  • DNS
  • Firewall
  • Linux
  • OpenvSwitch
  • SSL
  • VLAN
  • VPN
  • iPXE
  • namespaces
  • nmcli
  • tcpdump

Storage

  • CEPH
  • DRBD
  • LVM
  • S3
  • ZFS
  • btrfs

Automation / CI/CD

  • Install
  • Ansible
  • GitLab
  • LLM
  • Preseed
  • Puppet
  • Terraform
  • Ubuntu autoinstall

Monitoring / Visualisation

  • Grafana
  • Icinga
  • Prometheus
  • Monitoring
  • ELK
  • mermaid

OpenStack: submit changes to OpenDev with Gerrit

sudo apt-get install git-review

git clone https://opendev.org/openstack/diskimage-builder.git
# add changes
git config --global gitreview.username panticz
git review -s
checkout -b patch_x
git commit -a
git review

Links
https://docs.opendev.org/opendev/infra-manual/latest/gettingstarted.html

Docker container: Gitea

Docker container on DockerHub
https://hub.docker.com/r/gitea/gitea

Docker installation
https://docs.gitea.io/en-us/install-with-docker/

apt -y install docker-compose

# Add second ip to hypervisor
ip a add 192.168.1.3 dev eth0:1

# Bound SSHD on hypervisor to specific IP
sed -i 's/#ListenAddress 0.0.0.0/ListenAddress 10.0.1.3/' /etc/ssh/sshd_config
service ssh restart

# OPTIONAL: create ZFS pool
zfs create -o mountpoint=/media/docker tank/docker

# create required directories
mkdir -p /media/docker/gitea/mysql /media/docker/gitea/data

cat < /media/docker/gitea/docker-compose.yml
version: "2"

networks:
  gitea:
    external: false

services:
  web:
    image: gitea/gitea:latest
    environment:
      - USER_UID=1000
      - USER_GID=1000
      - DB_TYPE=mysql
      - DB_HOST=db:3306
      - DB_NAME=gitea
      - DB_USER=gitea
      - DB_PASSWD=gitea
    restart: always
    networks:
      - gitea
    volumes:
      - /media/docker/gitea/data:/data
    ports:
       - 192.168.1.3:80:3000
       - 192.168.1.3:22:22
    depends_on:
      - db

  db:
    image: mariadb:latest
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=gitea
      - MYSQL_USER=gitea
      - MYSQL_PASSWORD=gitea
      - MYSQL_DATABASE=gitea
    networks:
      - gitea
    volumes:
      - /media/docker/gitea/mysql:/var/lib/mysql
EOF

# deploy container
cd /media/docker/gitea
docker-compose up -d

Post-install
http://GITEA_IP/install

Debug

Gitea

Install as Docker container
http://www.panticz.de/docker/container/gitea

APT packages
https://gitlab.com/packaging/gitea

Download archive
https://dl.gitea.io/gitea/

Migrate from gogs
https://docs.gitea.io/en-us/upgrade-from-gogs/

Backup
https://docs.gitea.io/en-us/backup-and-restore/

Install gitea on Kubernetes
https://docs.gitea.com/installation/install-on-kubernetes

helm repo add gitea-charts https://dl.gitea.com/charts/
helm install gitea gitea-charts/gitea

Links
https://gitea.io/

GitLab runner

Install
https://packages.gitlab.com/app/runner/gitlab-runner/gpg
https://packages.gitlab.com/runner/gitlab-runner/install

curl -s https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash
sudo apt install gitlab-runner

List / delete gitlab-runner

# List GitLab runner configuration
gitlab-runner list

# Delete all GitLab runner
gitlab-runner unregister --all-runners

Instlal with Ansible
https://github.com/panticz/ansible/tree/master/roles/gitlab-runner
https://github.com/haroldb/ansible-gitlab-runner

Relogin as gitlab-runner user

su gitlab-runner -s /bin/bash

Get token from GitLab server
http:///admin/runners

# configure DNS for GitLab server
echo "10.0.1.12 gitlab.example.com gitlab" >> /etc/hosts

Register
https://docs.gitlab.com/runner/register/

gogs

Gogs (deprected)
# Ansible role
https://github.com/panticz/ansible/tree/master/roles/gogs

Installation instructions
https://packager.io/gh/pkgr/gogs/install?bid=562#ubuntu-16-04-gogs
https://packager.io/gh/pkgr/gogs/install?bid=440

Backup

# backup
su git
cd
/opt/gogs/gogs backup

Links
https://docs.gitea.io/en-us/install-with-docker/

GitLab: Web-based Git repository manager

Install
http://www.panticz.de/install-gitlab

CLI

# restart gitlab
gitlab-ctl restart

# git home directory
/var/opt/gitlab

Reset admin password

# change root password
sudo gitlab-rails console
user = User.where(id: 1).first 
user.password = user.password_confirmation ='xxx' 
user.save!

Gitlab settings API

https://docs.gitlab.com/ee/api/settings.html
curl --header "PRIVATE-TOKEN: 11112222333344445555" https://gitlab.example.com/api/v4/application/settings

Disalbe register / Singup

sudo gitlab-rails console
ApplicationSetting.last.update_attributes(signup_enabled: false)

backup
https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/raketasks/backup_restore.md

# full backup
gitlab-rake gitlab:backup:create

# backup without reposiories
sudo gitlab-rake gitlab:backup:create SKIP=repositories

# backup target
ls -l /var/opt/gitlab/backups

gitlab_rails['backup_keep_time'] = 604800

# backup to s3
gitlab_rails['artifacts_enabled'] = true
gitlab_rails['artifacts_object_store_enabled'] = true
gitlab_rails['artifacts_object_store_remote_directory'] = "artifacts"
gitlab_rails['artifacts_object_store_connection'] = {
  'provider' => 'AWS',
  'region' => 'foo-west-1',
  'aws_access_key_id' => '1111111111111111111111',
  'aws_secret_access_key' => '22222222222222222222222222222',
  'endpoint' => 'https://s3.example.com'
}

restore

sudo gitlab-rake gitlab:backup:restore force=yes
https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/raketasks/backup_restore.md

Send email via SMTP
https://docs.gitlab.com/omnibus/settings/smtp.html
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/smtp.md

# /etc/gitlab/gitlab.rb
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.example.com"

# reconfigure GitLab
gitlab-ctl reconfigure

# send testmail
gitlab-rails console
Notify.test_email('foo@example.com', 'GitLab Test', 'Test message from GitLab server').deliver_now

Create backup

Git

CLI

# show repository info
git describe
git config -l

# show commit info
git show 

# show diff for one file
git diff 
git --no-pager diff

# commit only one file
git commit -m 'my comment' path/to/file

# create Git repository
git init

# change upstream server
git remote set-url origin git@git.example.com:foo/bar.git

# add all files
git add .

# commit
git commit -m "initial project version"

# revert
git revert 

# cancel merge
git merge --abort

# list tag
git tag -l

# get files changed in commit
git diff-tree --no-commit-id --name-only -r 

# reset marge
git reset --hard origin/master

checkout

Install GitLab

Install
https://packages.gitlab.com/gitlab/gitlab-ce/install#manual-deb

curl --location "https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh" | sudo bash


curl -fsSL https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey | gpg --dearmor > /usr/share/keyrings/gitlab_gitlab-ce-archive-keyring.gpg
#wget -qO- https://packages.gitlab.com/gpg.key | gpg --no-default-keyring --keyring /usr/share/keyrings/gitlab_gitlab-ce-archive-keyring.gpg --import

/etc/apt/sources.list.d/gitlab_gitlab-ce.list
deb [signed-by=/usr/share/keyrings/gitlab_gitlab-ce-archive-keyring.gpg] https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu $(lsb_release -cs) main
deb-src [signed-by=/usr/share/keyrings/gitlab_gitlab-ce-archive-keyring.gpg] https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu $(lsb_release -cs) main

Old install
[embed_url: https://raw.githubusercontent.com/panticz/installit/master/install.gitlab.sh]

HowTo
http://www.panticz.de/gitlab

Login

http://YOUR_SERVER_IP
user: root
pass: 5iveL!fe

Downloads: GitLab CE Download Archives
https://about.gitlab.com/downloads/archives/

# check instalation
gitlab-rake gitlab:check

# GitLab APT repository
https://packages.gitlab.com/gitlab/gitlab-ce

# rebuild an authorized_keys file
gitlab-rake gitlab:shell:setup

# install specific version
sudo apt-get install -y gitlab-ce=7.10.1~omnibus.1-1

Send email notification
Notify.test_email('foo@example.com', 'GitLab test subject', 'GitLab test message').deliver_now

GitLab backup to s3
https://stackoverflow.com/questions/37553070/gitlab-omnibus-delete-backup-from-amazon-s3/58100385#58100385

# /etc/gitlab/gitlab.rb
gitlab_rails['backup_upload_connection'] = {
  'provider' => 'AWS',
  'region' => 'ew-west-1',
  'aws_access_key_id' => 'foo,
  'aws_secret_access_key' => 'bar',
  'endpoint' => 'https://s3.example.com'
}
gitlab_rails['backup_upload_remote_directory'] = 'backups'

Skip DB migration

git
Profiles GitHub StackOverflow LinkedIn Xing
Contact Imprint
© panticz 2026

Cookie-Einstellungen

Diese Website nutzt eingebettete Inhalte von Drittanbietern (z.B. YouTube, SoundCloud). Beim Laden dieser Inhalte werden Daten an die jeweiligen Anbieter übermittelt. Datenverarbeitungserklärung