Skip to content

Instantly share code, notes, and snippets.

View vmunix's full-sized avatar

Mark Mayo vmunix

View GitHub Profile
<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<service_bundle type='manifest' name='export'>
<service name='network/nginx' type='service' version='0'>
<create_default_instance enabled='true'/>
<single_instance/>
<dependency name='fs' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/system/filesystem/local'/>
</dependency>
<dependency name='net' grouping='require_all' restart_on='none' type='service'>
@vmunix
vmunix / vimrc
Created February 10, 2009 01:57
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
set background=dark
set title " set xterm title
set history=1000 " keep 1000 lines of command line history
#!bash
#
# bash completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
@vmunix
vmunix / mysqld_pid_fslatency.d
Created April 24, 2011 05:18
MySQL FS Latency DTrace script
#!/usr/sbin/dtrace -s
/*
* mysqld_pid_fslatency.d Print file system latency distribution every second.
*
* USAGE: ./mysqld_pid_fslatency.d -p mysqld_PID
*
*/
#pragma D option quiet
@vmunix
vmunix / mysql_pid_fslatency_slowlog0.d
Created April 24, 2011 05:33
MySQL slow queries caused by filesystem latency
#!/usr/sbin/dtrace -s
/*
* mysqld_pid_fslatency_slowlog0.d Print slow filesystem I/O events.
*
* USAGE: ./mysql_pid_fslatency_slowlog0.d mysqld_PID
*
* This traces all mysqld filesystem I/O (including some that may be
* asynchronous to queries and not causing query latency), and prints
* those individual I/O taking longer than the MIN_FS_LATENCY_MS tunable.
*
@vmunix
vmunix / gist:1067964
Created July 6, 2011 18:25
git log format
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
@vmunix
vmunix / gist:3923695
Created October 20, 2012 15:53 — forked from jedp/gist:3922102
Blog Draft - Tracking Down Memory Leaks in Node.JS

#Tracking Down Memory Leaks in Node.js

Last month, the Identity team at Mozilla delivered the first beta release of Persona. Getting to this point, we built a lot of tools to help us achieve the scalability and performance that Persona demands, and to help us with problems ranging from debugging to localization to dependency management and more. As a team, we hope our solutions will be useful to other developers, and of course we hope that other developers will help us make our tools even better. So we're kicking off a series of blog posts in which we're going to talk about

--
Join the fight against e-mail overload:
– Focus on your priorities; I'll understand if you don't reply.
– Sorry if I don't reply; I'm trying to focus, too.
– If it's urgent, reach me by Twitter or SMS.
namespace ConsoleApplication {
class Program
{
static void Main(string[] args)
{
List<int> things = new List<int>() { 10, 20, 31, 40 };
// ... Find index of first odd
int oddIndex = things.FindIndex(x => x % 2 != 0);
Console.WriteLine(oddIndex);
}

Keybase proof

I hereby claim:

  • I am vmunix on github.
  • I am markmayo (https://keybase.io/markmayo) on keybase.
  • I have a public key ASBtYRAaZwz_VbkM5KC9jLQ-lnPmJIEFAJTRJEMevkFKMQo

To claim this, I am signing this object: