Sensorsd - UPS Shutdown

Shutdown Hosts on Power Outages Everybody is talking about Power Outages. Let’s assume you have a Smart-UPS for your Playground and you’d like to shut some Infrastructure to avoid some troubles with corrupt filesystems, broken vm’s and things like that. Connection UPS to APU via USB Cable dmesg show the UPS connected APU# dmesg uhidev0 at uhub0 port 3 configuration 1 interface 0 "American Power Conversion Smart-UPS_1500 ... uhidev0: iclass 3/0, 142 report ids upd0 at uhidev0 uhid0 at uhidev0 reportid 1: input=0, output=0, feature=1 uhid1 at uhidev0 reportid 2: input=0, output=0, feature=1 .

JC - JSON from CLI

how to build json from cli we all like json, do we ? add package doas pkg_add jc try ping openbsd-box # ping -c 3 |jc --ping -p 2>/dev/null { "destination_ip": "", "data_bytes": 56, "pattern": null, "destination": "", "packets_transmitted": 3, "packets_received": 3, "packet_loss_percent": 0.0, "duplicates": 0, "round_trip_ms_min": 9.219, "round_trip_ms_avg": 9.826, "round_trip_ms_max": 10.158, "round_trip_ms_stddev": 0.43, "responses": [ { "type": "reply", "bytes": 64, "response_ip": "", "icmp_seq": 0, "ttl": 59, "time_ms": 10.

Ubuntu 20.04 LTS & Netplan

Assume you got a fresh Machine with DHCP … Ubuntu with DHCP Config cat /etc/netplan/01-netcfg.yaml # This is the network config written by 'subiquity' network: ethernets: ens192: dhcp4: true version: 2 and you’d like to switch to Static IP, ask google how todo it an give try: Static IP with Netplan # This is the network config written by 'subiquity' network: version: 2 ethernets: ens192: addresses: - gateway4: nameservers: addresses: - 8.

FreeBSD bhyve

bhyve, pronounced “beehive” is a hypervisor/virtual machine manager for FreeBSD that supports most Intel and AMD processors that report the “POPCNT” (POPulation Count) processor feature in dmesg(8). Download ISO and boot it … in a new Virtual Machine … cat << 'EOF' > #!/usr/bin/env bash iso=FreeBSD-13.1-RELEASE-amd64-bootonly.iso vm=guest.img # Load Module if needed kldstat |grep vmm.ko || kldload vmm ifconfig tap0 create sysctl ifconfig ifconfig bridge0 create ifconfig bridge0 addm vmx0 addm tap0 ifconfig bridge0 create ifconfig bridge0 up # Get ISO test -f $iso || fetch https://download.

FreeBSD - Upgrade 13.0 to 13.1

