Skip to content

Instantly share code, notes, and snippets.

View buddyp450's full-sized avatar
💭
did you get that thing I sent ya?

Charles Patton Jr buddyp450

💭
did you get that thing I sent ya?
View GitHub Profile
@buddyp450
buddyp450 / INSTRUCTIONS.md
Last active October 9, 2020 12:38 — forked from franklsm1/INSTRUCTIONS.md
Auto configure pre-commit hooks for a Gradle Spring App

Steps

  1. create a file called "pre-commit" with no extension in the project directory root
  2. add the code from the pre-commit file below into that new file
  3. create a new file called "preCommit.gradle" inside of the root gradle folder
  4. add the code from the preCommit.gradle file below into that new file
  5. add the following line into the build.gradle file:
    • apply from: "$projectDir/gradle/preCommit.gradle"

Now when you run the ./gradlew build command the git pre-commit hook will be automatically setup.

@buddyp450
buddyp450 / console out
Created February 24, 2016 02:03
Failed to add job (expected)
[INFO ] Completed state [db_backup] at time 21:02:52.146446
local:
----------
ID: db_backup
Function: schedule.present
Result: False
Comment: Failed to add job db_backup to schedule.
Started: 21:01:21.890688
Duration: 90255.758 ms
Changes:
@buddyp450
buddyp450 / backup.sls
Created February 24, 2016 01:37
Scheduled db backup for irc
db_backup:
schedule.present:
- function: cmd.run
- job_args:
- '/home/saltuser/do_sassy_postgres_backup.sh'
- cron: '0 3 * * * '
- job_kwargs:
stateful: false
Caused by: org.elasticsearch.common.util.concurrent.EsRejectedExecutionException: rejected execution (queue capacity 1000) on org.elasticsearch.transport.netty.MessageChannelHandler$RequestHandler@48072f3e
at org.elasticsearch.common.util.concurrent.EsAbortPolicy.rejectedExecution(EsAbortPolicy.java:62)
at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372)
at org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor.execute(EsThreadPoolExecutor.java:79)
at org.elasticsearch.transport.netty.MessageChannelHandler.handleRequest(MessageChannelHandler.java:224)
at org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:114)
at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
@buddyp450
buddyp450 / delete_from_elasticsearch.py
Created October 24, 2015 02:12 — forked from dforste/delete_from_elasticsearch.py
Python replacement for elasticsearch delete by query.
#!/bin/python
import elasticsearch
import sys, getopt
def main(argv):
number = 10
search = 'metrics.changes.total:0 AND type:puppet-report'
try:
opts, args = getopt.getopt(argv,"hs:n:",["search=","number="])
except getopt.GetoptError:
logstash:
pkg:
- installed
service.running:
- sig: /opt/logstash/lib/logstash/runner.rb\ agent\ -f\ /etc/logstash/conf.d
- enable: True
- require:
- pkg: logstash
- file: /etc/default/logstash
- watch: