Skip to content

Instantly share code, notes, and snippets.

View dimitar-grigorov's full-sized avatar

Dimitar Grigorov dimitar-grigorov

View GitHub Profile
@dimitar-grigorov
dimitar-grigorov / add_watermark.sh
Created February 20, 2024 10:11
Add watermark to images Linux/Mac
#!/bin/bash
# Пътя до текущата директория
CURRENT_DIRECTORY="$(pwd)"
# Директория за обработените изображения
OUTPUT_DIRECTORY="$CURRENT_DIRECTORY/processed"
# Създаване на директорията за обработените изображения, ако не съществува
mkdir -p "$OUTPUT_DIRECTORY"
@dimitar-grigorov
dimitar-grigorov / add_watermark.bat
Created February 20, 2024 09:26
Add watermark to images
@echo off
setlocal enabledelayedexpansion
:: Директория с изображенията за обработка
set "INPUT_DIRECTORY=D:\images-test"
:: Директория за обработените изображения
set "OUTPUT_DIRECTORY=D:\images-test\processed"
:: Начален номер на водния знак
@dimitar-grigorov
dimitar-grigorov / tasmota-xy-wpce-xy-wpcl.md
Created December 18, 2022 19:10
Tasmota flash guide for Sinilink PCIe Computer Remote XY-WPCE or XY-WPCL

Short the IO0 pin and Ground pin to enter in flash mode.

Use this template:

{"NAME":"XY-WPCL","GPIO":[0,0,320,0,0,224,0,32,160,0,0,0,0,0],"FLAG":0,"BASE":18, "CMND":"SO114 1 | Pulsetime 10 | SwitchMode1 2"}

In Home assistant use this template

switch:
 - platform: template

Chocolatey personal list

Install Chocolatey (copied from https://chocolatey.org/install)

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

Bare minimum

choco install -y 7zip adobereader directx googlechrome jre8 potplayer qbittorrent rustdesk vlc winamp ` 
 k-litecodecpackmega ublockorigin-chrome notepadplusplus libreoffice-fresh

List PDF files print dimensions

Quick and dirty way to list pdf print dimensions in directory structure.

find -name "*.pdf" -o -name "*.PDF" > pdf.txt  
#!/bin/bash
@dimitar-grigorov
dimitar-grigorov / Linux-VNC-server-on-login-screen.md
Last active April 20, 2020 23:07
Linux - VNC server on login screen

Install x11vnc and configure it to work on login screen.

The problem

It is not easy to find how to configure VNC server to start at boot with the following requirements:

  • Provides direct control of the local X session which (usually) is running on the physical monitor.
    Most of the guides are about virtual screen rather than a physical one.
  • Works on login screen after boot.
  • It works even without logged in user.
@dimitar-grigorov
dimitar-grigorov / configure_antimer_crontab.md
Last active December 3, 2019 06:47
Antminer cron daemon config

Antminer crontab service configuration.

In Antminer S9 firmware there is crontab executable installed, but it is not configured as a daemon.

Here is how to configure it:

  1. Create daemon config file /etc/init.d/cron with the contents of the cron file at the bottom of the gist.
  2. Make it executable
chmod 755 /etc/init.d/cron
@dimitar-grigorov
dimitar-grigorov / Linux-Forward-Local-User-Mail-Postfix.md
Last active March 18, 2022 08:09
Linux forward local user mails to external e-mail address via Postfix