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
$Server='192.168.1.9:32400' | |
$PlexToken = 'FGir5aQ5yfpRZZ4ZqxAg' | |
$libraries = Invoke-RestMethod -Uri "http://$server/library/sections/all?X-Plex-Token=$PlexToken" | |
$VideoLibraries = $libraries.MediaContainer.Directory | ?{$_.type -eq 'show'} | |
$Resolutions = @{ | |
"sd" = 1 | |
"420" = 10 | |
"720" = 20 | |
"1080" = 30 | |
} |
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 bash | |
mkdir -p /etc/systemd/system/amazon-ssm-agent.service.d | |
echo "[Service]" > /etc/systemd/system/amazon-ssm-agent.service.d/override.conf | |
echo 'Environment="https_proxy=http://proxy:3128"' >> /etc/systemd/system/amazon-ssm-agent.service.d/override.conf | |
echo 'Environment="http_proxy=http://proxy:3128"' >> /etc/systemd/system/amazon-ssm-agent.service.d/override.conf | |
echo 'Environment="no_proxy=169.254.169.254"' >> /etc/systemd/system/amazon-ssm-agent.service.d/override.conf | |
chmod 777 /etc/systemd/system/amazon-ssm-agent.service.d/override.conf | |
systemctl stop amazon-ssm-agent | |
systemctl daemon-reload | |
systemctl restart amazon-ssm-agent |
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
if(!$credential){ | |
$credential = Get-Credential | |
} | |
$baseurl = 'http://zabbix.global.root' | |
$params = @{ | |
body = @{ | |
"jsonrpc"= "2.0" | |
"method"= "user.login" | |
"params"= @{ | |
"user"= $credential.UserName |
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
# Stolen from http://ctrlf5.net/?p=263 and http://www.dailycoding.com/posts/convert_image_to_base64_string_and_base64_string_to_image.aspx | |
function ConvertFrom-StringToMemoryStream{ | |
param( | |
[parameter(Mandatory)] | |
[string]$InputString | |
) | |
$stream = New-Object System.IO.MemoryStream; | |
$writer = New-Object System.IO.StreamWriter($stream); | |
$writer.Write($InputString); |
Use these two files to add disks to your VMs (here adding three disks) when Kitchen spins up Vagrant boxes.
test_helper.bash
(add to your bats test withload test_helper
)vagrantfile.rb
(add to your.kitchen.yml
using)
---
driver:
name: vagrant
vagrantfiles:
- vagrantfile.rb
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
find . -iregex ".*.\(mp4\|mkv\)" -exec ~/medialanguage.sh "{}" \; | jq '. | select(.Languages | index("English") | not)' |
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
import sys | |
import boto3 | |
import datetime | |
cw = boto3.client('cloudwatch') | |
list_metrics_paginator = cw.get_paginator('list_metrics') | |
function_stats = [] |
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
aws dynamodb scan --table-name TABLE > export.json | |
import json | |
import boto3 | |
dynamo = boto3.client('dynamodb') | |
TABLE_NAME = 'TABLE_NAME' | |
JSON_PATH = '/Users/USERNAME/git/GitHub/dynamodump/export.json' | |
with open(JSON_PATH, 'r') as file: | |
data = file.read() | |
parsed_file = json.loads(data) | |
for item_to_import in parsed_file['Items']: |
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
import urllib | |
import urllib2 | |
import json | |
def lambda_handler(event, context): | |
url = 'https://rightgif.com/search/web' | |
NewerOlder