Skip to content

Instantly share code, notes, and snippets.

@patmandenver
patmandenver / save_multiple_icons.jsx
Last active September 20, 2022 09:38
Photoshop script to save a file in multiple different sizes as a png file
// Create Multiple icon files
// Author: Patrick Bailey
// License: MIT
//
//Copyright 2017 T. Patrick Bailey
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to
//deal in the Software without restriction, including without limitation the
//rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
//sell copies of the Software, and to permit persons to whom the Software is
#Some example JMX info add it to you kafka start up script
# sometimes located at /opt/kafka/kafka_2.11-0.10.1.0/bin/kafka-server-start.sh
#Should retrieve local IP address
IP_ADDR=`ip route get 8.8.8.8 | awk '{print $NF; exit}'`
export KAFKA_OPTS="$KAFKA_OPTS -Djava.rmi.server.hostname=$IP_ADDR"
export KAFKA_OPTS="$KAFKA_OPTS -Dcom.sun.management.jmxremote.port=9090"
export KAFKA_OPTS="$KAFKA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
export KAFKA_OPTS="$KAFKA_OPTS -Dcom.sun.management.jmxremote.ssl=false"
@patmandenver
patmandenver / jmx_exporter.yml
Last active April 24, 2017 22:13
Kafka jmx exporter yaml file
---
lowercaseOutputName: true
whitelistObjectNames: [
"kafka.controller:type=KafkaController,name=ActiveControllerCount,*",
"kafka.server:type=BrokerTopicMetrics,name=MessagesInPerSec,*",
"kafka.server:type=BrokerTopicMetrics,name=BytesInPerSec,*",
"kafka.server:type=BrokerTopicMetrics,name=BytesOutPerSec,*",
"kafka.server:type=ReplicaManager,name=IsrExpandsPerSec,*",
@patmandenver
patmandenver / nginx_test.sh
Created August 27, 2017 21:01
A quick script to test 200, 404, and 500 errors on an nginx box (requires URLs that will result in 200, 404, and 500)
#!/bin/bash
#
# Author: Patrick Bailey
# License: MIT
#
# Set the percentage of 200, 404, and 500 errors you want
# Set the hourly rate you want
# Set a URL for 200, 404 and 500
#
# Then run it. it will suffle the 200, 404, and 500 urls
@patmandenver
patmandenver / scp-speed-test.sh
Last active December 7, 2025 19:22
scp speed test between servers
#!/bin/bash
# scp-speed-test.sh
#
# Usage:
# ./scp-speed-test.sh user@hostname [test file size in MBs]
#
#############################################################
ssh_server=$1
test_file=".scp-test-file"
@patmandenver
patmandenver / lambda slack relay
Created December 17, 2017 22:09
An AWS lambda slack webhook relay (make sure to change the path to your actual slack webhook URL
var https = require('https');
exports.handler = (event, context, callback) => {
console.log("MYLOG" + JSON.stringify(event))
//Custom Fields sent in from Distilio
var body = JSON.parse(event.body)
var name = body.name
var uri = body.uri
@patmandenver
patmandenver / ips_example_1000.txt
Last active January 29, 2018 15:16
ips example
ip_address 240.0.68.185
ip_address 209.214.118.165
ip_address 157.148.254.24
ip_address 195.123.156.190
ip_address 139.195.250.41
ip_address 122.52.182.156
ip_address 20.116.142.0
ip_address 233.55.179.77
ip_address 249.75.117.230
ip_address 116.129.103.30
ip_address::240.0.68.185
ip_address::209.214.118.165
ip_address::157.148.254.24
ip_address::195.123.156.190
ip_address::139.195.250.41
ip_address::122.52.182.156
ip_address::20.116.142.0
ip_address::233.55.179.77
ip_address::249.75.117.230
ip_address::116.129.103.30
DA
D2
D3
D4
D5
D6
D7
D8
D9
D10
#!/usr/bin/env python
#
# Script to help create time-lapse videos
# But done in nasty way so that it works on cygwin while
# Utilizing ffmpeg on windows
# Also will fill in gaps if sequential images are missing
#
##################################################