Skip to content

Instantly share code, notes, and snippets.

@phillpafford
phillpafford / prepare-commit-msg
Last active October 12, 2023 16:58
add jira ticket from git branch as prepare-commit-msg git hook
#!/usr/bin/env bash
## Automatically append jira issue ticket to every commit if found in the git branch name and not already in the commit message
## Ref: https://community.atlassian.com/t5/Bitbucket-questions/automatically-append-JIRA-issue-ID-into-commit-message/qaq-p/605991
## https://stackoverflow.com/a/67647814/93966
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
# It will copy the commit string from ".git/COMMIT_EDITMSG"
COMMIT_MESSAGE=$1
@phillpafford
phillpafford / gist:6081ee928762b1200722af499dab0418
Last active October 7, 2023 01:40
find all jira tickets between 2 git tags
#!/usr/bin/env bash
set -e
## https://confluence.atlassian.com/adminjiraserver/configuring-jira-application-options-938847824.html
## Project Key Length: Default: 10
JIRA_REGEX='[A-Z]{2,10}-[0-9]{1,7}'
JIRA_TICKET=()
# Set the tags
@phillpafford
phillpafford / atlassian.compass.deployment.event.sh
Created September 19, 2023 13:16
atlasian compass deployment event
#!/usr/bin/env bash
set -e
# https://developer.atlassian.com/cloud/compass/rest/intro/#version
TIMESTAMP=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
COMPASS_CLOUD_INSTANCE=name-of-your-instance
COMPASS_REST_API_VERSION=v1
## create api token for your user https://id.atlassian.com/manage-profile/security
@phillpafford
phillpafford / atlassian.compass.custom.event.sh
Created September 19, 2023 13:05
atlassian compass custom event
#!/usr/bin/env bash
## requires jq to be installed
set -e
# https://developer.atlassian.com/cloud/compass/rest/intro/#version
TIMESTAMP=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
COMPASS_CLOUD_INSTANCE=name-of-your-instance
COMPASS_REST_API_VERSION=v1
#!/bin/bash
set -e
OPENSSL_INSTALLED=false
if which openssl >/dev/null
then
OPENSSL_INSTALLED=true
fi
@phillpafford
phillpafford / docker.cleanup.sh
Created October 9, 2020 13:51
docker.cleanup.script
#!/usr/bin/env bash
#
# list running docker containers
# https://coderwall.com/p/ewk0mq/stop-remove-all-docker-containers
echo ================== START DOCKER STOP AND REMOVE ALL CONTAINERS ==================
docker images
docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
@phillpafford
phillpafford / gist:605f02c0b6dc6cf66958a32024fa0ba8
Last active June 8, 2020 19:38
nginx log rotate bash script
#!/bin/bash
## http://nginx.org/en/docs/control.html
## https://www.nginx.com/resources/wiki/start/topics/examples/logrotation/
## idea is to run this cron job at 12:59 PM daily to move the existing access and error logs and reload nginx
DEBUG=true
CURRENT_DATE=$(date +"%Y-%m-%d")
PROJECT_NAME="test.project"
#!/usr/bin/env bash
##
# check out latest semvar tag from git master repo
##
## exit if script fails
set -e
## get current branch checked out
CURRENT=`git rev-parse --abbrev-ref HEAD`
{
"logstash-2018.11": {
"mappings": {
"doc": {
"_meta": {
"version": "6.4.2"
},
"dynamic_templates": [
{
"fields": {
- https://cruise.phparch.com/
- https://tek.phparch.com/
- https://world.phparch.com/
- http://midwestphp.org/
- https://skiphp.com/
- http://lonestarphp.com/
- http://pnwphp.com/
- http://madisonphpconference.com/
- http://sunshinephp.com/