Skip to content

Instantly share code, notes, and snippets.

View eliroca's full-sized avatar

Elisei Roca eliroca

  • Germany
  • 00:20 (UTC +02:00)
View GitHub Profile
@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.

@eliroca
eliroca / backup_raspberrypi.md
Last active January 17, 2024 10:58
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 / 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

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 / updating-systemd-qa-testsuite-package-for-tw-leap-or-sle.md
Last active August 26, 2020 10:45
Updating systemd's QA testsuite package for Tumbleweed, Leap or SLE

Updating systemd's QA testsuite package for Tumbleweed, Leap or SLE

1. Branch a systemd package, but make sure it's the right one that you need

# For Tumbleweed, add --nodevelproject, otherwise osc branches Base:System/systemd
 osc branch --nodevelproject openSUSE:Factory systemd home:eroca:branches:openSUSE:Factory systemd-v245-testsuite

2. Checkout the newly created package

@eliroca
eliroca / mediagoblin-deployment-opensuse.md
Last active December 2, 2020 11:40
MediaGoblin deployment on openSUSE

Deploy MediaGoblin

Due to locked dependencies in the project's setup.py, it only works on Leap 15.2 for now.

Install MediaGoblin and its requirements

For a production deployment, you’ll also need Nginx as frontend web server and RabbitMQ to store the media processing queue, as well as PostgreSQL as database. Since I've failed to configure PostgreSQL, it's not covered in this document. Nginx configuration will be added soon™.

sudo zypper addrepo https://download.opensuse.org/repositories/home:/eroca/openSUSE_Leap_15.2/home:eroca.repo
sudo zypper --gpg-auto-import-keys refresh
#/usr/bin/env sh
# Get the Zone ID from: https://www.cloudflare.com/a/overview/<your-domain>
DNS_ZONE=***
# Get the existing identifier for DNS entry:
# https://api.cloudflare.com/#dns-records-for-a-zone-list-dns-records
IDENTIFIER=***
# Get these from: https://www.cloudflare.com/a/account/my-account
@eliroca
eliroca / bt-headset-hack.sh
Created April 23, 2021 19:17 — forked from s-leon/bt-headset-hack.sh
bt-headset-hack.sh
#!/bin/bash
# add pulseaudio-modules-bt from home:MasterPatricko for ldac codec
echo -e "pair 38:18:x:xx:xx:xx\nyes" | bluetoothctl
sleep 2
bluetoothctl -- trust 38:18:x:xx:xx:xx
bluetoothctl -- connect 38:18:x:xx:xx:xx
sleep 2
bluetoothctl -- disconnenct 38:18:x:xx:xx:xx
sleep 2
pulseaudio -k && pulseaudio --start
@eliroca
eliroca / merger.py
Created December 9, 2021 20:47 — forked from emakarov/merger.py
Python script that can resolve all git conflicts in some file marked with conflicts based on chosen strategy
accept = 'ours' # ours for 'HEAD' #theirs for other's - choose strategy here for all conflicts
filename = 'enter your filename here'
fresult = '{}.{}'.format(filename, 'merged') # result will be near your file with name `original_filename.ext.merged`
with open(filename) as f:
content = f.readlines()
res = open(fresult, 'w')
to_write = True
merging = False
@eliroca
eliroca / .screenrc
Created October 17, 2022 08:06 — forked from joaopizani/.screenrc
A killer GNU Screen Config
# the following two lines give a two-line status, with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
# huge scrollback buffer
defscrollback 5000
# no welcome message
startup_message off