Writing /var/lib/dokuwiki/wiki.project-insanity.org/data/meta/picloud.meta failed
Hotfix release available: 2025-05-14b "Librarian".
upgrade now! [56.2] (what's this?)
Hotfix release available: 2025-05-14a "Librarian".
upgrade now! [56.1] (what's this?)
New release available: 2025-05-14 "Librarian".
upgrade now! [56] (what's this?)
picloud
Differences
This shows you the differences between two versions of the page.
| picloud [2020/11/10 11:07] – old revision restored (2020/05/17 14:29) 2a01:4f8:191:41f1::2 | picloud [2021/10/31 10:42] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ==== tp-link router ==== | ||
| + | <file - / | ||
| + | [...] | ||
| + | sleep 5 | ||
| + | / | ||
| + | exit 0 | ||
| + | </ | ||
| + | <file - / | ||
| + | iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE | ||
| + | iptables -A FORWARD -m conntrack --ctstate RELATED, | ||
| + | iptables -A FORWARD -i net0 -o wlan0 -j ACCEPT | ||
| + | iptables -I FORWARD -o br-lan -d 192.168.1.2 -j ACCEPT | ||
| + | iptables -t nat -I PREROUTING -p tcp --dport 8096 -j DNAT --to 192.168.1.2: | ||
| + | iptables -t nat -A OUTPUT -p tcp --dport 8096 -j DNAT --to 192.168.1.2: | ||
| + | iptables -t nat -I PREROUTING -p tcp --dport 2222 -j DNAT --to 192.168.1.2: | ||
| + | iptables -t nat -A OUTPUT -p tcp --dport 2222 -j DNAT --to 192.168.1.2: | ||
| + | </ | ||
| + | ==== armstone a9 ==== | ||
| + | <file - / | ||
| + | [Unit] | ||
| + | Description=Setup a secure tunnel to %I | ||
| + | After=network.target | ||
| + | [Service] | ||
| + | User=picloud | ||
| + | Environment=" | ||
| + | EnvironmentFile=/ | ||
| + | ExecStart=/ | ||
| + | |||
| + | # Restart every >2 seconds to avoid StartLimitInterval failure | ||
| + | RestartSec=30 | ||
| + | Restart=always | ||
| + | |||
| + | [Install] | ||
| + | WantedBy=multi-user.target | ||
| + | </ | ||
| + | <file - / | ||
| + | TARGET=144.76.16.40 | ||
| + | LOCAL_ADDR=localhost | ||
| + | LOCAL_PORT=8096 | ||
| + | REMOTE_ADDR=0.0.0.0 | ||
| + | REMOTE_PORT=8096 | ||
| + | REMOTE_USER=onny | ||
| + | KEYFILE=/ | ||
| + | </ | ||
| + | <file - / | ||
| + | TARGET=144.76.16.40 | ||
| + | LOCAL_ADDR=localhost | ||
| + | LOCAL_PORT=22 | ||
| + | REMOTE_ADDR=0.0.0.0 | ||
| + | REMOTE_PORT=2222 | ||
| + | REMOTE_USER=onny | ||
| + | KEYFILE=/ | ||
| + | </ | ||
| + | <code bash> | ||
| + | systemctl daemon-reload | ||
| + | systemctl enable --now secure-tunnel@ssh secure-tunnel@jellyfin | ||
| + | </ | ||
| + | ==== rock64 ==== | ||
| + | * base image https:// | ||
| + | * latest working kernel: linux-aarch-5.0.X http:// | ||
| + | <code bash> | ||
| + | onny@tuxzentrale ~> sudo fdisk -l / | ||
| + | GPT PMBR size mismatch (4194303 != 60751871) will be corrected by write. | ||
| + | The backup GPT table is not on the end of the device. This problem will be corrected by write. | ||
| + | Disk / | ||
| + | Units: sectors of 1 * 512 = 512 bytes | ||
| + | Sector size (logical/ | ||
| + | I/O size (minimum/ | ||
| + | Disklabel type: gpt | ||
| + | Disk identifier: 8B6BBA4F-80FF-49C5-8990-0762C108723D | ||
| + | |||
| + | Device | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | </ | ||
| + | * packages: r128gain, smloadr, jellyfin, samba, caddy, php-fpm, cups, xerox-phaser-6000-6010 | ||
| + | <code bash> | ||
| + | pacman -S cups | ||
| + | systemctl enable --now org.cups.cupsd | ||
| + | </ | ||
| + | <code bash> | ||
| + | pacman -S docker nftables iptables-nft | ||
| + | systemctl enable --now docker nftables | ||
| + | gpasswd -a picloud docker # put in your username, log out and log in again | ||
| + | </ | ||
| + | <file - /etc> | ||
| + | { | ||
| + | " | ||
| + | } | ||
| + | </ | ||
| + | <code bash> | ||
| + | docker version -f ' | ||
| + | # true | ||
| + | docker run -it --name archlinux-cupsd --platform linux/amd64 archlinux | ||
| + | </ | ||
| + | * https:// | ||
| + | <code bash> | ||
| + | docker exec -it # | ||
| + | pacman -Syu cups xerox-phaser-6000-6010 | ||
| + | cd /tmp | ||
| + | wget " | ||
| + | pacman -U xerox-phaser-6000-6010-1.01_20110222-1-x86_64.pkg.tar.zst | ||
| + | </ | ||
| + | <code bash> | ||
| + | docker run \ | ||
| + | --entrypoint=/ | ||
| + | --env container=docker \ | ||
| + | --mount type=bind, | ||
| + | --mount type=bind, | ||
| + | --mount type=tmpfs, | ||
| + | --mount type=tmpfs, | ||
| + | --mount type=tmpfs, | ||
| + | --unit=sysinit.target \ | ||
| + | --name archlinux-cupsd --platform linux/amd64 archlinux | ||
| + | </ | ||
| + | * sources | ||
| + | * https:// | ||
| + | * https:// | ||
| + | <file - / | ||
| + | [...] | ||
| + | [multilib] | ||
| + | Include = / | ||
| + | </ | ||
| + | * https:// | ||
| + | * add pi repo | ||
| + | <code bash> | ||
| + | docker run \ | ||
| + | --env container=docker \ | ||
| + | --entrypoint=/ | ||
| + | --mount type=tmpfs, | ||
| + | --mount type=tmpfs, | ||
| + | --mount type=tmpfs, | ||
| + | --mount type=bind, | ||
| + | --name archlinux-cupsd2 --platform linux/amd64 -it archlinux | ||
| + | </ | ||
| + | * podman non-root https:// | ||
| + | * podman platform support https:// | ||
| + | <code bash> | ||
| + | DOCKER_CLI_EXPERIMENTAL=enabled docker run -d -p 631:631 --name debian-cupsd --platform linux/i386 debian | ||
| + | apt-get update | ||
| + | apt-get install cups | ||
| + | </ | ||
| + | ===== rewrite ===== | ||
| + | <file - / | ||
| + | [...] | ||
| + | table ip nat { | ||
| + | chain prerouting { | ||
| + | type nat hook prerouting priority filter; policy accept | ||
| + | |||
| + | # Forward web traffic to http.pi | ||
| + | ip daddr 192.168.178.4 tcp dport 631 dnat to 172.17.0.2 | ||
| + | } | ||
| + | </ | ||
| + | <code bash> | ||
| + | pacman -S nftables iptables-nft docker | ||
| + | gpasswd -a picloud docker | ||
| + | systemctl restart docker | ||
| + | DOCKER_CLI_EXPERIMENTAL=enabled docker run --privileged \ | ||
| + | -v / | ||
| + | -v / | ||
| + | -v / | ||
| + | -p 631:631 \ | ||
| + | -p 5353: | ||
| + | -dit \ | ||
| + | | ||
| + | | ||
| + | | ||
| + | docker exec -it archlinux-cupsd | ||
| + | </ | ||
| + | <file - / | ||
| + | [...] | ||
| + | [multilib] | ||
| + | Include = / | ||
| + | |||
| + | [projectinsanity] | ||
| + | SigLevel = PackageOptional | ||
| + | Server = https:// | ||
| + | </ | ||
| + | <code bash> | ||
| + | $ pacman -Sy cups ghostscript xerox-phaser-6000-6010 | ||
| + | $ passwd | ||
| + | </ | ||
| + | <file - / | ||
| + | [...] | ||
| + | Listen 0.0.0.0:631 | ||
| + | [...] | ||
| + | # Restrict access to the server... | ||
| + | < | ||
| + | Order allow,deny | ||
| + | Allow all | ||
| + | </ | ||
| + | |||
| + | # Restrict access to the admin pages... | ||
| + | < | ||
| + | Order allow,deny | ||
| + | Allow all | ||
| + | </ | ||
| + | [...] | ||
| + | </ | ||
| + | <code bash> | ||
| + | $ lsusb | ||
| + | [...] | ||
| + | Bus 002 Device 004: ID 413c:5404 Dell 1250c Color Printer | ||
| + | [...] | ||
| + | $ chown root:cups / | ||
| + | $ / | ||
| + | </ | ||
| + | * https:// | ||
| + | <file - / | ||
| + | <?xml version=" | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | * https:// | ||
| + | * Setup on other computers https:// | ||
| + | * https:// | ||
| + | * autostart container | ||
| + | < | ||
| + | udp 0 0 0.0.0.0: | ||
| + | udp6 | ||
| + | udp6 | ||
| + | udp6 | ||
| + | </ | ||
| + | ===== setup ===== | ||
| + | core | ||
| + | <code bash> | ||
| + | useradd --uid 1002 picloud | ||
| + | timedatectl set-ntp true | ||
| + | ln -sf / | ||
| + | hwclock --systohc | ||
| + | # edit / | ||
| + | locale-gen | ||
| + | </ | ||
| + | <file - / | ||
| + | LANG=en_US.UTF-8 | ||
| + | </ | ||
| + | <file - / | ||
| + | KEYMAP=de-latin1 | ||
| + | </ | ||
| + | <file - / | ||
| + | picloud | ||
| + | </ | ||
| + | <file - / | ||
| + | 127.0.0.1 localhost | ||
| + | :: | ||
| + | 127.0.1.1 picloud.localdomain picloud | ||
| + | </ | ||
| + | fstab | ||
| + | <file - /etc/fstab -p | ||
| + | # Static information about the filesystems. | ||
| + | # See fstab(5) for details. | ||
| + | |||
| + | # <file system> <dir> < | ||
| + | / | ||
| + | </ | ||
| + | hdparm | ||
| + | <code bash> | ||
| + | pacman -S hdparm | ||
| + | </ | ||
| + | <file - / | ||
| + | |||
| + | [Unit] | ||
| + | Description=hdparm sleep | ||
| + | |||
| + | [Service] | ||
| + | Type=oneshot | ||
| + | ExecStart=/ | ||
| + | |||
| + | [Install] | ||
| + | WantedBy=multi-user.target | ||
| + | </ | ||
| + | <code bash> | ||
| + | systemctl enable --now hdparm | ||
| + | </ | ||
| + | nftables | ||
| + | <code bash> | ||
| + | pacman -S nftables | ||
| + | </ | ||
| + | <file - / | ||
| + | table inet filter { | ||
| + | set tcp_accepted { | ||
| + | type inet_service | ||
| + | flags interval | ||
| + | elements = { 22,8096,631 } | ||
| + | } | ||
| + | |||
| + | set udp_accepted { | ||
| + | type inet_service | ||
| + | flags interval | ||
| + | elements = { 60000-61000 } | ||
| + | } | ||
| + | |||
| + | chain base_checks { | ||
| + | ct state { established, | ||
| + | ct state invalid drop | ||
| + | } | ||
| + | |||
| + | chain input { | ||
| + | type filter hook input priority filter; policy drop; | ||
| + | jump base_checks | ||
| + | iifname " | ||
| + | ip protocol icmp icmp type { echo-reply, destination-unreachable, | ||
| + | ip6 nexthdr ipv6-icmp icmpv6 type { destination-unreachable, | ||
| + | tcp dport @tcp_accepted accept | ||
| + | udp dport @udp_accepted accept | ||
| + | reject | ||
| + | } | ||
| + | |||
| + | chain forward { | ||
| + | type filter hook forward priority filter; policy drop; | ||
| + | jump base_checks | ||
| + | } | ||
| + | |||
| + | chain output { | ||
| + | type filter hook output priority filter; policy accept; | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | <code bash> | ||
| + | systemctl enable --now nftables | ||
| + | </ | ||
| + | systemd-resolved | ||
| + | <file - / | ||
| + | [...] | ||
| + | MulticastDNS=no | ||
| + | [...] | ||
| + | </ | ||
| + | avahi | ||
| + | <code bash> | ||
| + | pacman -S avahi | ||
| + | </ | ||
| + | <file - / | ||
| + | <?xml version=" | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | <code bash> | ||
| + | systemctl enable --now avahi-daemon | ||
| + | </ | ||
| + | systemd-networkd | ||
| + | <file - / | ||
| + | [Match] | ||
| + | Name=eth0 | ||
| + | |||
| + | [Network] | ||
| + | Address=192.168.178.2/ | ||
| + | Gateway=192.168.178.1 | ||
| + | DNS=192.168.178.1 | ||
| + | DNSSEC=false | ||
| + | DHCP=ipv6 | ||
| + | </ | ||
| + | <code bash> | ||
| + | systemctl enable --now systemd-networkd | ||
| + | </ | ||
