Skip to content

Instantly share code, notes, and snippets.

View JBlond's full-sized avatar

Mario JBlond

  • Germany
  • 04:23 (UTC +01:00)
View GitHub Profile
@JBlond
JBlond / branding_22.diff
Created March 9, 2018 13:15
branding apache
--- include/ap_branding.h 2014-08-22 12:13:35.648000000 -0700
+++ include/ap_branding.h 2014-08-28 16:21:34.234800000 -0700
@@ -0,0 +1,36 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
@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 November 13, 2025 14:30 — 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