Skip to content

Instantly share code, notes, and snippets.

@brc75
brc75 / AWS IAM Policy - ForceMFA.json
Created April 30, 2018 17:14 — forked from incyclum/AWS IAM Policy - ForceMFA.json
AWS IAM Policy - Force MFA - This policy allows users to manage their own passwords and MFA devices but nothing else unless they authenticate with MFA
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowAllUsersToListAccounts",
"Effect": "Allow",
"Action": [
"iam:ListAccountAliases",
"iam:ListUsers",
"iam:GetAccountPasswordPolicy",
@brc75
brc75 / kill-fusion.php
Created June 1, 2018 17:31 — forked from bpmore/kill-fusion.php
remove fusion builder shortcodes
<?php
add_filter('the_content', 'remove_fusion_shortcodes', 20, 1);
function remove_fusion_shortcodes( $content ) {
$content = preg_replace('/\[\/?fusion.*?\]/', '', $content);
return $content;
}
?>
**Tested with WP All Import and Export**
@brc75
brc75 / checkDockerDisks.sh
Created August 14, 2018 23:32 — forked from robsonke/checkDockerDisks.sh
This Bash script will loop through all running docker containers on a host and list the disk usage per mount. In case it's breaching the 65%, it will email you.
#!/bin/bash
# get all running docker container names
containers=$(sudo docker ps | awk '{if(NR>1) print $NF}')
host=$(hostname)
# loop through all containers
for container in $containers
do
echo "Container: $container"
@brc75
brc75 / README.md
Created August 15, 2018 12:20 — forked from mmoulton/README.md
Docker Container Stats Collection Using Collectd

Docker stats collection for collectd

This script can be used to feed collectd with cpu and memory usage statistics for running docker containers using the collectd exec plugin.

This script will report the used and cached memory as well as the user and system cpu usage by inspecting the appropriate cgroup stat file for each running container.

Usage

This script is intented to be executed by collectd on a host with running docker containers. To use, simply configure the exec plugin in collectd to execute the collectd-docker.sh script. You may need to adjust the script to match your particulars, such as the mount location for cgroup.

@brc75
brc75 / slack_history.py
Created August 15, 2018 18:26 — forked from Chandler/slack_history.py
Download Slack Channel/PrivateChannel/DirectMessage History
# MIT License
# Copyright (c) 2016 Chandler Abraham
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@brc75
brc75 / mysql-docker.sh
Created February 2, 2019 03:31 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
ps aux | grep http | grep -v "\(root\|grep\)" | wc -l
Search document for
\[(.*?)\]
Diskpart
Select disk 0 (0 being the disk to setup)
Clean (wipe the disk)
Convert gpt (convert disk to GPT)
Create partition efi size=200 (EFI system partition)
Assign letter=s (Any allowable letter)
Format quick fs=FAT32 (Format the ESP)
Create partition msr size=128 (Create the MSR partition)
Create partition primary (Create Windows partition)
Assign letter=c