Skip to content

Instantly share code, notes, and snippets.

View arkenidar's full-sized avatar

Dario Cangialosi arkenidar

View GitHub Profile
@arkenidar
arkenidar / sync_task.bash
Created March 23, 2024 15:22
sync task (from local workspace to remote filesystem). note: vice-versa is possible also (invert order of source and destination arguments and tweak them accordingly).
## add the following line ...
# source "$HOME/sync_task.bash"
## ... to "$HOME/.bashrc" (BASH initialization hidden file)
function sync_task(){
# note: vice-versa is possible also (invert order of source and destination arguments and tweak them accordingly).
rsync -zarv --delete /c/0/Dropbox/desktop root@synbox.freeddns.org:/root && printf "\n\n *rsync-complete* \n\n"
printf "\n\n hint: type 'sync_task' to do it again \n\n"
}
@arkenidar
arkenidar / .htaccess
Last active November 29, 2023 12:07
Apache ".htaccess" configuration for e.g. Wordpress.org, UTF-8, PHP "extended" file handling (e.g. "style.css.php" as "style.css" (by PHP handler) BTW see also Sublime Text for "file.css.php" and or "file.js.php" ).
# Apache ".htaccess" configuration for e.g. Wordpress.org,
# UTF-8, PHP "extended" file handling
# (e.g. "style.css.php" as "style.css" (by PHP handler)
# BTW see also Sublime Text for "file.css.php" and or "file.js.php" ).
### https://gist.github.com/arkenidar/80e05f8bf3c3115ae802748eb6d64aca
### https://arkenidar.com/code/httpd_apache/_.htaccess
### https://help.servmask.com/2018/10/27/how-to-increase-maximum-upload-file-size-in-wordpress/
php_value upload_max_filesize 1000M
@arkenidar
arkenidar / go-to.lua
Created September 27, 2023 19:05
not-wrong, useful and common use cases of "Lua's go-to"
--[[ "break" as key-word breaks only the inner-most loop when nesting loops ]]
--[[ "goto" to exit/break nested loops ]]
--[[ "goto" to emulate "continue" and "redo", besides "break" key-word]]
--[[ other cases possible ]]
--[[ limitation: in Lua you can "go to" only to local "goto-labels", local to the scope/function]]
local redo_limit = false
for i=1,5 do
:: redo :: -- redo as a label
@arkenidar
arkenidar / build-exec.cmd
Last active September 19, 2023 19:16
SimpleAssembler aka SASM in Ubuntu and Windows
C:/apps/simple-asm/GAS/64/as.exe pclinwin.s -o program.o --64
C:/apps/simple-asm/MinGW64/bin/gcc.exe program.o -g -o program.exe -m64
@arkenidar
arkenidar / setup-zerobrane.sh
Created September 3, 2023 14:40
[sh, git, wget] ZeroBraneStudio con *lingua italiana* attivata e menù *inserisci carattere tilde*
echo [requisiti] richiede *git* e *wget* -------------------------------
echo [1/3] ZeroBraneStudio da github -------------------------------
git clone https://github.com/pkulchenko/ZeroBraneStudio
echo [2/3] configura lingua italiana, *it* -------------------------------
printf "\n language = 'it' \n" >> ZeroBraneStudio/cfg/user.lua
echo [3/3] estensione per carattere *tilde* -------------------------------
wget https://raw.githubusercontent.com/pkulchenko/ZeroBranePackage/master/tildemenu.lua
@arkenidar
arkenidar / CMakeLists-1-SDL.txt
Created August 15, 2023 09:47
CMake for OpenGL projects
### https://github.com/arkenidar/sdl2-gl
# cmake -S . -B build && cmake --build build && build/app
# cmake -S . -B build -G "Ninja" && cmake --build build && build/app
# cmake -S . -B build -G "CodeBlocks - Ninja" && cmake --build build && build/app
# cmake -S . -B build -G "Visual Studio 17 2022" && cmake --build build && build/app
cmake_minimum_required(VERSION 3.18)
@arkenidar
arkenidar / rsync-backup-www.sh
Last active September 2, 2023 08:52
download backup /root /etc/apache2 /var/www via rsync (and ssh)
#!/usr/bin/env bash
# env RSOPT="--dry-run" ~/Dropbox/my-www/rsync-backup-www.sh
# env RSOPT="--dry-run --delete" ~/Dropbox/my-www/rsync-backup-www.sh
HOST=arkenidar.com
THIS=backup-www
DEST="$(dirname "$BASH_SOURCE")/$THIS"
## DEST=~/Dropbox/my-www/$THIS # for GNU-Linux
@arkenidar
arkenidar / calcoli.lua
Created July 15, 2023 07:04
dualismi in matematica: origini comuni di somma & sottrazione e come dalla somma derivi la moltiplicazione e dalla sottrazione derivi la divisione, moltiplicazione & divisione. la matematica è piena di operazioni inverse, e le operazioni vengono derivate ... ovvero vengono definite servendosi di definizioni precedenti, da cui "derivano".
--[[
dualismi in matematica:
- moltiplicazione come somma e suo inverso la divisione mediante sottrazioni (o altre implementazioni a parità di risultati)
- somma algebrica con riporto (carry) o prestito (borrow) che sono uno il duale dell'altro come moltiplicazione e somma sono uno l'inverso dell'altro
(spiegazioni intuitive non con linguaggio gergale necessariamente corretto).
si può vedere l'unità della parte comune che si diversifica specializzandosi, come da un arbusto gemmano ad esempio due rametti.
in particolare 2 data la struttura hardware del calcolatore elettronico binario (binario, base 2, due simboli, 0 e 1, detti 2 bits).
]]
@arkenidar
arkenidar / program_format.js
Last active February 8, 2023 08:28
program_format.json
// JSON format for programs
// *** FUTURE ***
///var main = ["$func","main",["arguments"],
//["$skip","console.log('output text', 'another output text')"],
//["$expr",["$attr","console"],["$attr","log"],["$call",["$val","output text"],["$val","another output text"]]],
//["$skip","document.querySelector('#site-navigation').style.backgroundColor='greenyellow'"],
@arkenidar
arkenidar / editor.lessons.html
Last active November 28, 2023 14:39
arkenidar.com/web/editor.html : spunti per lezioni, su questo editor come "lavagna"
<!-- https://arkenidar.com/web/editor.html -->
<!-- ------------------------------------------ -->
<!-- ------------------------------------------ -->
per andare
a capo
<br>
si usa &lt;br>
<!-- ------------------------------------------ -->
stili di testo: <em>parola1</em> <strong>parola2</strong>