Skip to content

Instantly share code, notes, and snippets.

View JBlond's full-sized avatar

Mario JBlond

  • Germany
  • 19:28 (UTC +02:00)
View GitHub Profile
@JBlond
JBlond / aprutilx4h-win.patch
Created February 9, 2018 08:31
aprutilx4h-win.patch
Index: Apache.dsw
===================================================================
--- Apache.dsw (revision 1816075)
+++ Apache.dsw (working copy)
@@ -494,6 +494,9 @@
Begin Project Dependency
Project_Dep_Name apriconv
End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name xml
#!/bin/bash
# find-out-what-is-using-your-swap.sh
# -- Get current swap usage for all running processes
# --
# -- rev.0.3, 2012-09-03, Jan Smid - alignment and intendation, sorting
# -- rev.0.2, 2012-08-09, Mikko Rantalainen - pipe the output to "sort -nk3" to get sorted output
# -- rev.0.1, 2011-05-27, Erik Ljungstrom - initial version
@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
@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
<?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 / 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);
#!/bin/env sh
lines=$(tput lines)
cols=$(tput cols)
awkscript='
{
letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"
lines=$1
@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;
@JBlond
JBlond / bash-colors.md
Last active August 28, 2025 14:15 — 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 / 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'));