Skip to content

Instantly share code, notes, and snippets.

View athaller's full-sized avatar
💭
Making Magic

athaller

💭
Making Magic
  • $date :: PHP :: Systems :: Dev Ops
  • East :: Web
View GitHub Profile
@athaller
athaller / ansible_local_playbooks.md
Created November 26, 2020 03:46 — forked from alces/ansible_local_playbooks.md
How to run an Ansible playbook locally
  • using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml
  • using inventory:
127.0.0.1 ansible_connection=local
<?php
namespace DeliciousBrains\Admin;
use DeliciousBrains\DBI;
class ACF {
public function init() {
add_filter( 'acf/settings/save_json', array( $this, 'get_local_json_path' ) );
<?php
namespace DeliciousBrains\Admin;
use DeliciousBrains\DBI;
class ACF {
public function init() {
add_filter( 'acf/settings/save_json', array( $this, 'get_local_json_path' ) );
@athaller
athaller / git-selective-merge.md
Created September 16, 2019 18:14 — forked from katylava/git-selective-merge.md
git selective merge

Example: You have a branch refactor that is quite different from master. You can't merge all of the commits, or even every hunk in any single commit or master will break, but you have made a lot of improvements there that you would like to bring over to master.

Note: This will not preserve the original change authors. Only use if necessary, or if you don't mind losing that information, or if you are only merging your own work.

On master:

> git co -b temp
@athaller
athaller / return_mirror_sender.php
Created August 28, 2019 21:37 — forked from butlerblog/return_mirror_sender.php
Set the mail return path to mirror the sender in wp_mail to reduce likelihood of spam rejection
add_action( 'phpmailer_init', 'fix_my_email_return_path' );
function fix_my_email_return_path( $phpmailer ) {
$phpmailer->Sender = $phpmailer->From;
}
#!/bin/bash
function deploy {
# Update the rsync target on the server
rsync \
-av \
--delete \
--delete-excluded \
$rsync_ignore_list_param \
$rsync_source/ $target:$rsync_target
@athaller
athaller / ca.md
Created July 11, 2019 13:50 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@athaller
athaller / jq to filter by value.md
Created May 15, 2019 21:07 — forked from ipbastola/jq to filter by value.md
JQ to filter JSON by value

JQ to filter JSON by value

Syntax: cat <filename> | jq -c '.[] | select( .<key> | contains("<value>"))'

Example: To get json record having _id equal 611

cat my.json | jq -c '.[] | select( ._id | contains(611))'

Remember: if JSON value has no double quotes (eg. for numeric) to do not supply in filter i.e. in contains(611)

@athaller
athaller / Jenkinsfile
Created May 14, 2019 18:35 — forked from jonico/Jenkinsfile
Example for a full blown Jenkins pipeline script with multiple stages, kubernetes templates, shared volumes, input steps, injected credentials, heroku deploy, sonarqube and artifactory integration, Docker containers, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, stage timeouts, stage c…
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
def label = "mypod-${UUID.randomUUID().toString()}"
podTemplate(label: label, yaml: """
spec:
containers:
- name: mvn
image: maven:3.3.9-jdk-8-alpine