Skip to content

Tips & Tricks

wifiBlocker EUROPE edited this page Sep 12, 2024 · 52 revisions

Resize the partition

apk add --no-cache e2fsprogs-extra

resize2fs /dev/mmcblk0p2

The partition will be resized to maximum size

----------------------------//-----------------------------

iptables and ip6tables

List:

iptables -t nat -v -L -n --line-number

ip6tables -t nat -v -L -n --line-number

Delete rule:

iptables -t nat -D POSTROUTING 2

ip6tables -t nat -D POSTROUTING 2

----------------------------//-----------------------------

Alpine IMAGES

Backup the 2 partitions from SD card to .img files

dd bs=4M if=/dev/sdb1 of=Alpine_sdb1.img

dd bs=4M if=/dev/sdb2 of=Alpine_sdb2.img


Write the .img files to a new SD card, formatted with 2 partitions: sdb1=FAT32, 400 MB, and sdb2=ext4, the rest of the card

dd if=Alpine_sdb1.img of=/dev/sdb1 bs=4M

dd if=Alpine_sdb2.img of=/dev/sdb2 bs=4M

----------------------------//-----------------------------

Grep

grep -v '^#' hostapd.conf - print file without lines starting with #

----------------------------//-----------------------------

SSH

rm -rf /root/.ssh

rm -rf /home/iblocker/.ssh/

rm -rf /var/www/.ssh/

ssh-keygen -t rsa -q -f "/root/.ssh/id_rsa" -N ""

cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys

ssh -o StrictHostKeyChecking=no root@localhost "exit"

cp /root/.ssh /var/www -R

cp /root/.ssh /home/iblocker -R

chown iblocker:iblocker /home/iblocker/.ssh -R

chmod 755 /var/www/.ssh/

chmod 755 /var/www/.ssh/*

chown apache:apache /var/www/.ssh -R

chown root:root /var/www/.ssh/*

chmod 755 /var/www/.ssh/*

ssh-keyscan -H localhost >> /var/www/.ssh/known_hosts

Check: ssh root@localhost

----------------------------//-----------------------------

DNS ISSUE - "request is not signed"

Solution:

systemctl stop named.service

rm -r /var/cache/bind/*

systemctl start named.service

----------------------------//-----------------------------

SET TIME

alpine:~# date --set="2024-08-14 10:07:00"

Wed Aug 14 10:07:00 CEST 2024

----------------------------//-----------------------------

Disable service

rc-update del acpid

----------------------------//-----------------------------

Enable service

apk add dhcpcd - for IPv6 on eth0 or usb0

rc-update add dhcpcd

rc-service dhcpcd start

rc-status

Clone this wiki locally