Skip to content

Instantly share code, notes, and snippets.

View micheas's full-sized avatar

Micheas Herman micheas

View GitHub Profile
@micheas
micheas / oatmeal-cookies.md
Last active May 13, 2025 01:58
Oatmeal cookies recipie

Using blackstrap molasses as a substitute for brown sugar in oatmeal cookies is a great idea for a deeper flavor!:


Oatmeal Cookies with Blackstrap Molasses

Ingredients:

  • 2 cup (100g) quick oats
  • 1 cup (60g) all-purpose flour
  • 1/4 cup blackstrap molasses
@micheas
micheas / QBR-formula.xls
Created October 5, 2024 05:12
Pro football QBR rating formula
=((max(min(((C2/B2)-0.3)*5,2.375),0)+max(min(((D2/B2)-3)*0.25,2.375),0)+max(min((E2/B2)*20,2.375),0)+max((2.375-((F2/B2)*25)),0))/6)*100
@micheas
micheas / clone_alb.sh
Last active March 27, 2018 21:00
Clones a v2 elb/alb assumes that there is only a default route
#!/usr/bin/env bash
set -e
CURRENT_LB_NAME=$1
NEW_LB_NAME=$2
#AWS="aws --profile=prod"
AWS="aws"
LB=$($AWS elbv2 describe-load-balancers --names $CURRENT_LB_NAME | jq '.LoadBalancers[0]')
@micheas
micheas / Dockerfile
Created June 29, 2017 22:10
phpmemcachedadmin docker
FROM php:7.0-apache
COPY config/php.ini /usr/local/etc/php/
COPY phpmemcachedadmin-1.3.0/ /var/www/html/
RUN chown -R www-data /var/www/html/Config /var/www/html/Temp
@micheas
micheas / tmp_slave_fix.sh
Last active June 26, 2017 20:54
Mysql replication "fix" if you have a duplicate row and you are using statement or mixed mode replication this will skip the duplicate row.
#!/bin/bash
MYSQL_CONF=/data2/prod2/mysql/conf/debian.cnf
ERROR_NUMBER=$(sudo /usr/bin/mysql --defaults-file=$MYSQL_CONF -e 'show slave status\G' | grep Last.SQL.Errno | awk '{print($2)}')
if [ $ERROR_NUMBER -eq 1062 ]
then
echo "Error $ERROR_NUMBER occured, skipping"
sudo /usr/bin/mysql --defaults-file=$MYSQL_CONF -e 'SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;'
fi
@micheas
micheas / ocp.php
Created May 29, 2014 21:11 — forked from ck-on/ocp.php
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.6
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
0.1.5 2013-04-12 added graphs to visualize cache state, please report any browser/style bugs
@micheas
micheas / test.js
Created March 26, 2014 23:18
jQuery to convert html and html entities to plain text.
foo = '&amp; &acute; &grave;<span class="red">&reg;</span>'
bar = jQuery('<span>').html(foo).text()
alert(bar)
@micheas
micheas / puppet.precise.sh
Created January 6, 2014 23:42
A basic script that installs puppet on ubuntu 12.04 LTS
#!/bin/bash
wget http://apt.puppetlabs.com/puppetlabs-release-precise.deb
sudo dpkg -i puppetlabs-release-precise.deb
sudo apt-get update
sudo apt-get install puppet
rm puppetlabs-release-precise.deb
@micheas
micheas / admin2.php
Created March 6, 2013 06:43
Adds a super user named admin2 with the password secret into joomla 1.5. Handy if you only have ftp access to an an old joomla 1.5 install.
<?php
// works with joomla 1.5
// add user admin2
// password is secret
//
include 'configuration.php';
@micheas
micheas / drupal_bootstrap.php
Created January 25, 2013 01:42
Sample code to bootstrap drupal.
<?php
$_SERVER['HTTP_HOST'] = 'localhost'; // or the hostname of the drupal site you want to acces
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
chdir('../../../../..'); // modify as needed to get to the drupal root.
$current_drupal_root = getcwd() ;
define('DRUPAL_ROOT', $current_drupal_root);
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';