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
# Move index names from bro-YYYY.MM.DD to bro-v1-YYYY.MM.DD | |
for item in $(curl -s -n -XGET localhost:9200/_cat/indices | awk '/bro-/ { split($3,a,"-"); print a[2] }'); do | |
cat <<EOF | curl -s -n -XPOST localhost:9200/_reindex -d @- >/dev/null | |
{ "source": {"index": "bro-${item}"}, "dest": {"index": "bro.v1-${item}"} } | |
EOF | |
echo -e "\nCloned data from bro-${item} to bro.v1-${item}" | |
done |
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
egrep -e "processor" -e "core id" -e ^physical /proc/cpuinfo | \ | |
xargs -l3 echo | \ | |
awk -vOFS='\t' '{ print "{\"socket\": "$7", \"core\": " $11 ", \"proc\":" $3 "}" }' | \ | |
jq -sc ' | |
[.[] | {sock_core:"\(.socket)-\(.core)", proc, core, socket } ] | |
| group_by(.sock_core) | .[] | .[0] ' | \ | |
sort -V |
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
# Copyright 2014 Google Inc. All rights reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
This is a CentOS-themed /etc/issue w/ hooks to update IP address and OS release upon ifup/ifdown. My motivation was that I was tired of logging into an otherwise headless box just to find the IP of the system so I can SSH to it.
Note
|
The issue.in file actually contains control characters to do the color
in the text. The easiest way to preserve that is to clone this gist and run
the install.sh script w/ sudo, which will copy the file and set the SELinux
|
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
[Unit] | |
Description=Elasticsearch | |
Documentation=http://www.elastic.co | |
Wants=network-online.target | |
After=network-online.target | |
[Service] | |
Environment=ES_HOME=/usr/share/elasticsearch | |
Environment=CONF_DIR=/etc/elasticsearch | |
Environment=DATA_DIR=/var/lib/elasticsearch |
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/local/bin/jq -s -r -f | |
( map(keys) | add | unique ) as $cols | | |
map(. as $row | $cols | map($row[.])) as $rows | | |
$cols, $rows[] | @csv |
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
function Get-DownloadedPEHashes | |
{ | |
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory=$true, Position=0)] | |
[String]$Path, | |
[Switch]$Recursive = $true | |
) | |
if (!$Path.EndsWith('\')) |
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 python2 | |
from multiprocessing import Pool | |
from time import sleep | |
from random import randint, gauss | |
import os, sys | |
import requests | |
## TODO | |
# . recursively download linked resources: | |
# . images |
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
#!/bin/bash | |
curl --location https://github.com/raspberrypi/firmware/raw/master/boot/bcm2710-rpi-3-b.dtb > /boot/bcm2710-rpi-3-b.dtb | |
curl --location https://github.com/RPi-Distro/firmware-nonfree/raw/54bab3d6a6d43239c71d26464e6e10e5067ffea7/brcm80211/brcm/brcmfmac43430-sdio.bin > /usr/lib/firmware/brcm/brcmfmac43430-sdio.bin | |
curl --location https://github.com/RPi-Distro/firmware-nonfree/raw/54bab3d6a6d43239c71d26464e6e10e5067ffea7/brcm80211/brcm/brcmfmac43430-sdio.txt > /usr/lib/firmware/brcm/brcmfmac43430-sdio.txt | |
echo "Reboot to ensure the dtb is initialized and kernel knows about the hardware in place." | |
echo |