Skip to content

Instantly share code, notes, and snippets.

@dbeckham
dbeckham / ocp.php
Created January 8, 2016 15:56 — forked from ck-on/ocp.php
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)#ocp #php #opcache #opcode #cache #zend #optimizerplus #optimizer+
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.7
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.7 2015-09-01 regex fix for PHP7 phpinfo
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
# Syslog stuff
COMPONENT ([\w._\/%-]+)
COMPID postfix\/%{COMPONENT:component}(?:\[%{POSINT:pid}\])?
POSTFIX %{SYSLOGTIMESTAMP:timestamp} %{SYSLOGHOST:hostname} %{COMPID}: %{QUEUEID:queueid}
# Milter
HELO (?:\[%{IP:helo}\]|%{HOST:helo}|%{DATA:helo})
MILTERCONNECT %{QUEUEID:qid}: milter-reject: CONNECT from %{RELAY:relay}: %{GREEDYDATA:milter_reason}; proto=%{WORD:proto}
MILTERUNKNOWN %{QUEUEID:qid}: milter-reject: UNKNOWN from %{RELAY:relay}: %{GREEDYDATA:milter_reason}; proto=%{WORD:proto}
@dbeckham
dbeckham / .tmux.conf
Last active October 30, 2022 08:23
A simple tmux configuration file for remote servers.
#
# Custom tmux commands for remote servers
#
# Copy this to ~/.tmux.conf to enable
#
# Make splitting and resizing panes, and moving around emulate the vim
# directional keys
bind | split-window -h
bind _ split-window -v

The best way to use this tool is to hook apt's use of dpkg to run it before doing any package installs.

In your apt.conf, put this:

DPkg::Pre-Install-Pkgs {"xargs -rL1 bash /path/to/stripdeb.sh 2>&1 | logger -t stripdeb"}

Then, a demo:

% sudo apt-get install mysql-server-5.1

/* parser generated by jison 0.4.13 */
/*
Returns a Parser object of the following structure:
Parser: {
yy: {}
}
Parser.prototype: {
yy: {},
@dbeckham
dbeckham / carbon-cache.conf
Last active July 13, 2016 19:55
Graphite carbon-cache Upstart job - This upstart job attempts to duplicate the twistd configuration and command line options that carbon-cache.py uses, but will not daemonize so that an Ubuntu system can properly control carbon-cache. One caveat: the current version (as of 0.9.12) of the carbon code intentionally forces logging to STDOUT if the …
# carbon-cache-a upstart job
#
# Daniel Beckham
# @dbeckham
# https://github.com/dbeckham
#
# Tested with Graphite carbon tag v0.9.12 from:
# https://github.com/graphite-project/carbon
#
# Upstart config: /etc/init/carbon-cache-a.conf
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Last tested & updated 10/13/2011
####################################
GRAPHITE_VERSION=0.9.12
cd /tmp
@dbeckham
dbeckham / gist:7390806
Last active December 27, 2015 21:19
Taco Meat with Anche, Chipotle and Adobo Chilis
Ingredients:
2 pounds 80/20 hamburger
1 medium brown onion, finely chopped
2 lg cloves garlic, minced
2 tsp salt
2 tbs reconstituted Ancho chili pureed with water it was soaked in. (original was 1 tbs ground California chili)
2 chipotle chili from a can of chipotle en adobo, minced
1 tbs adobo from the same can
1 tsp black pepper
@dbeckham
dbeckham / saveas.vim
Created September 17, 2013 15:53
:Saveas[!] {file} Save the current buffer under the name {file} in the current buffer's path.
" :Saveas[!] {file}
"
" Saves the current buffer under the name {file} in the
" current buffer's path. Works like :saveas, but accepts
" a (relative) filename instead of the full path. File
" completion and ! are supported.
"
" Add to your ~/.vimrc and restart vim to enable
"
command -nargs=1 -complete=file_in_path -bang Saveas saveas<bang> %:h/<args>
[user]
name = Daniel Beckham
email = dbeckham@dealnews.com
[github]
user = dbeckham
[core]
editor = vim
[color]
ui = true
[alias]