Skip to content

Instantly share code, notes, and snippets.

View nopolabs's full-sized avatar

Dan Revel nopolabs

View GitHub Profile
@nopolabs
nopolabs / bug-triage.md
Last active October 26, 2020 17:57
bug-triage
  • Root cause (Relevant logs / exceptions)
  • Customer Impact
  • Steps I took to debug
  • Where I would start and why?
@nopolabs
nopolabs / git-aliases.sh
Created October 10, 2020 01:24
Some of my favorite git aliases
alias gs='git status --short --branch'
alias gbl='git branch --list'
alias gbm='git branch --merged'
alias gcb='git checkout -b'
alias gpu='git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)'
@nopolabs
nopolabs / dcsettings.sh
Created April 4, 2020 00:42
find domainconnect settings for a domain
#!/usr/bin/env bash
DOMAIN=$1
TXT=$(host -t TXT "_domainconnect.${DOMAIN}")
HOST=$(host -t TXT "_domainconnect.${DOMAIN}" | tail -1 | sed -En 's/.* descriptive text "([^"]+)"/\1/p')
URL="https://${HOST}/v2/${DOMAIN}/settings"
@nopolabs
nopolabs / code-review.txt
Last active November 18, 2020 18:35
code review
Code Review
-----------
### What does this PR do?
### Why do we want to do that?
### What high level changes did you make to the code to accomplish that goal?
### What other information should the reviewer be aware of when looking at this code?
### How did you test?
[]unit []integration []dev []qa []stage
### How can we verify this is working in production?
@nopolabs
nopolabs / xdebug
Last active June 6, 2019 19:53
bash script to run php with xdebug enabled
#!/bin/bash
PHP=${PHP:-`which php`}
XDEBUG_INI=${XDEBUG_INI:-`${PHP} --ini | awk 'BEGIN { FS=","; } /xdebug.ini/ { print $1; }'`}
XDEBUG_HOST=${XDEBUG_HOST:-1.2.3.1}
XDEBUG_PORT=${XDEBUG_PORT:-9001}
IDE_KEY=${IDE_KEY:-PHPSTORM}
if [ "$1" = "--help" -o "$1" = "" ]
then
@nopolabs
nopolabs / previous-git-tag.sh
Last active September 28, 2016 19:13 — forked from kjantzer/previous-git-tag.sh
Get Previous Git Tag (the one before the latest tag on trunk)
# http://stackoverflow.com/a/28818420/484780
git describe --abbrev=0 --tags `git rev-list --first-parent --tags --skip=1 --max-count=1`
@nopolabs
nopolabs / dbgtest.php
Created May 24, 2015 19:41
dbgtest.php
<?php
// adapted from https://blogs.oracle.com/netbeansphp/entry/howto_check_xdebug_installation
$address = $argv[1] ?: '127.0.0.1';
$port = '9000';
$sock = socket_create(AF_INET, SOCK_STREAM, 0);
socket_bind($sock, $address, $port) or die();
echo "Listening to $address:$port\n";
socket_listen($sock);
$client = socket_accept($sock);
echo "Connection established: $client\n";
@nopolabs
nopolabs / list-yum.sh
Created April 27, 2015 20:09
list packages in a given yum repo
sudo yum --disablerepo="*" --enablerepo="osis" --showduplicates list available
@nopolabs
nopolabs / pcat
Last active September 21, 2023 16:57 — forked from tazjel/pcat
sudo apt-get install python-pygments && alias pcat="pygmentize -f terminal256 -O style=native -g"
@nopolabs
nopolabs / Apollo.java
Last active June 3, 2016 08:57
Sample code demonstrating reading and writing to Apollo MQ using Java, but failure to read messages posted to Apollo MQ from PHP using STOMP.
package test;
import org.apache.activemq.ActiveMQConnectionFactory;
import javax.jms.*;
public class Apollo {
public static void main(String[] args) throws JMSException {
String user = "guest";