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
pipeline { | |
options { | |
buildDiscarder(logRotator(numToKeepStr: '10')) // Retain history on the last 10 builds | |
ansiColor('xterm') // Enable colors in terminal | |
timestamps() // Append timestamps to each line | |
timeout(time: 20, unit: 'MINUTES') // Set a timeout on the total execution time of the job | |
} | |
agent { | |
// Run this job within a Docker container built using Dockerfile.build | |
// contained within your projects repository. This image should include |
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
## Slow requests grouped by function call | |
cat /var/log/php-fpm/www-slow.log | grep -A 1 script_filename | \ | |
grep -v script_filename | grep -v -e "--" | cut -c 22- | sort | uniq -c | sort -nr | |
## Slow requests grouped by minute | |
cat /var/log/php-fpm/www-slow.log | grep 'pool www' | \ | |
cut -d' ' -f2 | sort | cut -d: -f1,2 | uniq -c | |
## Top 25 1 minute groups of slow requests | |
cat /var/log/php-fpm/www-slow.log | grep 'pool www' | cut -d' ' -f2 | \ |
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 | |
# This script will find all AWS CloudFormation stacks matching the supplied filter | |
# and export the outputs into environment variables. | |
# | |
# This script is assumed to be run on a host with an IAM profile matching the following: | |
# | |
# { | |
# "Version": "2012-10-17", | |
# "Statement": [ |
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
# Export IP addresses to support vulnerability scanning | |
# Public IPs | |
touch /tmp/public-ips.txt | |
aws ec2 describe-instances \ | |
--query "Reservations[*].Instances[*].PublicIpAddress" \ | |
--output=text \ | |
>>/tmp/public-ips.txt | |
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/local/bin/bash | |
#Remember to set | |
#export MAIL_SYNC_SRC= | |
user1=$1 | |
user2=$2 | |
passwd_file=$3 | |
imapsync --host1 $MAIL_SYNC_SRC --user1 "$user1" --passfile1 "$passwd_file" --ssl1 --port1 993\ |
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 python | |
import os | |
import re | |
import daemon | |
import asyncore | |
import smtpd | |
class SimpleRelayService(smtpd.PureProxy): | |
"""Handles processing mail for relay""" |
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
const puppeteer = require('puppeteer'); | |
const debug = process.env.DEBUG == 'true'; | |
const url = 'https://stocktwits.com/mrinvestorpro'; | |
const main = async () => { | |
const browser = await puppeteer.launch({ headless: !debug }); | |
try { | |
console.log('Launching page'); |
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 ruby | |
# Export node group data from Puppet Enterprise | |
# Setup: | |
# export PATH=$PATH:/opt/puppetlabs/puppet/bin | |
# gem install --user-install puppetclassify | |
# puppet-access login --lifetime 8h | |
require 'csv' |
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 | |
service xinetd stop | |
service foreman-proxy stop | |
service httpd stop | |
killall -9 sidekiq | |
service puppet stop | |
service puppetserver stop | |
service postgresql stop | |
service rh-redis5-redis stop |
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
package main | |
import ( | |
"github.com/aws/aws-lambda-go/events" | |
"github.com/aws/aws-lambda-go/lambda" | |
"github.com/aws/aws-sdk-go/aws" | |
"github.com/aws/aws-sdk-go/aws/session" | |
"github.com/aws/aws-sdk-go/service/s3" | |
"github.com/aws/aws-sdk-go/service/s3/s3manager" | |
"github.com/pkg/errors" |
NewerOlder