Skip to content

Instantly share code, notes, and snippets.

View theking2's full-sized avatar
🎯
contemplating the odds

Johannes Kingma theking2

🎯
contemplating the odds
View GitHub Profile
@theking2
theking2 / excerpt-setup.md
Last active March 6, 2026 16:41
Install Win11 on virtio scsi with kmu

Virtio DISK 1

<disk type="file" device="disk">
  <driver name="qemu" type="qcow2" cache="unsafe" discard="unmap"/>
  <source file="/var/lib/libvirt/images/win11.qcow2" index="3"/>
  <backingStore/>
  <target dev="vda" bus="virtio"/>
  <alias name="virtio-disk0"/>
  <address type="pci" domain="0x0000" bus="0x05" slot="0x00" function="0x0"/>
@theking2
theking2 / README.md
Last active February 25, 2026 09:45
copy path

Copy path

  1. upload the path.php to a location you want the path of
  2. run the https://<host>/path.php file, and click Copy path
  3. paste the path where you really need it.
#! /bin/bash
cp /etc/hosts.base ~/hosts
curl https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts >> ~/hosts
sudo mv ~/hosts /etc/hosts
sudo systemctl reload dnsmasq
@theking2
theking2 / nextcloud_report
Last active May 24, 2025 10:12
nextcloud support request
#!/bin/bash
reverse_proxy_version=$(docker container exec nginx-proxy nginx -v 2>&1 | head -n 1)
echo "
Some or all of the below information will be requested if it isn't supplied; for fastest response please provide as much as you can. :heart:
* Nextcloud Server version:
- \`$(docker container exec nextcloud php /var/www/html/occ --version)\`
ssh -t <servername> "sudo docker container logs <containername> --follow"
ssh -t srv-nas-pi "sudo docker container logs nextcloud --follow"
@theking2
theking2 / polishnotation.php
Last active July 9, 2025 13:16
Polish notation
<?php
/**
* Polish notation
* @param $expression - Space seperated operators and param indices
* @param $param - two or more params for the calculation
*/
function pn(string $expression, mixed ...$param) {
$operators = "+-*/%"; $delimiter = " ";
$expression = explode($delimiter, $expression);
@theking2
theking2 / import-dump.cmd
Created February 5, 2025 15:07
Import Mariadb Dump
@ECHO OFF
@ECHO Expanding
@tar -xf %1
@ECHO Importing
@"C:\wamp\bin\mariadb\mariadb10.6.18\bin\mysql.exe" --user=username --password=password database < %~n1
@ECHO Cleaning
@del %~n1
@theking2
theking2 / config.php
Last active March 5, 2026 06:01
docker-compose.yaml for nginx-proxy-manager with nextcloud
<?php
$CONFIG = [
'htaccess.RewriteBase' => '/',
'memcache.local' => '\\OC\\Memcache\\APCu',
'apps_paths' =>
[
[
'path' => '/var/www/html/apps',
'url' => '/apps',
'writable' => false,
@theking2
theking2 / css-units-best-practices.md
Last active October 6, 2024 08:43 — forked from basham/css-units-best-practices.md
CSS Units Best Practices

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px, vw, dvh, svh ch, ex, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units

This file has been truncated, but you can view the full file.
2024-07-03 19:29:48,804 14596 [INFO ] - [NuGet] OK https://community.chocolatey.org/api/v2/Packages(Id='nodejs',Version='12.6.0') 374ms
2024-07-03 19:29:48,809 14596 [INFO ] - [NuGet] GET https://community.chocolatey.org/api/v2/Packages(Id='nodejs.install',Version='12.6.0')
2024-07-03 19:29:49,282 14596 [INFO ] - [NuGet] OK https://community.chocolatey.org/api/v2/Packages(Id='nodejs.install',Version='12.6.0') 472ms
2024-07-03 19:29:49,285 14596 [INFO ] - [NuGet] GET https://community.chocolatey.org/api/v2/Packages(Id='nodejs',Version='12.5.0')
2024-07-03 19:29:49,416 14596 [INFO ] - [NuGet] OK https://community.chocolatey.org/api/v2/Packages(Id='nodejs',Version='12.5.0') 131ms
2024-07-03 19:29:49,419 14596 [INFO ] - [NuGet] GET https://community.chocolatey.org/api/v2/Packages(Id='nodejs.install',Version='12.5.0')
2024-07-03 19:29:49,933 14596 [INFO ] - [NuGet] OK https://community.chocolatey.org/api/v2/Packages(Id='nodejs.install',Version='12.5.0') 513ms
2024-07-03 19:29:49,936 14596 [INFO ] - [