This file contains hidden or 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/bash | |
# Script per installazione LAMP + Webmin su AlmaLinux 9 | |
# Versione: 1.1 | |
# Data: 2025 | |
set -e # Esce se qualsiasi comando fallisce | |
# Colori per output | |
RED='\033[0;31m' |
This file contains hidden or 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/bash | |
set -e # esce al primo errore | |
echo "➡️ Aggiorno pacchetti di sistema..." | |
sudo apt update | |
sudo apt install -y php8.2 php8.2-cli php8.2-dev php8.2-mbstring php8.2-xml php8.2-gmp php8.2-sqlite3 php-pear php8.2-curl php8.2-common unzip git gcc make autoconf bison re2c php8.2-apcu | |
echo "➡️ Abilito APCu..." | |
sudo phpenmod apcu |
This file contains hidden or 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
@ECHO OFF | |
setlocal enableextensions | |
::--------------------------------------------------------------- | |
:: DEFINE SETTING | |
::--------------------------------------------------------------- | |
SET h264_quality=26 | |
SET ext=*.MOV *.MTS *.AVI *.MP4 *.MPG | |
SET vlc_path=C:\Program Files\VideoLAN\VLC\vlc.exe |
This file contains hidden or 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
function frontColor (bgcolor) { | |
var m = bgcolor.substr(1).match(/(\S{2})/g); | |
if (m) { | |
var r = parseInt(m[0], 16), g = parseInt(m[1], 16), b = parseInt(m[2], 16); | |
return (((r*299)+(g*587)+(b*114))/1000) > 125 ? 'black' : 'white'; | |
} | |
return 'black'; | |
} |
This file contains hidden or 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
// https://medium.com/recraftrelic/es5-vs-es6-with-example-code-9901fa0136fc | |
//--- ES5 callBack | |
function isGreater (a, b, callBack) { | |
var greater = false | |
if(a > b) { | |
greater = true | |
} | |
callBack(greater) | |
} |
This file contains hidden or 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 | |
$jlang = <<<EOT | |
{ | |
"cancel":"Cancella", | |
"close": "Chiudi", | |
"copy": "Copia", | |
"delete": "Elimina", | |
"delete-confirm": "Confermi la cancellazione?", | |
"deleted": "Cancellato", | |
"disabled": "Disabilitati", |
This file contains hidden or 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
// main function | |
function afGroupBy2TreeMapArray(data, global='ciccio') { | |
let id = 1, | |
arr = data //create tree from flat array | |
.reduce((a, r) => { | |
let keys = Object.keys(r); | |
keys.reduce(function (q, k, i) { | |
const f = r[k]; | |
if (!q[f]) q._.push([{f:f, v:String(id++), k:k, level:i, childs:(q[f] = { _: [] })._} ]); | |
return q[f]; |
This file contains hidden or 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
Add-Type -assemblyName System.Windows.Forms;$a=@(1..100);while(1){[System.Windows.Forms.Cursor]::Position=New-Object System.Drawing.Point(($a|get-random),($a|get-random));start-sleep -seconds 5} |
This file contains hidden or 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
const getParameters = URL => JSON.parse(`{"${decodeURI(URL.split("?")[1]).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"')}"}`); | |
// getParameters("https://www.google.com.hk/search?q=js+md&newwindow=1"); | |
// {q: 'js+md', newwindow: '1'} | |
const uniqueArr = (arr) => [...new Set(arr)]; // unique array | |
const hashCode = (str) => [...str].reduce((s, c) => Math.imul(31, s) + c.charCodeAt(0) | 0, 0) >>> 0; // only positive numbers | |
const hashBCode = (str) => btoa([...str].reduce((s, c) => Math.imul(31, s) + c.charCodeAt(0) | 0, 0)); | |
const base62 = { | |
charset: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' | |
.split(''), |
This file contains hidden or 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
# other powershell snmp information | |
# https://solvedbypowershell.blogspot.com/2014/12/powershell-using-snmp-for-html-network.html | |
# https://www.powershellgallery.com/packages/Proxx.SNMP/1.0.1.2/Content/Invoke-SnmpGet.ps1 | |
# https://www.powershellgallery.com/packages/Proxx.SNMP/1.0.0.1/Content/Invoke-SnmpWalk.ps1 | |
# https://exchange.nagios.org/directory/Plugins/Hardware/Printers/SNMP-Printer-Check/details | |
# https://www.powershellgallery.com/packages/Proxx.SNMP/1.1.1.4 | |
# https://www.reddit.com/r/PowerShell/comments/77ls36/printer_page_counter_from_print_server/ | |
# https://gallery.technet.microsoft.com/Get-PrintStatistics-a6bb8323 | |
# https://gallery.technet.microsoft.com/scriptcenter/Script-to-generate-print-84bdcf69 |
NewerOlder