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 | |
PASSWORD="badpassword" | |
create_config(){ | |
cat <<EOF > "${1}" | |
port 555"${2}" | |
sentinel monitor mycluster 127.0.0.1 7770 2 | |
sentinel down-after-milliseconds mycluster 5000 | |
sentinel failover-timeout mycluster 60000 | |
sentinel parallel-syncs mycluster 1 |
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
$s = Get-Content script.ps1 | Out-String | |
$j = [PSCustomObject]@{ | |
"Script" = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($s)) | |
} | ConvertTo-Json -Compress | |
$oneline = "[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String(('" + $j + "' | ConvertFrom-Json).Script)) | iex" | |
$c = [convert]::ToBase64String([System.Text.encoding]::Unicode.GetBytes($oneline)) | |
("Powershell -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -Encoded " + $c) | Out-File -Encoding Default script.cmd |
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
version: '3.5' | |
services: | |
kibana: | |
image: docker.elastic.co/kibana/kibana:7.4.2 | |
environment: | |
- ELASTICSEARCH_HOSTS=http://es01:9200 | |
- ELASTICSEARCH_USERNAME=kibana | |
- ELASTICSEARCH_PASSWORD=agoodpassword | |
ports: | |
- target: 5601 |
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
#!/usr/bin/env python3 | |
import time | |
import random | |
from rpi_ws281x import PixelStrip, Color | |
import argparse | |
# LED strip configuration: | |
LED_COUNT = 50 # Number of LED pixels. | |
LED_PIN = 18 # GPIO pin connected to the pixels (18 uses PWM!). |
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
apiVersion: kibana.k8s.elastic.co/v1alpha1 | |
kind: Kibana | |
metadata: | |
name: hcpss | |
spec: | |
version: 7.2.0 | |
nodeCount: 1 | |
elasticsearchRef: | |
name: hcpss |
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
apiVersion: elasticsearch.k8s.elastic.co/v1alpha1 | |
kind: Elasticsearch | |
metadata: | |
name: hcpss | |
spec: | |
version: 7.2.0 | |
nodes: | |
- nodeCount: 3 | |
config: | |
node.master: true |
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 Get-Subordinates(){ | |
param( | |
[Parameter(Mandatory=$True, | |
HelpMessage='The username of the person at the top of the org')] | |
[string]$Username, | |
[Parameter(Mandatory=$False, | |
HelpMessage='The level to traverse into the org, i.e. 1 = only include direct reports, -1 = all')] | |
[int]$Depth | |
) |
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 | |
apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - | |
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
apt-get update | |
apt-get install -y docker-ce docker-ce-cli containerd.io | |
curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
chmod +x /usr/local/bin/docker-compose |
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 List-Acls { | |
param ( | |
$Path, | |
$Depth | |
) | |
$Depth = $Depth - 1 | |
Get-ChildItem $Path | ForEach-Object{ | |
$FullName = $_.FullName | |
$FilePath = $_.FullName -replace "^[^$]+\$\\" | |
$FileOrFolder = "File" |
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/sh | |
SRC="$1" | |
DST="$2" | |
SECRET_NAME="$3" | |
SLEEP=3 | |
if [ "$SRC" = "localhost" ] | |
then | |
secret=$(docker service create --restart-condition=none --name copy_secret --secret $SECRET_NAME -d alpine cat /run/secrets/$SECRET_NAME >/dev/null; sleep $SLEEP; docker service logs --raw copy_secret; docker service rm copy_secret>/dev/null) |