Skip to content

Instantly share code, notes, and snippets.

View beppe9000's full-sized avatar

beppe9000

View GitHub Profile
@beppe9000
beppe9000 / my.cnf
Created January 22, 2020 14:08 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers)
# Optimized my.cnf configuration for MySQL/MariaSQL
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated January 2020 ~
#
#
# The settings provided below are a starting point for a 2GB - 4GB RAM server with 2-4 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
@beppe9000
beppe9000 / overlay.js
Created June 28, 2019 16:12
JQUERY QUICK TARGETED OVERLAY
$("<div>&nbsp;</div>").css({ // https://stackoverflow.com/a/13755589/3389585
position: "absolute",
width: "100%",
height: "100%",
top: 0,
left: 0,
background: "#cccccc",
opacity:0.5
}).appendTo($("#target").css("position", "relative"));
@beppe9000
beppe9000 / dumprequest.php
Last active January 27, 2021 12:23 — forked from magnetikonline/dumprequest.php
PHP script to dump full HTTP request to file (method, HTTP headers and body).
// usage: logRequest("/tmp/post-".time().".log");
function logRequest($targetFile){ $headerList = []; foreach ($_SERVER as $name => $value) { if (preg_match('/^HTTP_/',$name)) { // convert HTTP_HEADER_NAME to Header-Name $name = strtr(substr($name,5),'_',' '); $name = ucwords(strtolower($name)); $name = strtr($name,' ','-'); $headerList[$name] = $value; } } $data = sprintf("%s %s %s\n", $_SERVER['REQUEST_METHOD'], $_SERVER['REQUEST_URI'], $_SERVER['SERVER_PROTOCOL']); foreach ($headerList as $name => $value) { $data .= $name.': '.$value."\n"; } $data .= "\n"; file_put_contents($targetFile, $data.file_get_contents('php://input')."\n"); }
@beppe9000
beppe9000 / prodKey.ps1
Created December 12, 2018 00:15
Import-Module prodKey.ps1 -> Windows Product Key
## Taken from https://nedimmehic.org/2017/02/17/how-to-find-windows-product-key-allversions-of-windows/
function Get-WindowsKey {
## function to retrieve the Windows Product Key from any PC
## by Nedim Mehic
param ($targets = ".")
$hklm = 2147483650
$regPath = "Software\Microsoft\Windows NT\CurrentVersion"
$regValue = "DigitalProductId"
Foreach ($target in $targets) {
@beppe9000
beppe9000 / 2coltableFnction.js
Created June 6, 2017 12:02
2-column mode table from JSON associative array
function writeTable(tbody, ark, title) {
var td_style = 'padding:5px 10px;border:1px solid black';
var tble_style = 'border:1px solid black';
tbody.empty();
$('<tr/>').appendTo(tbody).append('<th colspan="4"><b>'+title+'</b></td>');
var tr = $('<tr/>').appendTo(tbody);
ark.forEach(function(itm,idx){
console.log("ITM"+idx+": NN="+itm.nn+" BB="+itm.bb);
if (idx % 2 === 0) tr = $('<tr/>').appendTo(tbody);
tr.append('<td style="'+td_style+'">' + itm.nn + '</td>');
// ==UserScript==
// @name test @include
// @version 0.1
// @author ME
// @include http://*
// @include https://*
// ==/UserScript==
(function() {'use strict';alert(window.location);})();
@beppe9000
beppe9000 / b9k.userstation.user.js
Last active May 8, 2018 19:54
roba userscript vs3
/*
SE STAI LEGGENDO QUESTO TESTO PROBABILMENTE NON HAI ESTENSIONE DEL BROWSER PER ESEGUIRE GLI USERSCRIPT
AGGIUNGI L'ESTENSIONE GREASEMONKEY OPPURE TAMPERMONKEY AL TUO BROWSER E RIPROVA
*/
// ==UserScript==
// @name User Station | Beppe9000
// @namespace https://gist.github.com/beppe9000/ed330a6d58dea17a22728954487cd3d1
@beppe9000
beppe9000 / b9k.better.mal.user.js
Created March 22, 2017 01:02
My Anime List Quick Addd Button & Other Things - WIP
/*
* Questo è un blocco per gli appunti JavaScript.
*
*Inserire del codice JavaScript, fare clic con il tasto destro o selezionare dal menu Esecuzione:
* 1. Esegui per eseguire il codice selezionato (Ctrl+R)
* 2. Analizza per aprire una finestra di analisi oggetto sul risultato (Ctrl+I)
* 3. Visualizza per inserire il risultato come un commento dopo il testo selezionato. (Ctrl+L)
*/
//document.baseURI
//https://myanimelist.net/forum/?topicid=49347
@beppe9000
beppe9000 / DCSerializerTest.cs
Created February 11, 2016 19:24 — forked from theburningmonk/DCSerializerTest.cs
Testing DataContractSerializer in .Net 4.5.1 - Visual Basic
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Threading.Tasks
Imports System.Runtime.Serialization
Imports System.IO
Imports System.Xml
Namespace DCSerializerTest
<DataContract> _