Skip to content

Instantly share code, notes, and snippets.

View rhukster's full-sized avatar

Andy Miller rhukster

View GitHub Profile
@rhukster
rhukster / gist:e8f5f3676c38dde29624734ea99bf837
Created September 5, 2020 16:33 — forked from yehgdotnet/gist:6353e367cb1178017980d2437417d6a5
.htaccess (allow only cloudflare IP range) Raw
<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
@rhukster
rhukster / _README.md
Created August 19, 2020 22:15 — forked from oleq/_README.md
A2DP audio streaming using Raspberry PI (Raspbian Jessie)

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 / test-ldap-2.php
Created May 5, 2018 04:36 — 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)
#!/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]
@rhukster
rhukster / sphp.sh
Last active September 13, 2022 06:21 — forked from w00fz/sphp.sh
PHP switcher
#!/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