PHP

OpenBSD - PHP 8.2

Running PHP on OpenBSD yes, i know … it’s not rocket science .. but why not make a short post so other (or myself) can have a quick look if needed ? pkg_info -Q php pkg_add php--%8.2 pkg_add php-sqlite3--%8.2 pkg_add php-curl--%8.2 Set TimeZone and allow short open tags sed -i s'#date.timezone = UTC.*#date.timezone = Europe/Zurich#' /etc/php-8.2.ini sed -i s'#short_open_tag = Off.*#short_open_tag = On#' /etc/php-8.2.ini Install all Modules if needed .. does not make sense for me :(

Nextcloud on OpenBSD

Intro Wanna run your own Nextcloud Server on OpenBSD … ? Give a Try ! It’s quite trivial as you can see. Just fireup an empty machine, assign an Hostname / DNS Record, and follow the Examples below. This Setup is done on the current Version, 6.9. Have Fun ! Inspired by: https://dev.to/nabbisen/nextcloud-on-openbsd-installation-15d6 Packages install some packages. i use sqlite as db because i don’t expect a lot of users/traffic/files.

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

Cheatsheet

Curl from @linuxopsys NMAP from @hackingarticles 5 Years Later, Is Docker Still Delivering ? Beginner Python CheatSheet NoStarch Docker CLI Cheat Sheet Docker Command Cheat Sheet Visual Studio Code for macOS Linux Netzplan CT Ansible Edureka Windows Events NMAP SQL Stuff Bash Convention and Libraries Assembler 80186 and higher HTTP Status Codes Python Cheatsheet - Olivier La Flamme Data Wrangling with pandas Cheat Sheet OWASP Key Management Cheat Sheet Python Cheatsheet

OpenBSD & PHP Stuff 7.4

Install NGINX & PHP pkg_add nginx php--%7.4 rcctl enable nginx php74_fpm Edit php.ini sed -i s'/date.timezone = UTC.*/date.timezone = Europe\/Zurich/' /etc/php-7.4.ini sed -i s'/short_open_tag = Off.*/short_open_tag = On/' /etc/php-7.4.ini Stop 7.3 & Start 7.4 rcctl stop php73_fpm rcctl restart nginx php74_fpm Uninstall PHP 7.3 pkg_del php--%7.3 pkg_del -a Any Comments ? sha256: 850d0140d76843ff867fcf764ff3313d19cf8d967c611e180b6a264e7bc274c4

Hugo Forms PHP

Wanna add some simple forms and process the Content with PHP ? Add RawHTML Template if not yet done mkdir layouts/shortcodes/ cat << 'EOF' > layouts/shortcodes/rawhtml.html <!-- raw html --> {{.Inner}} EOF Create Script cat << 'EOF' > static/welcome.php <html> <body> Welcome <?php echo $_POST["name"]; ?><br> Your email address is: <?php echo $_POST["email"]; ?> </body> </html> EOF Create new Post and add rawhtml without " " between { and {

HugoIO Templates

Custom Template Stuff mkdir -p layouts/shortcodes cat << 'EOF' > layouts/shortcodes/date.html {{ now.Format "2006-01-02 03:04:05" }} EOF Insert Code in Template current date ? { {< date >} } Result ? current date ?? 2024-03-10 08:37:34 Add RawHTML Create Template cat << 'EOF' > layouts/shortcodes/rawhtml.html <!-- raw html --> {{.Inner}} EOF Add Code { {< rawhtml >} } <p class="speshal-fancy-custom"> This is <strong>raw HTML</strong>, inside Markdown. </p> { {< /rawhtml >} } Result ?

Tweak Nginx Webserver with limited Client Certificate

Install NGINX & PHP pkg_add nginx php--%7.3 rcctl enable nginx php73_fpm Edit php.ini sed -i s'/date.timezone = UTC.*/date.timezone = Europe\/Zurich/' /etc/php-7.3.ini sed -i s'/short_open_tag = Off.*/short_open_tag = On/' /etc/php-7.3.ini nginx.conf mkdir /var/log/nginx cat << 'EOF' > /etc/nginx/nginx.conf worker_processes 1; worker_rlimit_nofile 1024; events { worker_connections 800; } http { include mime.types; default_type application/octet-stream; index index.php index.html index.htm; keepalive_timeout 65; server_tokens off; proxy_cache_valid any 0s; log_format main '$remote_addr - $ssl_client_serial - [$time_local] - "$request" - $status - $body_bytes_sent'; map $ssl_client_serial $ssl_access { default 0; WFuDgzQBZXV740D3 1; # Hans Muster EDugUslEX1Et90WX 0; # Beat Breu 2DF3C663741296F5 1; # Ruedi Ruessel } # # HTTP -> Redirect to HTTPS # server { listen 80; server_name localhost; access_log logs/host.

Librenms on Debian 10.3

How to Install LibreNMS on Debian https://docs.librenms.org/Installation/Installation-Ubuntu-1804-Apache/ Packages apt-get install acl apache2 borgbackup curl fping hping3 htop ipcalc jq lftp lynx mlocate mtr nmap pwgen rsync sipcalc tmate tree tshark unzip vim vnstat wget zip curl apache2 composer fping git graphviz imagemagick python-memcache python-mysqldb rrdtool snmp snmpd whois mariadb-client mariadb-server mtr-tiny nmap libapache2-mod-php7.3 apt-get install php7.3-cli php7.3-curl php7.3-gd php7.3-json php7.3-mbstring php7.3-mysql php7.3-snmp php7.3-xml php7.3-zip add User useradd librenms -d /opt/librenms -M -r usermod -a -G librenms www-data get Git cd /opt git clone https://github.