Skip to content

Instantly share code, notes, and snippets.

@SirVeggie
Last active October 25, 2020 21:46
Show Gist options
  • Save SirVeggie/9fb6203ab074a75c134c8c8391e3635b to your computer and use it in GitHub Desktop.
Save SirVeggie/9fb6203ab074a75c134c8c8391e3635b to your computer and use it in GitHub Desktop.

Pi Setup

Basic settings

raspi-config

  1. Change password
  2. Expand filesystem
  3. Change resolution (optional)
  4. Set boot state (optional)
  5. Set hostname to gitlab (optional)

Updating

sudo apt update
sudo apt full-upgrade
sudo apt clean

Static IP

Open file
sudo nano /etc/dhcpcd.conf

interface wlan0
static ip_address=192.168.1.20/24
static routers=192.168.1.1
static domain_name_servers=1.1.1.1

Reboot
sudo reboot

VNC viewer

sudo apt install realvnc-vnc-server realvnc-vnc-viewer

Enable VNC with raspi-config

External hdd

Format drive
sudo mkfs.ext4 /dev/sda1 -L untitled

Mount drive
sudo mkdir /mnt/storage
sudo chown pi /mnt/storage
sudo mount /dev/sda1 /mnt/storage

Setup automount
sudo blkid - get UUID
sudo nano /etc/fstab

UUID=91ce2c4f-44cc-4c39-9954-c00595c0821b /mnt/storage ext4 defaults 0 0

Remove drive while pi is powered
sudo umount /dev/sda1

For NTFS filesystems (has a performance hit)
sudo apt-get install ntfs-3g

Configure SWAP file

Stop swap
sudo dphys-swapfile swapoff

Open file
sudo nano /etc/dphys-swapfile

Modify max swap size
CONF_MAXSWAP=4096

Modify swap size
CONF_SWAPSIZE=4096

Change swap location
CONF_SWAPFILE=/mnt/storage/swap

Initialize new file location
sudo dphys-swapfile setup

Restart swap
sudo dphys-swapfile swapon

GitLab

Install GitLab

curl -Lo gitlab-ce_12.9.10-ce.0_armhf.deb https://packages.gitlab.com/gitlab/raspberry-pi2/packages/raspbian/stretch/gitlab-ce_12.9.10-ce.0_armhf.deb/download.deb

sudo apt install ./gitlab-ce_12.9.10-ce.0_armhf.deb

Set GitLab settings

Open file
sudo nano /etc/gitlab/gitlab.rb

Set these settings

external_url 'http://192.168.1.20:8888'
unicorn['enable'] = false
puma['enable'] = true
puma['worker_processes'] = 2
sidekiq['concurrency'] = 9
prometheus_monitoring['enable'] = false
git_data_dirs({"default" => {"path" => "/mnt/storage/git-data"}})

Reconfigure GitLab

sudo gitlab-ctl reconfigure

Other GitLab commands

sudo gitlab-ctl start
sudo gitlab-ctl stop
sudo gitlab-ctl restart

Installation video

https://www.youtube.com/watch?v=VVp0buV-wVM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment