alpine notes

Updating system between versions

Edit /etc/apk/repositories, change version on repo URLs, run apk update && apk upgrade.

apk notes

  • apk update updates package list
  • apk upgrade upgrades packages
  • apk add installs package
  • apk del deletes package

systemd equivalent commands

  • systemctl status/start/stop/restart sshd service sshd status/start/stop/restart
  • systemctl enable sshd rc-update add sshd

user stuff

  • adduser ave creates home dir by default
  • addgroup ave wheel adds user ave to wheel
  • echo "ave ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/ave && chmod 0440 /etc/sudoers.d/ave this article recommends it due to “adding a custom user configuration file to avoid having to deal with manually changing configuration files later during package upgrades”

installing docker

apk add docker service docker start rc-update add docker boot

wg service

/etc/init.d/swolenet:

#!/sbin/openrc-run
depend() {
    need net
}
 
start() {
    wg-quick up swolenet
}
 
stop() {
    wg-quick down swolenet
}

installing to oracle cloud etc

https://ariadne.space/2021/07/18/moving-my-blog-to-oracle-cloud/

iscsi

Install open-iscsi for ability to mount drives. Same commands as those on OCi.

If it’s the first time mounting it, run mkfs.ext4 on it.

/etc/init.d/mountiscsi:

#!/sbin/openrc-run
depend() {
    need net
    need iscsid
}
 
start() {
    mount /mnt/data
}
 
stop() {
    umount /mnt/data
}

/etc/fstab:

/dev/sdb /mnt/data ext4 defaults,_netdev,nofail 0 2

sudo rc-update add iscsid boot, sudo rc-update add mountiscsi

ipv6

Setting up ipv6 in OCI:

  • open Virtual Cloud Network
    • Go to CIDR block Add IPv6 CIDR block
    • Go to Subnet Edit and enable IPv6
    • Go to Route Table Add rule for ::/0 with internet gateway
    • Go to Security Lists Add relevant ingress and egress rules
  • Open VNIC of the box:
    • Assign IPv6 address

Connect with Console Connection Create local connection copy command. Log in.

Run udhcpc6, and then ip -6 r. Copy the default gateway IP. Run udhcpc. You can kill console connection now if you want.

/etc/network/interfaces:

iface eth0 inet6 static
        address 2603:c020:8002:1969:6969:6969:6969:6969/56
        gateway fe80::200:17ff:fe57:f9ee
        pre-up echo 0 > /proc/sys/net/ipv6/conf/eth0/accept_ra

Replace gateway with the gateway we found, address with the address you assigned on the VNIC.