Skip to content

Instantly share code, notes, and snippets.

View eliroca's full-sized avatar

Elisei Roca eliroca

  • Germany
  • 07:52 (UTC +02:00)
View GitHub Profile

xpath

xmllint --shell --noent MAIN.suse-openstack-cloud.xml

/ > setns docbook=http://docbook.org/ns/docbook
/ > setns xi=http://www.w3.org/2001/XInclude
xpath /docbook:set/xi:include/@href
Object is a Node Set :
Set contains 4 nodes:
@eliroca
eliroca / qt5_scale.md
Last active May 4, 2019 13:59
Fix QT5 apps out of scale

QT5 apps appear out of scale, icons are big, pixelated. This should fix it:

Add the following line in /etc/environment

QT_AUTO_SCREEN_SCALE_FACTOR=0

More info about QT5 scaling here

@eliroca
eliroca / backup_raspberrypi.md
Last active April 7, 2026 10:09
Use ssh and dd to Remotely Backup a Raspberry Pi

You can make a backup of your pi and have the backup written to your regular PC all from the command line.

From your local machine, run the remote backup command:

ssh pi@xx.x.x.xx "sudo dd if=/dev/mmcblk0 bs=1M | gzip -" | dd of=/path/to/pibackup.gz

After 47min 21sec, in my case, got this as output:

30436+1 records in
30436+1 records out
31914983424 bytes (32 GB, 30 GiB) copied, 2830.89 s, 11.3 MB/s
@eliroca
eliroca / disable_enforce2FA_setting.md
Last active September 20, 2021 17:33
Disable Enforce Two-factor Authentication (2FA) Setting on NextCloudPi

Using the occ command to disable Two-factor Authentication on NCP v1.10.0, NC v15.0.5

Nextcloud’s occ command (origins from “ownCloud Console”) is Nextcloud’s command-line interface. You can perform many common server operations with occ, such as installing and upgrading Nextcloud, manage users, encryption, passwords, LDAP setting, and more.

occ is in the nextcloud/ directory; for example /var/www/nextcloud on Raspbian. occ is a PHP script. You must run it as your HTTP user to ensure that the correct permissions are maintained on your Nextcloud files and directories.