Skip to content

Instantly share code, notes, and snippets.

Avatar

Andy Miller rhukster

View GitHub Profile
@rhukster
rhukster / sphp.sh
Last active Sep 25, 2022
Easy Brew PHP version switching
View sphp.sh
#!/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')
@rhukster
rhukster / _README.md
Created Aug 19, 2020 — forked from oleq/_README.md
A2DP audio streaming using Raspberry PI (Raspbian Jessie)
View _README.md

What is this all about?

This tutorial will turn your Raspberry PI into a simple Bluetooth audio receiver, which plays music through connected speakers. It's like a regular car audio system, but it can be used anywhere and it's a good value.

   Audio source (i.e. smartphone) 
                |
                v
 (((  Wireless Bluetooth Channel  )))
 |
@rhukster
rhukster / sphp.sh
Last active Sep 13, 2022 — forked from w00fz/sphp.sh
PHP switcher
View sphp.sh
#!/bin/bash
# Check if command was ran as root.
if [[ $(id -u) -eq 0 ]]; then
echo "The command \"sphp\" should not be executed as root or via sudo directly."
echo "When a service requires root access, you will be prompted for a password as needed."
exit 1
fi
# Usage
View xdebug
#!/usr/bin/env bash
# http://github.com/w00fz/xdebug-osx
#
# @author Djamil Legato http://github.com/w00fz/xdebug-osx
# @modified Andy Miller - Homebrew/core compatibility
# @license MIT
# @version 1.3
app="$(basename "$0")"
command="$1"
@rhukster
rhukster / printer.cfg
Created Dec 27, 2021
Klipper - BLV MGN Cube, tmc2209, sensorless homing x/y, ezable probe z, triple-z leveling
View printer.cfg
# Mainsail
[include mainsail.cfg]
# Printer settings
[force_move]
enable_force_move: True
[virtual_sdcard]
path: ~/gcode_files
@rhukster
rhukster / watch.sh
Last active Apr 5, 2021
Watch script for wellington sassc wrapper
View watch.sh
#!/bin/sh
#
# Configuration
#
# sass source
SASS_SOURCE_PATH="scss"
# sass options
@rhukster
rhukster / ender5-firmware-update.md
Last active Jan 23, 2021
Upgrade Creality Ender 5 firmware for Mac
View ender5-firmware-update.md
@rhukster
rhukster / test-ldap-2.php
Created May 5, 2018 — forked from leftclickben/test-ldap-2.php
Open a connection to an LDAP server, query it for a given user, and check group membership for that user (test script)
View test-ldap-2.php
#!/usr/bin/php
<?php
# Parse options
$opts = getopt('h:n:u:p:b:s:', array( 'help' ));
if (isset($opts['help']) && $opts['help']) {
echo <<<ENDHELP
Usage:
$argv[0] [-h HOSTNAME] [-n PORTNUM] [-u USERNAME] [-p PASSWORD] [-b BASEDN] [-s SEARCH]
View gist:e8f5f3676c38dde29624734ea99bf837
<Files 403.shtml>
order allow,deny
allow from all
</Files>
# https://www.cloudflare.com/ips-v4
# https://www.cloudflare.com/ips-v6
deny from all
allow from 103.21.244.0/22
View htaccess_tester.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Grav .htaccess Tester</title>
<link rel="stylesheet" href="https://unpkg.com/spectre.css/dist/spectre.min.css">
<style>
body { padding: 2rem; }
textarea.form-input { height: 500px; }