Upgrade FreeBSD 13.0 to 13.1 should be a easy task, right ? Patch it first freebsd-update fetch freebsd-update install reboot may not needed, but you have to boot anyway a few times … Fetch and Upgrade to 13.1 this needs some time ! depending on your internet speed, and specially to power and filesystem performance of your machine. 20-30min for a common VM is not unreal :( time freebsd-update upgrade -r 13.

OpenBSD 7.x Diskusage

Background It seems as OpenBSD (and the installed Software) is useing more and more Space in the /usr Partition. For Upgrading to 7.1, at least 1.1 GB Free Space is needed. So, i’m gooing to update my Default Partitioning Proposal like this: Example with 25 GB root@puffy# df -h Filesystem Size Used Avail Capacity Mounted on /dev/sd0a 3.9G 766M 2.9G 20% / /dev/sd0d 1.9G 20.0K 1.8G 0% /tmp /dev/sd0e 5.8G 36.

SSH - Signing Files

Signing Files with SSH 8.0 unsigned file $ cat hosts localhost ::1 localhost egal sign $ ssh-keygen -Y sign -f id_rsa -n file hosts Signing file hosts Write signature to hosts.sig signed file $ cat hosts.sig -----BEGIN SSH SIGNATURE----- U1NIU0lHAAAAAQAAAZcAAAAHc3NoLXJzYQAAAAMBAAEAAAGBALJB+O4WCOM7V56H1xigpd uJem52Izwltl2cG9GQOO94HClebcr7C5aD24iI4wDcT9Ajv5/fu9cDVEXku83I/U0blUZe oMd8qCIH+4O+RVYyCvKFyEkcZ6n+RRH1G5EgcP0UXtmo4J3p8Hyo/6jtPA/r28+idi84A6 7yW1cmC5GpIw24Vr5aqA3e3rCJdFBZThzsTrwu/DHzIueQstEQdldycUit4X9UPBaCVnov +nhyijO9b8adzkTMxjcJAl65fdLUmwuJ5h3z0owdKOmrcNlbWxqTIuGU0in25ZDQVxLssc WI8oW7vR5F7+cXSV7fYliTG/XPsCkD1KpWc/xSOr35bALRQpxD1+T48mrbKToZuzu4hage cUSOvRI3R0hKIvcXYyf2SQoBfLNlpvl5CRcatlw2fMhFQPrVz0Bh543chEFsF4nxKQw8yq riJbqkvhW8tzKCn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fk+PJq2yk6Gbs7uIWoHnFEjr0SN0dISiL3F2Mn9kkKAXyzZab5eQkXGrZcNnzIRUD61c9AYeeN3IRBbBeJ8SkMPMqq4iW6pL4VvLcygpzAO78k0cXsurkgya8NGHIVyCXaazVJYDNbfs/SdwMAuLoKb4YFXeh9L/U= verify


got in touch with httpie, a restapi client for the cli install doas pkg_add httpie Hello World let’s do a little test $ https HTTP/1.1 200 OK Connection: keep-alive Content-Type: application/json; charset=utf-8 age: 0 cache-control: public, max-age=0, must-revalidate content-length: 264 date: Wed, 10 Nov 2021 17:34:19 GMT etag: "108-yw+Xn8xsGAsJIUMQvDLN7gAcQuc" server: Vercel strict-transport-security: max-age=63072000 x-matched-path: /api/hello x-vercel-cache: MISS x-vercel-id: fra1::iad1::4kmc7-1636565659646-cf763c94cea0 { "ahoy": [ "Hello, World! 👋 Thank you for trying out HTTPie 🥳", "We hope this will become a friendship.

Git aliases

we all do like aliases, right ? Some Aliases git config --global checkout git config --global branch git config --global commit git config --global status git config --global alias.bra "branch -a" and then, you just type: git co git br git ci git st git bra .gitconfig all this stuff is saved in ~/.gitconfig $ cat ~/gitconfig # This is Git's per-user configuration file. ... [alias] co = checkout br = branch ci = commit st = status bra = branch -a sha256: 1175e6dde38a2eaed638973cbcd44b5d877ef48acc4e42127dbed167ec15cd1c

Bootstrap Debian

Bootstrapping Debian a little helper how to generate a Debian Template. This time, it’s a VM Hosted on Vultr New VM 1 CPU, 1GB RAM, 25GB Disk upload debian-10.9.0-amd64-netinst.iso boot from iso install: (text based) lang: english country: switzerland locale: US (en_US.UTF-8) keymap: Swiss German nic: ens3 hostname: template-25G domain: passwd: xxxxxx user: prename name / login passwd: xxxxxx disk: Guided - entire disk with LVM - (one partition | separate /home | separate /home, /var and /tmp) separate partition for large disks one partition for smaller disks write: yes disk: 20GB (for guided partitioning), 5GB for Spare write: yes another dvd: no mirror: switzerland, debian.

PHP 8.0 on OpenBSD 6.9

OpenBSD 6.9 and PHP 8 is out … Why not give a try ? list packages what PHP Packages are available with Version 6.9 ? root@host # pkg_info -Q php |grep '\-8' php-8.0.3 php-apache-8.0.3 php-bz2-8.0.3 php-cgi-8.0.3 php-curl-8.0.3 php-dba-8.0.3 php-dbg-8.0.3 php-enchant-8.0.3 php-gd-8.0.3 php-gmp-8.0.3 php-imap-8.0.3 php-intl-8.0.3 php-ldap-8.0.3 php-mysqli-8.0.3 php-odbc-8.0.3 php-pcntl-8.0.3 php-pdo_dblib-8.0.3 php-pdo_mysql-8.0.3 php-pdo_odbc-8.0.3 php-pdo_pgsql-8.0.3 php-pdo_sqlite-8.0.3 php-pgsql-8.0.3 php-pspell-8.0.3 php-shmop-8.0.3 php-snmp-8.0.3 php-soap-8.0.3 php-sqlite3-8.0.3 php-tidy-8.0.3 php-xsl-8.0.3 php-zip-8.0.3 Install and Configure Nginx add nginx, php8 add webserver, php8 and enable the services


just trying a new feature for leaving comments … it’s selfhosted, done with isso and quite painfull to install :( some people may like to provide feedback, ask questions, … sha256: fed502f0a96744470fa42b910138efed8d462ce13a2f5329c61ad23fc133281e

Git Branches

Branches some basic commands for branches. you can read Branch Basics and Branch Management for more details create branch you wanna develope a feature, fix a bug, test some stuff … you need a branch ! git checkout -b feature1 push upstream if you have a central repo, push the feature upstream (so others can checkout as well) git push --set-upstream origin feature1 show branch you may have multiple branches, list them all.

Bootstrap OpenBSD with Jail Partition

Bootstrapping VM This is similar to the previous Post, but with a small difference. Here, we add an other Partition /jail with 2GB Size. On this Partition, we remove the nodev & nosuid Flag, so we can use this Partition as Root for some Jailed Users. And last but not least, we fireup a new VM, configure a Jailed User and make it Public Available … VM with 20G Disk *** Bootstrap OpenBSD 6.


Tshark Basic Commands tbd Ringbuffer Capture Files, Rotate every 10MB, keep last 25 files doas tshark -n -i em0 -w sniff -b filesize:10000 -b files:25 Ringbuffer with Autostop -> Time Capture Files, Rotate every 10MB, keep last 25 files, Stop after 1h doas tshark -n -i em0 -w sniff -b filesize:10000 -b files:25 -a duration:3600 Ringbuffer with Autostop -> Packets Capture Files, Rotate every 10MB, keep last 25 files, Stop after 100000 Packets