Skip to content

Instantly share code, notes, and snippets.

View thejeffreystone's full-sized avatar

Jeffrey Stone thejeffreystone

View GitHub Profile
@thejeffreystone
thejeffreystone / install.sh
Last active August 29, 2015 14:06
Vagrant Bootstrap file
echo "-- Installing Now -- "
echo "-- Updating Packages... --"
sudo apt-get update
echo "-- Configuring MySQL --"
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
echo "-- Installing Base Packages... --"
@thejeffreystone
thejeffreystone / Vagrantfile
Last active August 29, 2015 14:06
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.network :private_network, ip: "192.168.33.21"
<?php
use Illuminate\Auth\UserProviderInterface as UserProvider;
use Illuminate\Auth\UserInterface as UserInterface;
class LdapProvider implements UserProvider{
public function __construct(){}
/**
@thejeffreystone
thejeffreystone / install_splunk.sh
Created January 7, 2016 01:40 — forked from stamler/install_splunk.sh
Install Splunk Enterprise 6.2 on CentOS 7 Minimal as a non-root user systemd service and enable syslog on port 514 and http on port 80
#!/bin/bash
# Install Splunk 6.2 on CentOS 7 as a non-root user service that runs on boot with
# systemd. This script also opens the firewall to allow syslog on UDP port 514. Since
# we're running Splunk as non-root, this port is then forwarded to 5514. Configuring a
# syslog input in slunk on UDP 514 will gather this data. Must be run as root
# Create Account
useradd splunk
groupadd splunk
@thejeffreystone
thejeffreystone / pre-commit
Created March 21, 2016 15:42 — forked from stevendanna/pre-commit
Pre-commit hook to help prevent key leakage
#!/bin/bash
#
# Warn about possible cloud access keys before committing
#
exec </dev/tty
unset possible_keys
possible_keys=$(git diff --cached | egrep '^[+\-].*(AKIA|AWS_ACCESS|AWS_SECRET|OS_PASSWORD|OS_USERNAME)')
if [[ -n "$possible_keys" ]];then
echo -e "WARNING: Diff contains possible access keys:\n"
echo "${possible_keys}"
@thejeffreystone
thejeffreystone / 0_reuse_code.js
Created December 9, 2016 14:09
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@thejeffreystone
thejeffreystone / Jarvis.py
Created December 9, 2016 14:11 — forked from GGulati/Jarvis.py
Pythom Speech Recognition
import speech_recognition
import pyttsx
speech_engine = pyttsx.init('sapi5') # see http://pyttsx.readthedocs.org/en/latest/engine.html#pyttsx.init
speech_engine.setProperty('rate', 150)
def speak(text):
speech_engine.say(text)
speech_engine.runAndWait()
@thejeffreystone
thejeffreystone / keybase.md
Last active September 12, 2019 12:27
keybase.md

Keybase proof

I hereby claim:

  • I am thejeffreystone on github.
  • I am thejeffreystone (https://keybase.io/thejeffreystone) on keybase.
  • I have a public key ASAZY4ufPVtTz152XK1xpq356sp3mc5Hwho_j69tsbyJOgo

To claim this, I am signing this object:

@thejeffreystone
thejeffreystone / PHP LDAP Function to verify user credentials
Last active February 10, 2021 14:39
PHP LDAP Function to verify user credentials
public function verifyLdapUser($username,$password)
{
$DomainName=LDAPDOMAIN; // name = domain
$ldap_server=LDAP; // server = ldap://doman.co
// returns true when user/pass binds to LDAP/AD.
$auth_user=$username."@".$DomainName;
//Check to see if LDAP module is loaded.
if (extension_loaded('ldap')) {
@thejeffreystone
thejeffreystone / gist:6bc41eb103094318795353ab2885abf3
Created December 16, 2021 15:52
Home Assistant - Randomized Lights Example
randomize_lights:
alias: randomize lights
sequence:
- repeat:
count: '8'
sequence:
- service: homeassistant.turn_on
data:
entity_id: "{{ expand('group.livingroom') | selectattr('state', 'eq', 'off') | map(attribute='entity_id') | list | random }}"
- delay: