Category Archives: Arch Linux

Migrate subfolder to separate git repository

Let’s say you have a repository structure like below (eg. because previously it was SVN repository where everything was on one place).

  • .\Web
    • .\
    • .\

Now you would like to move to separate git repository.

First of all, you need to install git-filter-repo.

# Clone old repository to new directory

# Remove everything else except directory
git filter-repo --path

# Make new root directory
git filter-repo --subdirectory-filter

# Push to a new repository
git remote add origin NEW_REPOSITORY
git push -u origin master

Installing Arch Linux ARM on Raspberry PI 3

Insert SD card to your system.

sudo fdisk -l
sudo fdisk /dev/sdX

Create partitions.

  • Clear partitions (o)
  • Create boot partition (n, p, 1, enter, +500M, t, c)
  • Create system partition (n, p, 2, enter, enter)
  • Write partitions (w)
sudo mkfs.vfat /dev/sdX1
sudo mkfs.ext4 /dev/sdX2

Mount new partitions.

sudo mkdir /mnt/boot/
sudo mkdir /mnt/root/

sudo mount /dev/sdx1 /mnt/boot/
sudo mount /dev/sdx2 /mnt/root/

Download and install Arch Linux ARM.

sudo su
tar zxvf ArchLinuxARM-rpi-aarch64-latest.tar.gz -C /mnt/root
mv /mnt/root/boot/* /mnt/boot
umount /mnt/boot/
umount /mnt/root/

Remove SD card, insert it into Raspberry PI and boot it to complete the installation.

pacman-key --init
pacman-key --populate archlinuxarm
pacman -Syu

Automatic external monitor switch on Arch Linux

Install autorandr.

sudo pacman -S autorandr

Save current configuration. If you are on notebook you can eg. call it mobile.

autorandr --save mobile

Now connect you external monitor. Change the monitor settings as you wish and save it.

autorandr --save docked

From now on, when you connect external monitor it will automatically switch to it. If you disconnect it it will revert back internal monitor only.