This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Saving Value in to /dev/shm | |
See: https://gerardnico.com/os/linux/shared_memory | |
Usage: | |
myapp.py | |
----------------------------------------- | |
ds = DevShm('myapp') | |
idx = int(ds.get('index', 0)) | |
print('My App index:', idx) | |
idx += 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Animation for long string | |
Usage: | |
myapp.py: | |
----------------------------------------------------------------------------------- | |
line = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod' | |
idx = 0 | |
while True: | |
idx, short_line = line_animation(line, idx, 5) | |
print(short_line, end='\r') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$driver = getenv('DB_DRIVER') ?: 'pgsql'; | |
$host = getenv('DB_HOST') ?: 'localhost'; | |
$port = getenv('DB_PORT') ?: 5432; | |
$dbname = getenv('DB_NAME'); | |
$user = getenv('DB_USER'); | |
$pass = getenv('DB_PASSWORD'); | |
$dsn = sprintf('%s:host=%s;port=%d;dbname=%s', $driver, $host, $port, $dbname); | |
$tries = 10; | |
while (true) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
COMPOSER_BIN=/usr/local/bin/composer | |
if [ "$SKIP_COMPOSER" == "false" ]; then | |
if [ ! -f $COMPOSER_BIN ]; then | |
curl -sS https://getcomposer.org/installer | php | |
mv composer.phar $COMPOSER_BIN | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""DBus Display Manager Session Lock | |
@author Evgenii Danilin <evgenii.danilin.m@gmail.com | |
""" | |
import dbus # type: ignore | |
SERVICE_NAME = 'org.freedesktop.DisplayManager' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# webm2mp4.desktop | |
# KDE | Dolphin | Service menu | Convert WebM to MP4 | |
# --- INSTALL --- | |
# 1. Copy `webm2mp4.desktop` to `$HOME/.local/share/kservices5/ServiceMenus/` | |
# 2. Update entries `kbuildsycoca5` | |
[Desktop Entry] | |
Type=Service | |
Icon=video-webm | |
X-KDE-ServiceTypes=KonqPopupMenu/Plugin |