This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -e -x | |
| # Shutdown the dataloop agent. | |
| sudo service dataloop-agent stop || true | |
| # Kill stragglers in the even that the service control didn't work right. | |
| agentPids=$(ps -ef | grep 'dataloop-lin-agent' | grep -v 'grep' | sed 's/ \+/ /g' | cut -d' ' -f2) | |
| test -n "${agentPids}" && sudo kill -9 ${agentPids} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| organization := "org.foo.bar" | |
| name := "JustAnExample" | |
| version := "1.0" | |
| scalaVersion := "2.10.3" | |
| scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "utf8") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| ## | |
| # NB: The example below is useful when you want to delete indexes and aliases which match a certain pattern. | |
| # To simply delete everything (and assuming the "action.disable_delete_all_indices" configuration isn't set to "false"), | |
| # you can use: | |
| # curl -XDELETE http://localhost:9200/_all | |
| test -z $1 && echo 'error: missing required parameter: match-pattern (or "_all" to delete all indices)' 1>&2 && exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| """ThreatStream Raw Intelligence downloader. Puts into 1 file for each itype.""" | |
| __author__ = 'Jay Taylor [@jtaylor]' | |
| import io, json, requests, os | |
| ################################################################################ | |
| # Begin configuration |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| trait EnvHacker { | |
| /** | |
| * Portable method for setting env vars on both *nix and Windows. | |
| * @see http://stackoverflow.com/a/7201825/293064 | |
| */ | |
| def setEnv(newEnv: Map[String, String]): Unit = { | |
| try { | |
| val processEnvironmentClass = Class.forName("java.lang.ProcessEnvironment") | |
| val theEnvironmentField = processEnvironmentClass.getDeclaredField("theEnvironment") | |
| theEnvironmentField.setAccessible(true) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| pattern='' | |
| host='localhost:9200' | |
| expr $( | |
| curl --fail --silent http://${host}/_cat/indices?v | \ | |
| sed 's/ \{1,\}/ /g' | \ | |
| grep " ${pattern}.*" | \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| logging_collector = on | |
| log_directory = '/tmp' | |
| log_filename = 'postgresql-%Y-%m-%d.log' | |
| log_rotation_age = 1d | |
| log_checkpoints = on | |
| log_connections = on | |
| log_disconnections = on | |
| log_duration = on | |
| log_hostname = on | |
| log_line_prefix = '[%m] [pid=%p user=%u@%r db=%d xid=%x] %q[sid=%c line=%l] ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -e -x | |
| target='/usr/local/bin/shipbuilder-cleanup' | |
| sudo curl --location --fail --silent --show-error --remote-name "${target}" 'https://gist.github.com/jaytaylor/2604ff09845d4c6189c8/raw/shipbuilder-cleanup' | |
| sudo chmod a+x "${target}" | |
| echo "1 * * * * service ntp stop && /usr/sbin/ntpdate 0.pool.ntp.org 1.pool.ntp.org time.apple.com time.windows.com && service ntp start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| import inspect, string | |
| def get_decorators_above_fn(function_declaration_fragment, class_of_interest, trim_dec_fn_names=False): | |
| """ | |
| Given a function declaration fragment string and a target class, will return the names of any decorators for the | |
| function. | |
| Note: the function_declaration_fragment parameter has .strip() applied to reduce the odds of spacing breaking detection. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| ## | |
| # | |
| # @author Jay Taylor [@jtaylor] | |
| # | |
| # @date | |
| # | |
| # @description Busy-box compatible automatic RAR extraction system. | |
| # |