Skip to content

Instantly share code, notes, and snippets.

View JBlond's full-sized avatar

Mario JBlond

  • Germany
  • 09:20 (UTC +02:00)
View GitHub Profile
@JBlond
JBlond / test0.bat
Last active February 3, 2017 14:16
test vbs script for apache on windows
@echo off
echo Content-Type: text/plain
echo.
dir
<h3>Ctrl+c Ctrl+v disabled</h3>
<textarea class="no-copy-paste"></textarea>
<br><br>
<h3>Ctrl+c Ctrl+v allowed</h3>
<textarea></textarea>
@JBlond
JBlond / HeidiDecode.js
Created June 19, 2017 09:31 — forked from jpatters/HeidiDecode.js
Decodes a password from HeidiSQL. HeidiSQL passwords can be found in the registry. Use File -> Export Settings to dump all settings. Great for if you forget a password.
function heidiDecode(hex) {
var str = '';
var shift = parseInt(hex.substr(-1));
hex = hex.substr(0, hex.length - 1);
for (var i = 0; i < hex.length; i += 2)
str += String.fromCharCode(parseInt(hex.substr(i, 2), 16) - shift);
return str;
}
document.write(heidiDecode('755A5A585C3D8141786B3C385E3A393'));
@JBlond
JBlond / bash-colors.md
Last active July 7, 2025 04:52 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@JBlond
JBlond / search.php
Last active January 7, 2025 11:50
search
<?php
protected function search($array, $key, $value)
{
$results = array();
if (is_array($array))
{
if (isset($array[$key]) && $array[$key] == $value)
$results[] = $array;
#!/bin/env sh
lines=$(tput lines)
cols=$(tput cols)
awkscript='
{
letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"
lines=$1
@JBlond
JBlond / print_r_color.php
Created December 15, 2017 14:20
print_r with color
<?php
function print_r_color($object, $die = false){
# insert span tags
$output = '';
$output = '<span class="die_value">'. $output;
$output = str_replace('[', '<span class="die_key">[\'', print_r($object,TRUE));
$output = str_replace(']', '\']</span>', $output);
$output = str_replace('=> ', '=> <span class="die_value">', $output);
<?php
/**
* Interactively prompts for input without echoing to the terminal.
* Requires a bash shell or Windows and won't work with
* safe_mode settings (Uses `shell_exec`)
*/
function prompt_silent($prompt = "Enter Password:") {
if (preg_match('/^win/i', PHP_OS)) {
$vbscript = sys_get_temp_dir() . 'prompt_password.vbs';
file_put_contents(
@JBlond
JBlond / whatever.sh
Last active January 7, 2025 11:52
apache env vars not loaded standard debian
source /etc/apache2/envvars
/usr/sbin/apache2ctl -S
@JBlond
JBlond / commands.sh
Last active January 24, 2018 13:19
most used commands
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | grep -v "ls" | grep -v "cd" | grep -v "exit" | column -c3 -s " " -t | sort -nr | nl | head -n10