Skip to content

Instantly share code, notes, and snippets.

View nickpeirson's full-sized avatar

Nick Peirson nickpeirson

  • ChannelGrabber.com
  • UK
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Hangup/>
</Response>
@nickpeirson
nickpeirson / 1-plexbox-setup-README.md
Created August 15, 2019 12:15 — forked from mturley/1-plexbox-setup-README.md
Ubuntu Server plexbox setup

Start with a fresh Ubuntu Server installation. NOTE: In the commands and files below, be sure to replace <yourusername> with your username and <yourgroupname> with your group name (probably the same as your username). Also, replace <yourhostname> with your server's hostname.

Install Dependencies:

. /etc/lsb-release
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/ubuntu ${DISTRIB_CODENAME} main" | sudo tee /etc/apt/sources.list.d/mono-official.list
sudo apt update
@nickpeirson
nickpeirson / zombie_slayer.sh
Last active May 15, 2023 06:30
Script to clean Zombie processes up using gdb
#!/bin/bash
##################################################################
# Script: Zombie Slayer
# Author: Mitch Milner
# Date: 03/13/2013 ---> A good day to slay zombies
#
# Requirements: yum install gdb / apt-get install gdb
# permissions to attach to the parent process
#
# This script works by using a debugger to
@nickpeirson
nickpeirson / elasticsearch.json
Last active November 21, 2021 20:55
lnav format for ES 6.x, based on log4j2 pattern
{
"elasticsearch" : {
"title" : "Elasticsearch log4j2 pattern format",
"description" : "Log4j2 pattern format used bu Elasticsearch",
"regex" : {
"basic" : {
"pattern" : "^\\[(?<timestamp>\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2},\\d{3})\\]\\[(?<level>[^\\] ]+) *\\]\\[(?<component>[^\\]]+)\\] (?<body>(.*))\\n?(?<stacktrace>.*\\n(\\tat.*\\n?)*)?$"
}
},
"level-field" : "level",
@nickpeirson
nickpeirson / monolog.json
Last active February 29, 2024 09:58 — forked from skowron-line/monolog.json
lnav Monolog format
{
"monolog": {
"title": "Monolog log file",
"description": "Monolog log format",
"url": "https://github.com/Seldaek/monolog",
"regex": {
"default": {
"pattern": "\\[(?P<timestamp>.*)\\] (?P<logger>\\w+).(?P<level>\\w+): (?P<message>.+) (?P<context>[\\[\\{].*[\\]\\}]) (?P<extra>[\\[\\{].*[\\]\\}])$"
}
},
@nickpeirson
nickpeirson / gearman_ptop.php
Created November 18, 2014 16:21
Working POC scrolling filterable gearman top replacement
<?php
function _log($msg) {
file_put_contents('/tmp/log', $msg.PHP_EOL, FILE_APPEND);
}
function getStatus(&$widths, $filter = '') {
$filter = strtolower($filter);
_log('Getting status');
$gearmanStatus = explode("\n",`gearadmin --status`);
$statusLines = [];
foreach ($gearmanStatus as $job) {
<?php
namespace CG\Di\Definition\RuntimeDefinition;
use CG\Di\Definition\RuntimeDefinition;
use Zend\Di\Definition\IntrospectionStrategy;
use Zend\Cache\Storage\StorageInterface;
use Zend\Cache\Storage\Adapter\Memory;
class Cache extends RuntimeDefinition
{
@nickpeirson
nickpeirson / gist:8f32b778b0e1083b23d0
Last active August 29, 2015 14:06
Hide JIRA agile board columns on header click
//hide column
var colWidths = {};
var headDims = {};
$('#ghx-column-headers li').toggle(
function() {
heading = $(this);
var columnId = heading.data('id');
headDims[columnId] = {
'width': heading.width(),
'height': heading.height()

Keybase proof

I hereby claim:

  • I am nickpeirson on github.
  • I am nickpeirson (https://keybase.io/nickpeirson) on keybase.
  • I have a public key whose fingerprint is C9B6 8FF1 EBEA FF4E 8CBF 93D6 3CFF 7B07 1724 D6B1

To claim this, I am signing this object:

@nickpeirson
nickpeirson / delete-ec2-node.sh
Created February 23, 2012 11:20
Quick bash script for cleaning up ec2 instances and associated opscode node/client. Accepts partial/full instance name as an argument.
#!/bin/bash
INSTANCE="$1"
if [ "x$INSTANCE" = "x" ]; then
echo "Please specify an instance"
exit 1
fi
INSTANCE=$(knife ec2 server list | awk "/$INSTANCE/{ print \$1 }")
if [ "x$INSTANCE" = "x" ]; then
echo 'Instance not found'
exit 2