Skip to content

Instantly share code, notes, and snippets.

View turric4n's full-sized avatar
🎯
Focusing

Turrican turric4n

🎯
Focusing
View GitHub Profile
@turric4n
turric4n / do-mysql-backups.sh
Created March 6, 2023 09:40
MySQL customizable backups with environment variables
#!/bin/bash
logger "Starting Mariadb backup job - "$(date)
export | logger
DB_NAMES="${BACKUP_DB_NAMES}"
IFS=', ' read -r -a array <<< "$DB_NAMES"
DB_NAME_LIST=($DB_NAMES)
DB_USER="root"
DB_PASSWORD="$MARIADB_ROOT_PASSWORD"
@turric4n
turric4n / u_class_colorbutton.pas
Created June 16, 2020 08:42
Delphi - Pascal Windows Color Button
unit u_class_colorbutton;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, StdCtrls, Buttons, ExtCtrls;
type
TColorButton = class(TButton)
private
@turric4n
turric4n / pararel_chunk.pas
Last active February 4, 2020 08:53
Delphi pararel chunk processing
var jobs := ['a'..'Z'];
var concurrent := 10;
chunksize := (High(jobs) + fconcurrent - 1) div fconcurrent;
for var t := 0 to High(jobs) do
begin
start := t * chunksize;
finish := Min(start + chunksize, High(jobs));
task.process(jobs[t]);
end;
@turric4n
turric4n / Dockerfile
Last active October 18, 2019 13:44
DotNetCore 3 + Ubuntu 19.04 with libgdiplus
FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-disco
EXPOSE 80/tcp
WORKDIR /app
COPY . ./
RUN apt-get update && apt-get install -y \
libc6-dev \
libgdiplus \
&& rm -rf /var/lib/apt/lists/*
ENTRYPOINT [ "dotnet", "Pisos.ThumbnailAlert.UI.dll" ]FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-disco
@turric4n
turric4n / RepairAPPX.md
Last active November 11, 2022 13:43
Repair APPX can be removed or reinstalled

Repair Windows APPX apps with broken implementation

Most of time we have to fight with Centenial/Universal Apps that are an hybrid thing... Aren't real Windows desktop applications because these are orchestrated and managed like an Android Application or IOS.

Installation of this APPS is a nightmare and most of the time is broken or buggy. So take care about everything related next.

If everything is ok and nothing is broken this would be sufficient : Get-AppXPackage | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"

@turric4n
turric4n / .pas
Created July 1, 2018 21:39
Parsing JSON for Ulugbek Nurjanov
program JSONParsingExample;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils,
System.Net.HttpClient,
System.Generics.Collections,
#ve a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: delete_indices
description: >-