Skip to content

Instantly share code, notes, and snippets.

View sidharrell's full-sized avatar

Sidney Harrell sidharrell

  • Vivian-Harrell Web Development Studios, LLC
  • Harpers Ferry, WV, United States
View GitHub Profile
@sidharrell
sidharrell / ball.html
Last active April 11, 2019 04:56
d3 bouncing ball
<!DOCTYPE html>
<meta charset="utf-8">
<title>D3 test</title>
<script src="https://d3js.org/d3.v5.min.js"></script>
<body>
</body>
<script>
var acceleration = {"ddx": 0, "ddy": -10};
var circleData = [
{"x": 0, "y": 0, "dx": 50, "dy": 100, "r": 10, "fill": "red", "index": 1},
podman run -p 8200:8200 \
-v apm-server.yml:/usr/share/apm-server/apm-server.yml \
docker.elastic.co/apm/apm-server-oss:6.5.4
podman run -p 5000:5000 \
-e "ES_JAVA_OPTS=-Xms256m -Xmx256m" \
-v logstash.yml:/usr/share/logstash/config/logstash.yml \
docker.elastic.co/logstash/logstash-oss:6.5.4
podman run -p 5601:5601 \
ansible
jenkins
bitbucket
confluence
jira
op5
idm
elk
#!/bin/bash
## The ip address XXX.XXX.XXX.XXX/32 below needs to be replaced by the jump box address
## This locks down the server post-creation and sets it up with a 'sidney' user, since that is my local user, it makes it
## convenient to log in without the centos@
## also, I'm curling 404's from http://wiseyacht.com/ as my crude verification that it's finished, cause I can tail that
## apache log
useradd sidney
cp -r ~centos/.ssh ~sidney
chown -R sidney. ~sidney/.ssh
@sidharrell
sidharrell / gist:5ebbb3ec43ddb85c63ae719a23c99cb0
Last active March 21, 2018 05:43
d3 line chart sever side with node
var fs = require('fs');
var d3 = require('d3');
var jsdom = require('jsdom');
module.exports = function(outputLocation, graphTitle) {
if (!outputLocation)
outputLocation = 'test.svg';
if (!graphTitle)
@sidharrell
sidharrell / gist:8831cae292d2ceef0ad6c14df1a97559
Created December 7, 2017 09:01
filter the cruft from /var/log/secure
grep -vE "sshd.*Disconnected\ from" secure | \
grep -vE "sshd.*Received\ disconnect" | \
grep -vE "sshd.*invalid\ user" | \
grep -vE "sshd.*Invalid\ user" | \
grep -vE "sshd.*Connection\ closed" | \
grep -vE "sshd.*Disconnecting" | \
grep -vE "sshd.*maximum\ authentication\ attempts" | \
grep -vE "sshd.*reverse\ mapping\ checking" | \
grep -vE "sshd.*Did\ not\ receive\ identification\ string" | \
grep -vE "sshd.*Address.*maps\ to.*but\ this\ does\ not\ map\ back\ to\ the\ address" | \
add_action('action_hook_espresso_save_attendee_data','espresso_create_wp_user', 10, 1);
function espresso_create_wp_user($attendee_data) {
if( username_exists( $attendee_data['email'] ) == NULL ) {
global $org_options, $wpdb;
// Generate the password and create the user
$password = wp_generate_password( 12, false );
$user_id = wp_create_user( $attendee_data['email'], $password, $attendee_data['email'] );
// Set the users details
@sidharrell
sidharrell / gist:0cb3086e1b71c71b9c51
Created July 14, 2014 20:33
EE4 js to make payment option auto-clicked if only one payment option available
jQuery(document).ready(function() {
jQuery('#spco-go-to-step-payment_options-btn').click(function() {
if (jQuery('.reg-page-payment-option-dv').length == 1) {
setTimeout(function(){jQuery('.reg-page-payment-option-dv').click();}, 2000);
}
});
});
@sidharrell
sidharrell / gist:6ede29557dd068eefeb2
Last active November 30, 2016 22:01
EE4 override espresso_list_of_event_dates
function espresso_list_of_event_dates( $EVT_ID = FALSE, $dt_frmt = '', $tm_frmt = '', $echo = TRUE, $show_expired = NULL, $format = TRUE, $add_breaks = TRUE ) {
$dt_frmt = ! empty( $dt_frmt ) ? $dt_frmt : get_option('date_format');
$tm_frmt = ! empty( $tm_frmt ) ? $tm_frmt : get_option('time_format');
$datetimes = EEH_Event_View::get_all_date_obj( $EVT_ID ,$show_expired );
//d( $datetimes );
if ( is_array( $datetimes ) && ! empty( $datetimes )) {
global $post;
$html = $format ? '<ul id="ee-event-datetimes-ul-' . $post->ID . '" class="ee-event-datetimes-ul">' : '';
foreach ( $datetimes as $datetime ) {
if ( $datetime instanceof EE_Datetime ) {
@sidharrell
sidharrell / template
Last active October 20, 2016 23:55
vhost template
<VirtualHost *:80>
ServerName XXXXXX.localhost
ServerAdmin webmaster@localhost
DocumentRoot /var/www/XXXXXX/htdocs
LogLevel warn
ErrorLog "|/sbin/cronolog /var/www/XXXXXX/logs/%Y/%m/%Y-%m-%d-error.log"
CustomLog "|/sbin/cronolog /var/www/XXXXXX/logs/%Y/%m/%Y-%m-%d-access.log" combined
<Directory /var/www/XXXXXX/htdocs/>
RewriteEngine on
RewriteBase /