Skip to content

Instantly share code, notes, and snippets.

@phillpafford
phillpafford / docker.cleanup.sh
Created October 9, 2020 13:51
docker.cleanup.script
View docker.cleanup.sh
#!/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
View gist:605f02c0b6dc6cf66958a32024fa0ba8
#!/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"
View git-checkout-latest-tag
#!/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`
View logstash.mapping
{
"logstash-2018.11": {
"mappings": {
"doc": {
"_meta": {
"version": "6.4.2"
},
"dynamic_templates": [
{
"fields": {
View gist:09ee6e4e176670fb66fa75e264a8de99
- 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/
@phillpafford
phillpafford / macs-on-active-directory.md
Created May 26, 2016 17:55 — forked from bzerangue/macs-on-active-directory.md
Binding and Unbinding to Active Directory from Mac OS via Command Line
View macs-on-active-directory.md
View gist:c2a3bdb296270f5b3e14
Verifying that +phillpafford is my blockchain ID. https://onename.com/phillpafford
View stash_slack.sh
#!/bin/bash
# $1 => Slack hook URL
# $2 => Channel name
# $3 => URL to web repo browser for base project
slack_url="$1"
channel="$2"
browser_url="$3"
# Debugging output in /tmp/stash_slack.txt
View stash_slack_integration.md

This is a short article on how we integrate stash and slack in openmind

First of all i assume you have:

  • a working stash installation
  • a repository you to notify slack on pushes
  • stash user with administration priviledges
  • full access to the server (linux) where stash is installed on
  • a team configured on slack
  • slack user with administration priviledges
@phillpafford
phillpafford / speedmail.command.line.scpt
Created September 15, 2014 15:13
Speed up Mail.app by vacuuming the Envelope Index
View speedmail.command.line.scpt
(*
Speed up Mail.app by vacuuming the Envelope Index
Code from: http://www.hawkwings.net/2007/03/03/scripts-to-automate-the-mailapp-envelope-speed-trick/
Originally by "pmbuko" with modifications by Romulo
Updated by Brett Terpstra 2012 <http://brettterpstra.com>
*)
tell application "Mail" to quit
set sizeBefore to do shell script "ls -lah ~/Library/Mail/V2/MailData | grep -E 'Envelope Index$' | awk {'print $5'}"
do shell script "/usr/bin/sqlite3 ~/Library/Mail/V2/MailData/Envelope\\ Index vacuum"