Skip to content

Instantly share code, notes, and snippets.

@mindfullsilence
mindfullsilence / README.md
Created July 10, 2024 16:25
Mac: Send a text and notification when a domain has propagated

Propagate

A very simple script to add to your bash/zsh profile that shows a notification on your mac, and sends you a text message when a domain has propagated. Let's you know when to issue an SSL certificate. Great for LetsEncrypt SSL as you cannot pass the LetsEncrypt challenge until a domain has propagated.

Requirements

  • Only works on MacOS.
  • Requires alerter to be installed for sending notifications.
  • Requires dig - but this comes with macos so you shouldn't need to do anything there.

Installation

Add the above script to your ~/.profile or ~/.zprofile or wherever you store your terminal profile. Then close and re-open your terminal, or simply call source ~/.profile to load in the new functionality.

@mindfullsilence
mindfullsilence / backup.sh
Created July 1, 2024 04:30
Error at line 1 in file: importing database "Unknown Command '\-'"
#!/bin/bash
DB_BACKUP_DIR_ROOT="$HOME/Desktop/mysql_backup"
# Create the backup directory
mkdir -p $DB_BACKUP_DIR_ROOT
# Backup each db in the server, skip schema dbs though
for db in $(mysql -u root -Bse 'show databases'|egrep -vi 'information_schema|performance_schema|user')
do
@mindfullsilence
mindfullsilence / guidelines.md
Last active January 27, 2024 21:18
Theme Developers Guide

Theming Rules:

The following guidelines have been written to provide optimal performance, scalability, maintainability, and flexibility within a CMS system.

This document uses the following conventions to express intent:

  • SHALL: The statement that follows must always be followed.
  • SHALL NOT: The statement that follows must never happen.
  • SHOULD: If the statement that follows can happen, then it must happen.
  • SHOULD NOT: If the statement that follows doesn't need to happen, then it must not happen.
@mindfullsilence
mindfullsilence / README.md
Created April 13, 2023 15:21
Add multiple accounts to your AWS cli, and activate them when needed

Add the contents of aws-profile.sh to your bash profile.

Use like the following:

Create a user in AWS IAM with CLI capabilities Get the users' access key and secret key

Add the profile to your CLI

aws-add-profile {the account name} {your access key} {your secret key}
@mindfullsilence
mindfullsilence / README.md
Created April 13, 2023 15:12
Brewphus - Simply bash function for installing and switching php versions using brew

Add the function to your bash profile Ensure brew is installed Run it!

Example:

brewphus install 8.0
@mindfullsilence
mindfullsilence / README.md
Last active October 12, 2024 17:49
Deployment scripts for atomic deployment of laravel applications in runcloud

Runcloud Automic Deployment Script For Laravel Applications

These scripts can be used to set up automic deployments in runcloud for laravel applications

@mindfullsilence
mindfullsilence / quickmount.md
Last active June 13, 2020 22:16
Mount synology nas on Mac through bash

Installation

  1. Copy the contents of the quickmount.sh file to your ~/.bash_profile
  2. Edit lines 4, 5, and 6 with the appropriate information for connecting to your synology NAS
  3. Edit/duplicate the projects function for any folders you want to mount on your mac.
  4. Save your ~/.bash_profile, then in terminal run source ~/.bash_profile

Usage

To mount a directory from terminal, just call your function:

@mindfullsilence
mindfullsilence / README.md
Last active February 12, 2024 20:50
Root Bedrock Homestead site-type

This script will create a roots/bedrock project in your desired directory, install composer dependencies, and install wordpress via the wp-cli tool. Works with mailhog.

For global homestead installations (not per-project installs)

Place the sh file in Homestead/scripts/site-types/

In your Homestead.yaml file, use "bedrock" as the type key for a site mapping, and the value of the map key as the database. Be sure to add /web to the end of your to: key for your folder mapping. The script will generate the web folder for you. E.g.:

---
@mindfullsilence
mindfullsilence / KeepsHistory.js
Last active March 10, 2021 17:38
Object history tracking mixin with undo and redo abilities
const log = Symbol('log')
const present = Symbol('present')
const observer = Symbol('observer')
const real = Symbol('real')
const KeepsHistory = superclass => class extends superclass {
;[log] = []
;[present] = null
;[observer] = undefined
;[real] = undefined
@mindfullsilence
mindfullsilence / wp-end-maintainance.sh
Last active July 16, 2018 17:18
Bash scripts to start and stop maintainance mode for wordpress.
#!/usr/bin/env bash
WP_WEB_ROOT=/var/www/html;
cd $WP_WEB_ROOT;
# Disable maintainance mode by removing the .maintainance file
rm -f $WP_WEB_ROOT/.maintainance;
# Flush caches