Skip to content

Instantly share code, notes, and snippets.

Deactivating HDMI Power Saving Mode on Lubuntu

This guide demonstrates how to disable the HDMI power saving mode on Lubuntu and automatically execute a script during system startup to ensure the screen remains active.

Step 1: Creating the Bash Script

  1. Open a terminal.

  2. Create a Bash script named prevent_hdmi_sleep.sh:

@webghostx
webghostx / Copy-File-Path-from-Context-Menu-LXQt.md
Last active June 10, 2024 08:43
Copy File Path from Context Menu in LXQt/pcmanfm-qt

Copy File Path from Context Menu in LXQt/pcmanfm-qt

In this example, a function will be added to the context menu that allows copying the absolute file path or the path of a directory to the clipboard. The xclip package is used for this purpose. Alternatively, the xsel package can be used.

Instructions

  1. Create a .desktop file: Create the directory $HOME/.local/share/file-manager/actions/ if it doesn't already exist. This name is expected by LXQt and pcmanfm-qt. Create a file named like copy-path.desktop within that directory with the following content:
@webghostx
webghostx / open-webui-with-local-ollama.md
Last active June 2, 2024 09:09
Run Open WebUi in Docker with Ollama on the host

Run Open WebUi Container with Ollama on the host

The usual method to install Open WebUI with Ollama involves integrating Ollama directly into the container. However, if you intend to utilize Ollama independently for other purposes, it's preferable to exclude it.

Requirement:

Ollama must be installed e.g. with curl -fsSL https://ollama.com/install.sh | sh

Goal:

Integrate locally installed Ollama into Open WebUI while enabling access to Ollama from both within the Docker container and from the host.

@webghostx
webghostx / odrive.service
Last active February 16, 2021 20:16
Run odrive-agent in background
# systemd user unit to run odrive agent in the background
#
# odrive for linux: https://docs.odrive.com/docs/odrive-sync-agent#install-on-linux
# save this file as:
# ~/.config/systemd/user/odrive.service
# Create folder if not available. Ubuntu recognizes this directory for user units
#
# enable: $ systemctl --user enable odrive.service
# start: $ systemctl --user start odrive.service
# status: $ systemctl --user status odrive.service
@webghostx
webghostx / wp-content-filter-anchor-heading.php
Last active July 22, 2020 19:22
In Überschriften automatisch id-Attribut setzten und Anker-Link einfügen
<?php
/**
* Wordpress Content Filter
* Automatisch html-Anker Elemente in Überschriften setzen
*
* Im ersten Abschnitt (edit bis /edit) können Einstellungen vorgenommen werden.
*
* @author usysto https://usysto.net/wordpress-content-filter-anker-links-in-ueberschriften-ohne-plugin
* @copyright free
*/
@webghostx
webghostx / day-night-detection.py
Last active October 2, 2021 18:02
simple Day/Night detection in Python
#!/usr/bin/python
# -- coding: utf-8 --
'''
simple Day/Night detection in Python
require pyephem https://pypi.python.org/pypi/pyephem/
'''
import ephem
import time
@webghostx
webghostx / json-config.py
Last active March 4, 2017 17:04
Formatierte JSON Konfiguration in Python
from collections import OrderedDict # required for maintaining order data
import json
class AppConfig:
'''
sample config class
load and save readable
json configuration files
http://usysto.net/formatierte-json-konfiguration-python_846
@webghostx
webghostx / logger-json-config.py
Created January 28, 2017 16:19
Python Logger mit JSON Konfiguration
import logging
import logging.config
log = logging.getLogger(__name__)
logging.config.dictConfig({
"version": 1,
"disable_existing_loggers": "false",
"formatters": {
"simple": {
"format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
@webghostx
webghostx / log.conf.json
Last active January 28, 2017 16:11 — forked from gistsobo/log.conf
Python: json logger config
{
"version": 1,
"disable_existing_loggers": false,
"formatters": {
"simple": {
"format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
},
"brief": {
"format": "%(levelname)-9s: %(name)-11s: %(message)s"
},
@webghostx
webghostx / Apache-Default-Page-ersetzten.html
Last active December 18, 2016 18:05
Vorlage um die Apache Default Seite zu ändern
<!doctype html>
<html lang="de">
<head>
<meta charset="utf-8">
<title>Neue Produkte</title>
<meta name="description" content="Neue Produkte">
<meta name="author" content="exao.net">
<style>
</style>
<!--[if lt IE 9]>