Skip to content

Instantly share code, notes, and snippets.

View mbijon's full-sized avatar
🎯
Focusing

Mike Bijon mbijon

🎯
Focusing
View GitHub Profile
@mbijon
mbijon / lock-plugins.php
Created August 26, 2016 02:17 — forked from daggerhart/lock-plugins.php
Simple plugin that prevents requests for updats for a given list of plugins.
<?php
/*
* Plugin Name: Lock plugin updates
* Description: Prevent plugin updates
* Version: 1.0.0
* Author: daggerhart
*/
add_filter( 'http_request_args', 'lock_plugins_http_request_args', 5, 2 );
@mbijon
mbijon / rebuld_nginx_with_pagespeed.sh
Created June 27, 2016 14:46 — forked from gottaloveit/rebuld_nginx_with_pagespeed.sh
This is a script for Debian/ Ubuntu that will rebuild the latest Nginx deb package from nginx.org with Google Pagespeed. There are a couple other modules the script will prompt you to ask if you want to remove them. They are http-dav, http-flv, http-mp4, mail, mail_ssl. Will prompt to add http-geoip and ask if you want to change the nginx user t…
#!/bin/bash
echo "This script will rebuild a Debian style package (deb) of latest stable"
echo "Nginx. The original deb is from nginx.org apt repository."
echo
echo "This will prompt you yes or no on a few changes to the build as well as"
echo "it will compile and package the latest Google NGX Pagespeed module."
echo
echo "This is built and tested on Ubuntu 14.04 LTS, fresh OS install."
echo "There are no guarantees, and I take no liability if it breaks, but it"
@mbijon
mbijon / pg-pong.py
Created June 1, 2016 14:35 — forked from karpathy/pg-pong.py
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
177 read,my_real_read,my_net_read,do_command,do_handle_one_connection,handle_one_connection,start_thread,clone
8 pthread_cond_wait@@GLIBC_2.3.2,inline_mysql_cond_wait,optimized,optimized,do_handle_one_connection,handle_one_connection,start_thread,clone
4 __lll_lock_wait_private,_L_lock_9495,malloc,mem_heap_create_block,mem_heap_create_func,row_sel_store_mysql_rec,row_search_for_mysql,ha_innobase::general_fetch,join_read_next_same,sub_select,do_select,JOIN::exec,mysql_select,handle_select,execute_sqlcom_select,mysql_execute_command,mysql_parse,dispatch_command,do_handle_one_connection,handle_one_connection,start_thread,clone
3 __lll_lock_wait_private,_L_lock_5189,_int_free,mem_heap_block_free,mem_heap_free_func,row_sel_store_mysql_rec,row_search_for_mysql,ha_innobase::general_fetch,handler::read_multi_range_next,QUICK_RANGE_SELECT::get_next,rr_quick,sub_select,do_select,JOIN::exec,mysql_select,handle_select,execute_sqlcom_select,mysql_execute_command,mysql_parse,dispatch_command,do_handle
#!/usr/bin/env bash
UPDATE_ELB_POLICY=${UPDATE_ELB_POLICY:-0};
TMPFILE=`mktemp -t example.XXXXXXXXXX` && {
printf "Region|Status|Current security policy|Expected security policy|ELB|Action\n" >> "${TMPFILE}";
aws ec2 describe-regions |awk -F'"' '/RegionName/ {print $4}' | while read region; do
LATEST_PREDEFINED_SECURITY_GROUP=$(aws --region=$region elb describe-load-balancer-policies | grep -i PolicyName | awk -F '"' '{print $4}' | head -n1 | sed 's/[ \r\n]//g');
@mbijon
mbijon / ssh-known-hosts-mgmt.sh
Last active March 23, 2016 21:03 — forked from bradland/ssh-known-hosts-mgmt.sh
SSH known_hosts tools
# This is a short collection of tools that are useful for managing your
# known_hosts file. In this case, I'm using the '-f' flag to specify the
# global known_hosts file because I'll be adding many deploy users on this
# system. Simply omit the -f flag to operate on ~/.ssh/known_hosts
# Add entry for host
ssh-keyscan -H github.com > /etc/ssh/ssh_known_hosts
# Add IP-based entry for current IP
ip=$(dig +short github.com A)
@mbijon
mbijon / komodo_php_beautifier
Created February 24, 2016 18:50 — forked from florinel-chis/komodo_php_beautifier
Macro for Komodo Edit - PHP Beautifier
try {
if (komodo.view.scintilla) { komodo.view.scintilla.focus(); }
var currentPos = komodo.editor.currentPos;
var ke = komodo.editor;
var file = komodo.interpolate('%F');
var php = komodo.interpolate('%(php)');
var script = "/usr/local/zend/bin/php_beautifier"//this can be changed to the path of php_beautifier, install using PEAR
var cmd = script+" --filters='ArrayNested()' "+file; // add options dialog&#63;
StatusBar_AddMessage("Beautifying "+file,"editor",5000,true);
@mbijon
mbijon / algol_svd.py
Created January 29, 2016 09:07
Almost exact translation of the ALGOL SVD algorithm published in Numer. Math. 14, 403-420 (1970) by G. H. Golub and C. Reinsch -- http://161.111.227.80/compbio/material/algoritmos3D/files/SVD.py
# Almost exact translation of the ALGOL SVD algorithm published in
# Numer. Math. 14, 403-420 (1970) by G. H. Golub and C. Reinsch
#
# Copyright (c) 2005 by Thomas R. Metcalf, helicity314-stitch <at> yahoo <dot> com
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
@mbijon
mbijon / Capfile
Created January 25, 2016 09:04 — forked from paulredmond/Capfile
Capistrano deploy recipe for Media Temple Grid Service. This particular recipe is for a Railsless deploy of WordPress.
require 'rubygems'
require 'railsless-deploy'
load 'config/deploy'
@mbijon
mbijon / gist:22d3c28c65b7475bcb6d
Last active January 11, 2016 01:33
Excel pluralization of formats so vendor data matches bulk names
=IF(RIGHT(F2,1) = "s", F2, IF(RIGHT(F2,1) = "h", CONCATENATE(F2, "es"), CONCATENATE(F2, "s")))