Skip to content

Instantly share code, notes, and snippets.

View Synchro's full-sized avatar

Marcus Bointon Synchro

View GitHub Profile
@Synchro
Synchro / sphp.sh
Created December 20, 2022 22:46 — forked from rhukster/sphp.sh
Easy Brew PHP version switching
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)
osx_patch_version=${osx_patch_version:-0}
osx_version=$((${osx_major_version} * 10000 + ${osx_minor_version} * 100 + ${osx_patch_version}))
homebrew_path=$(brew --prefix)
brew_prefix=$(brew --prefix | sed 's#/#\\\/#g')
@Synchro
Synchro / sphp
Last active June 8, 2023 13:36 — forked from rozsival/sphp
Easy Brew PHP-FPM switch
#!/usr/bin/env bash
latest="8.1"
versions=("7.4" "8.0" "$latest")
valid=$(printf "|%s" "${versions[@]}")
switch="$1"
ERROR=$(tput setaf 1)
SUCCESS=$(tput setaf 2)
if [ -z "$switch" ]
@Synchro
Synchro / add_apache_brew.md
Last active June 18, 2017 22:28 — forked from vitorbritto/add_apache_brew.md
Install Apache with Homebrew

Install Apache with Homebrew

Installing Apache

# Start by stopping the built-in Apache, if it's running, and prevent it from starting on boot.
# This is one of very few times you'll need to use sudo:
sudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist 2> /dev/null

# Install Apache 2.4 with the event MPM and HTTP/2 support

brew install -v homebrew/apache/httpd24 --with-mpm-event --with-http2

@Synchro
Synchro / hpkp-tlsa.sh
Last active September 12, 2016 09:11 — forked from aeris/hpkp-tlsa.sh
Generate HPKP or TLSA fingerprint
#!/bin/bash
# Uses pkey instead of rsa so it also works with ecc certs
case "$1" in
hpkp)
case "$2" in
key)
openssl pkey -in "$3" -outform der -pubout 2>/dev/null | openssl dgst -sha256 -binary | openssl enc -base64
;;
csr)
openssl req -in "$3" -pubkey -noout | openssl pkey -pubin -outform der 2>/dev/null | openssl dgst -sha256 -binary | openssl enc -base64
#!/bin/bash
set -e
wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.73.tar.gz
tar -zxf mysql-5.1.73.tar.gz
cd mysql-5.1.73
./configure '--prefix=/usr' '--exec-prefix=/usr' '--libexecdir=/usr/sbin' '--datadir=/usr/share' '--localstatedir=/var/lib/mysql' '--includedir=/usr/include' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-system-type=debian-linux-gnu' '--enable-shared' '--enable-static' '--enable-thread-safe-client' '--enable-assembler' '--enable-local-infile' '--with-fast-mutexes' '--with-big-tables' '--with-unix-socket-path=/var/run/mysqld/mysqld.sock' '--with-mysqld-user=mysql' '--with-libwrap' '--without-readline' '--with-ssl' '--without-docs' '--with-extra-charsets=all' '--with-plugins=max' '--with-embedded-server' '--with-embedded-privilege-control'
make
sudo make install
@Synchro
Synchro / Generic logstash init script
Last active December 19, 2015 02:09 — forked from jippi/rc.d
Rather than copying and editing an `init.d` file simply to point it at a different config file, you can have it work it out from the filename, so you can use the same init file for all your logstash agents. The filename must follow the established convention for logstash and it splits on the dash in the name, so names like `logstash-indexer`, `l…
#! /bin/sh
### BEGIN INIT INFO
# Provides: logstash-shipper
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.