Skip to content

Instantly share code, notes, and snippets.

View jpuskar's full-sized avatar

John Puskar jpuskar

  • AmTrust
  • Cleveland, OH
View GitHub Profile
@jpuskar
jpuskar / splunk-hec.psm1
Created January 5, 2017 23:45 — forked from halr9000/splunk-hec.psm1
Send-SplunkEvent, a PowerShell cmdlet for sending events to the Splunk HTTP event collector
# TODO: write the help
# TODO: support SSL self-signed certs
# TODO: need to validate JSON, and/or add a new param set that accepts hashtable and
# convert internally.
# TODO: support RAW mode
# TODO: refactor to use EC batch (concatenated events in one HTTP request) instead of
# PowerShell pipelines which will do a request per object (event payload) on the pipeline
# TODO: think about load balancing per Geoffrey Martins.
@jpuskar
jpuskar / haproxy_cluster_vars.conf
Created January 13, 2017 01:11 — forked from sgnn7/haproxy_cluster_vars.conf
Seamless haproxy on marathon-lb w/ systemd
# /etc/systemd/system/haproxy.service.d/haproxy_cluster_vars.conf
[Service]
Environment="PIDFILE=/run/haproxy.pid"
Environment="HAPROXY_SOCKET=/var/run/haproxy/socket"
# Get rid of the socket on start/stop
ExecStartPre=/bin/bash -c "rm -f $HAPROXY_SOCKET"
ExecStopPost=/bin/bash -c "rm -f $HAPROXY_SOCKET"
# XXX: Do seamless reloads
@jpuskar
jpuskar / gist:e7d41f44f9d565f2c4e39bf5ea80e37a
Last active April 2, 2023 09:25 — forked from nvalentine-puppetlabs/gist:7036421
List Exported Resources via PuppetDB query
curl -G -H "Accept: application/json" http://localhost:8080/pdb/query/v4/resources --data-urlencode 'query=["=","exported", true]'
@jpuskar
jpuskar / watch haproxy sticky tables
Created January 19, 2017 18:29 — forked from jeremyj/watch haproxy sticky tables
watch haproxy sticky tables
watch -n 1 'echo "show table http" | socat unix:/var/run/haproxy.sock -'
watch -n 1 'echo "show table public" | socat unix:/var/run/haproxy.sock -'
@jpuskar
jpuskar / fedora.md
Last active August 7, 2017 20:52 — forked from olpoco/fedora.md
Installing Fedora 23 on Macbook Pro Retina 2016, and attaching Airport Extreme

Installing Fedora on Macbook Pro retina

  1. Download Fedora 25 iso, create a usb bootable media
  2. Use diskutil list to figure out which drive is the usb, on macbook pro with 1 hardrive, the usb is /dev/disk2
  3. Umount the disk using diskutil unmountDisk /dev/disk2 or use Mac's Disk Utility (just umount, don't eject, umount removes it from directory structure and eject disconncet it altogether)
  4. Use dd(a low level cp) to write iso content into the usb drive, sudo dd if=~/Downloads/Fedora-Live-Desktop-x86_64-20-1.iso of=/dev/rdisk2 bs=8m, this will take a bit of time, make sure you wait until it's done, additionally compare the size or checksum to make sure all has been copied (not that necessary since if it weren't copied, it'll err at boot time)
  5. Use Disk Utility to shrink Mac's harddrive to create partition for the subsequent fedora installation
  6. Boot to recovery mode (cmd+r) and disable SIP (termina
@jpuskar
jpuskar / pedantically_commented_playbook.yml
Created February 11, 2017 23:22 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@jpuskar
jpuskar / pedantically_commented_playbook.yml
Created February 11, 2017 23:22 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@jpuskar
jpuskar / gist:e6988e9459ee267e83f1cba2cbcdec3b
Created May 15, 2017 23:19 — forked from gambtho/gist:36a2f01e9e7d8c1b0046fb074f1a44ee
Zookeeper.service systemd script for zookeeper
from - http://davidssysadminnotes.blogspot.com/2016/01/installing-apache-kafka-and-zookeeper.html
[smack1]# vi /etc/systemd/system/kafka-zookeeper.service
[Unit]
Description=Apache Zookeeper server (Kafka)
Documentation=http://zookeeper.apache.org
Requires=network.target remote-fs.target
After=network.target remote-fs.target
[Service]
Type=simple
@jpuskar
jpuskar / gist:d3ad5b14cea3202cd965e5824fca0beb
Created May 15, 2017 23:19 — forked from gambtho/gist:36a2f01e9e7d8c1b0046fb074f1a44ee
Zookeeper.service systemd script for zookeeper
from - http://davidssysadminnotes.blogspot.com/2016/01/installing-apache-kafka-and-zookeeper.html
[smack1]# vi /etc/systemd/system/kafka-zookeeper.service
[Unit]
Description=Apache Zookeeper server (Kafka)
Documentation=http://zookeeper.apache.org
Requires=network.target remote-fs.target
After=network.target remote-fs.target
[Service]
Type=simple
@jpuskar
jpuskar / rsync_cheat_sheet.txt
Created April 14, 2018 14:43
Rsync cheat-sheet
# Copy big files, ignoring timestamps.
# -a, --archive
# * Equivalent to -rlptgoD (no -H,-A,-X)
# * Does not preserve hardlinks
# -r, --recursive
# -l, --links. Copy symlinks as symlinks.
# -p, --perms. Preserve permissions.
# -t, --times. Preserve modification times.
# -g, --group. Preserve group.
# -o, --owner. Preserve owner (super-user only).