This file contains 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
NODE="a hostname" | |
IFS=$'\n' | |
for line in $(curl -s 'localhost:9200/_cat/shards' | fgrep UNASSIGNED); do | |
INDEX=$(echo $line | (awk '{print $1}')) | |
SHARD=$(echo $line | (awk '{print $2}')) | |
curl -XPOST 'localhost:9200/_cluster/reroute?pretty' -d '{ | |
"commands": [ | |
{ | |
"allocate": { |
This file contains 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 Start-PowerCLI { | |
<# | |
.NOTES | |
Loads PowerCLI, depending on what version you have installed. Set the default -Version parameter, depending in your environment. | |
#> | |
[cmdletbinding()] | |
param ( | |
[parameter(Mandatory = $false, Position = 0)] |
This file contains 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 | |
# | |
# Depends on: | |
# pywallet.py from https://github.com/pagobit/pywallet | |
# jq from https://stedolan.github.io/jq | |
for addr in $(./pywallet.py --dumpwallet | jq --raw-output ".keys[].addr"); do | |
echo "$addr balance:"; | |
curl https://insight.bitpay.com/api/addr/$addr/balance; | |
echo ""; |
This file contains 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
-- This script deletes all obsolete WSUS updates from a WSUS database. | |
-- For more information, visit http://thebashfuladmin.com/2016/05/13/workaround-for-wsus-sql-timeout-errors/ | |
USE SUSDB | |
DECLARE @UpdateID INT | |
DECLARE @message varchar(1000) | |
CREATE TABLE #ObsoleteUpdatesToCleanup (UpdateID INT) |
This file contains 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
<!-- usage --> | |
<!-- <xmp src="homepage.md" theme="cerulean" style="display:none;"></xmp> --> | |
<!-- <script src="load-xmp-src.js"></script> --> | |
var elements = document.body.getElementsByTagName("*"); | |
for(var i=0; i<elements.length; i++) { | |
var element = elements[i]; | |
if(element.nodeName == "XMP") { | |
var xhr = new XMLHttpRequest(); | |
xhr.open('GET', element.getAttribute("src"), false); |
This file contains 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 | |
# hosted at https://gist.github.com/Mark-Booth/5058384 | |
# forked from https://gist.github.com/lth2h/4177524 @ ae184f1 by mark.booth | |
# forked from https://gist.github.com/jehiah/1288596 @ e357c1e by lth2h | |
# ideas from https://github.com/kortina/bakpak/blob/master/bin/git-branches-vs-origin-master | |
# this prints out some branch status | |
# (similar to the '... ahead' info you get from git status) | |
# example: |
This file contains 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
######################################################################### | |
# Wifiscanner.py - A simple python script which records and logs wifi probe requests. | |
# Author - D4rKP01s0n | |
# Requirements - Scapy and Datetime | |
# Inspiration - Tim Tomes (LaNMaSteR53)'s WUDS https://bitbucket.org/LaNMaSteR53/wuds/ | |
# Reminder - Change mon0 (around line 65) to your monitor-mode enabled wifi interface | |
######################################################################### | |
from datetime import datetime |
This file contains 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
/etc/logstash/logstash.conf : | |
# We handle the syslog part of the Cisco PIX/ASA messages | |
grok { | |
tags => "cisco-fw" | |
patterns_dir => "/etc/logstash/patterns" | |
pattern => "^<%{POSINT:syslog_pri}>(?:(%{TIMESTAMP_ISO8601:timestamp8601} |%{CISCOTIMESTAMP:timestamp} ))?%{SYSLOGHOST:logsource}?[ :]+%{GREEDYDATA:syslog_message}" | |
} | |
syslog_pri { | |
tags => "cisco-fw" |
This file contains 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 | |
#assumes new downloads of shotcut is always in ~/Downloads | |
currpath=$(pwd) | |
cd ~/Downloads | |
chmod +x ./[Ss]hotcut-*.AppImage | |
#always choose the latest Shotcut-*.AppImage download | |
shotcut=$(ls -Art [Ss]hotcut-*.AppImage | tail -n 1 | cut -d' ' -f 9-) | |
cd "${currpath}" |
This file contains 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
$OU="OU=TheOUName,DC=yourdomain,DC=com" | |
$ShadowGroup="CN=ShadowGroupName,OU=TheOUName,DC=yourdomain,DC=com" | |
Import-Module ActiveDirectory | |
(Get-ADGroup -Identity $ShadowGroup -properties members).Members | Get-ADUser | Where-Object {$_.distinguishedName –NotMatch $OU} | ForEach-Object {Remove-ADPrincipalGroupMembership –Identity $_ –MemberOf $ShadowGroup –Confirm:$false} | |
Get-ADUser –SearchBase $OU –SearchScope OneLevel –LDAPFilter "(!memberOf=$ShadowGroup)" | ForEach-Object {Add-ADPrincipalGroupMembership –Identity $_ –MemberOf $ShadowGroup} |
OlderNewer