Skip to content

Instantly share code, notes, and snippets.

View msabramo's full-sized avatar

Marc Abramowitz msabramo

View GitHub Profile
#!/usr/bin/env python
import re
import sys
phperrors = file('phperrors')
applog_files = {}
def copy_line_to_applog(line, hour):
marca@web01:/www/marca/RC_20111215$ svn diff -c 88572
Index: Chegg.Business/ReturnPrintout.php
===================================================================
--- Chegg.Business/ReturnPrintout.php (revision 88571)
+++ Chegg.Business/ReturnPrintout.php (revision 88572)
@@ -204,14 +204,17 @@
$labelImages = $upsLabel->generateLabel();
if (!is_array($labelImages))
{
+ error_log(__FILE__ . ":" . __LINE__ . " - \$labelImages was not an array; \$labelImages = " . print_r($labelImages, true));
@msabramo
msabramo / IntegerSource.php
Created March 6, 2012 17:04
Playing with an abstraction for random number generators called IIntegerSource
<?php
interface IDebuggable
{
function setDebugLevel($debugLevel);
}
interface IIntegerSource
{
function __construct($min, $max);
@msabramo
msabramo / setup.py
Created March 19, 2012 16:18
A stab at a setup.py for pyp (pyed piper)
from distutils.core import setup
version = '2.11'
long_description = open('README.rst').read()
setup(name='pyp',
version=version,
description="Python Power At the Prompt",
long_description=long_description,
classifiers=[],
@msabramo
msabramo / config.nice.sh
Created April 1, 2012 14:50
This is the config.nice that I used to build PHP 5.3.10 with intl and readline on OS X 10.6.8
#! /bin/sh
#
# Created by configure
'./configure' \
'--prefix=/usr/local' \
'--mandir=/usr/share/man' \
'--infodir=/usr/share/info' \
'--sysconfdir=/private/etc' \
'--with-apxs2=/usr/sbin/apxs' \
@msabramo
msabramo / org.graylog2.graylog2-server.plist
Created April 8, 2012 06:26
OS X launchd plist for running graylog2-server
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.graylog2.graylog2-server</string>
<key>ProgramArguments</key>
<array>
<string>java</string>
<string>-jar</string>
@msabramo
msabramo / git_prompt_info.zsh
Created April 11, 2012 00:07
The slowness of my zsh prompt when in a git-svn managed directory was killing me. I improved it by removing the git status stuff that slows it down...
function git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$ZSH_THEME_GIT_PROMPT_SUFFIX"
}
@msabramo
msabramo / list_hostonly_addresses.rb
Created April 13, 2012 15:13
A crude way of getting all of the host-only IP addresses I've used for vagrant vms
#!/usr/bin/env ruby
require 'find'
def process_vagrantfile(vagrantfile)
box = nil
f = File.open(vagrantfile).each do |line|
if match = /^\s*config\.vm\.box = "([^"]+)"/.match(line) then
box = match[1]
File "/Users/marca/dev/git-repos/logan/logan/runner.py", line 128, in run_app
add_settings(settings_mod)
File "/Users/marca/dev/git-repos/logan/logan/settings.py", line 61, in add_settings
setattr(settings, setting, setting_value)
File "/www/sentry/lib/python2.7/site-packages/django/utils/functional.py", line 285, in __setattr__
self._setup()
File "/www/sentry/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
self._wrapped = Settings(settings_module)
File "/www/sentry/lib/python2.7/site-packages/django/conf/__init__.py", line 87, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Setting up Salt daemons to execute tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.....................................................++
.................................................................................................................................++
No handlers could be found for logger "salt.master"
No handlers could be found for logger "salt.minion"
.................................................................++
.........................................++
............................................FF.........