Skip to content

Instantly share code, notes, and snippets.

@beppe9000
beppe9000 / ghetto.md
Last active Nov 20, 2020 — forked from dusta/Deploy_on_cPanel.md
Ghetto Deployment
View ghetto.md

Deploy your site with git on cPanel

The most important: You must have shell access!

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
@beppe9000
beppe9000 / LICENSE.txt
Created Aug 19, 2020 — forked from azproduction/LICENSE.txt
A turing machine in 79! bytes of javascript
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@beppe9000
beppe9000 / JunctionPoint.cs
Last active Apr 10, 2020 — forked from LGM-AdrianHum/JunctionPoint.cs
Create, Delete and Examine Junction Points in C#
View JunctionPoint.cs
// File: RollThroughLibrary/CreateMaps/JunctionPoint.cs
// User: Adrian Hum/
//
// Created: 2017-11-19 2:46 PM
// Modified: 2017-11-19 6:10 PM
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Runtime.InteropServices;
@beppe9000
beppe9000 / # Peachpie.NET Example
Last active Mar 20, 2020
Minimum Complete usage of compiling a PHP script with Peachpie.NET
View # Peachpie.NET Example
Run the `START.BAT`file to compile the php script and run the resulting exe.
This is the final example from https://github.com/peachpiecompiler/peachpie/issues/708
@beppe9000
beppe9000 / console.js
Last active Mar 17, 2020
Selects "Show Me" for all search fields of phonescoop.com search. Copy/paste the code in the devtools js console to use.
View console.js
(function() { //@see https://stackoverflow.com/a/26573281/3389585
function l(u, i) {
var d = document;
if (!d.getElementById(i)) {
var s = d.createElement('script');
s.src = u;
s.id = i;
d.body.appendChild(s);
}
}
@beppe9000
beppe9000 / my.cnf
Created Jan 22, 2020 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers)
View my.cnf
# 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 Jun 28, 2019
JQUERY QUICK TARGETED OVERLAY
View overlay.js
$("<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 Jan 27, 2021 — forked from magnetikonline/dumprequest.php
PHP script to dump full HTTP request to file (method, HTTP headers and body).
View dumprequest.php
// 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 Dec 12, 2018
Import-Module prodKey.ps1 -> Windows Product Key
View prodKey.ps1
## 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 Jun 6, 2017
2-column mode table from JSON associative array
View 2coltableFnction.js
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>');