Skip to content

Instantly share code, notes, and snippets.

View bixu's full-sized avatar
🦎

Blake Irvin bixu

🦎
  • Berlin
  • 06:13 (UTC +02:00)
View GitHub Profile
$ sudo pstack 73415
73415: /opt/local/sbin/nginx -c /opt/local/etc/nginx/nginx.conf
fffffd7fff2704ca sigsuspend (fffffd7fffdffab0)
0000000000447590 ngx_master_process_cycle () + 340
0000000000428fe8 main () + a4e
0000000000427dbc _start () + 6c
@bixu
bixu / gist:4613022
Last active December 11, 2015 14:18
Edits to dtrace for finding slow queries, changes made for Percona mysqld binary.
#!/usr/sbin/dtrace -s
/*
* mysql_pid_slow.d Trace queries slower than specified ms.
*
* USAGE: ./mysql_pid_slow.d -p mysqld_PID min_ms
*
* TESTED: these pid-provider probes may only work on some mysqld versions.
* 5.0.51a: ok
*/
@bixu
bixu / deployment_annotation.sh
Created November 11, 2015 16:08
Report your deployments to Circonus
#!/bin/bash
APP_NAME="<app name>"
API_TOKEN="<api token>"
TIME=$(date +%s)
curl --user $APP_NAME:$API_TOKEN \
-H "Accept: application/json" \
-X POST \
--data-binary "{\"category\": \"Deployment\",\"title\":\"Deployed $APP_NAME\",\"description\":\"Deployed revision X.X.X\",\"start\": $TIME,\"stop\":$TIME}" \
#!/bin/bash
set -e
apt-get install -y software-properties-common
apt-add-repository -y ppa:zfs-native/stable
apt-get update
apt-get install -y ubuntu-zfs
# load zfs kernel module
@bixu
bixu / gist:4220216
Created December 5, 2012 22:48
df.sh
disk_used L `df / | tail -1 | awk '{print $2}'`
disk_free L `df / | tail -1 | awk '{print $3}'`
> ::status
debugging crash dump vmcore.0 (64-bit) from 00-14-4f-23-fb-24
operating system: 5.11 joyent_20121101T182015Z (i86pc)
image uuid: (not set)
panic message:
BAD TRAP: type=e (#pf Page fault) rp=ffffff00094b99a0 addr=80 occurred in module "un
ix" due to a NULL pointer dereference
dump content: kernel pages only
> $c
mutex_enter+0xb()
#!/bin/bash
## Generated by Chef for <%= @node[:fqdn] %>
if [ -f /tmp/dns_master-slave ]; then
exit 0
fi
TTL=3600
ZONE=`hostname | awk -F"." '{print $2"."$3"."$4}'`
KEYFILE="/root/keys/ddns.private"
@bixu
bixu / gist:3530139
Last active October 9, 2015 15:27
How to install theo's nad (Node Agent Daemon) for Circonus
## may be deprecated by https://github.com/wanelo-chef/nad
#!/bin/bash
git clone git://github.com/circonus-labs/nad.git
cd ./nad && make install
cd /opt/omni/etc/node-agent.d
# This document describes updating the SmartOS boot_archive and /usr volumes.
#
# The boot_archive effectively contains /. If you want to make changes to SMF
# or so forth, you need to update the boot_archive.
#
# If you want to add things to /usr, such as drivers, you will need to update
# usr.lgz. It is compressed, so note the lofiadm -U and -C calls below. Once
# you have updated usr.lgz you will need to copy it back to the mounted
# boot_arhive.
#
@bixu
bixu / gist:1001400
Created May 31, 2011 22:19
joyent service manifest for chef-client
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type='manifest' name='chef-client'>
<service
name='application/management/chef-client'
type='service'
version='1'>