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 os | |
import json | |
import boto3 | |
import urllib3 | |
# Set the following in the Lambda Environment variables | |
IP_SET_ID = os.environ.get('IP_SET_ID') | |
Special_IPs = os.environ.get('SPECIAL_IPS').split(',') | |
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
- hosts: localhost | |
gather_facts: no | |
vars: | |
aws_profile: "aws_account_name" | |
acm_domain: "example.com" | |
acm_extra_domains: "*.example.com" | |
acm_idempotency_token: "examplecomtoken" | |
dns_zone: "example.com" | |
environment: | |
AWS_PROFILE: "{{ aws_profile }}" |
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 boto3 | |
import json | |
import requests | |
from datetime import datetime | |
import sys | |
HOST = 'MY.HOST.ADDRESS' | |
PORT = 12201 # change if you create graylog input with different port | |
queue_url = 'https://sqs.ZONE.amazonaws.com/ACCOUNT/QUEUENAME' |
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 | |
# very specific need | |
top_process=$(ps -eo pid,cmd,%cpu --sort=-%cpu | head -n2 | tail -n1) | |
if [[ $top_process == *sometest* ]]; then | |
PATHTOPROCESS=$(echo $top_process| awk '{print $1}' | xargs lsof -p | grep public_html) | |
logger -it HIGHCPU "Process $top_process in $PATHTOPROCESS" | |
fi |
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
--- | |
- hosts: all | |
tasks: | |
- lineinfile: "dest=/etc/newrelic-infra.yml line='license_key: YOURKEYHERE' create=yes state=present" | |
- apt_key: | |
state=present | |
url=https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg | |
- apt_repository: "repo='deb [arch=amd64] http://download.newrelic.com/infrastructure_agent/linux/apt {{ansible_distribution_release}} main' state=present update_cache=yes" | |
- apt: name=newrelic-infra |
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
<?php | |
/* | |
Plugin Name: My Plugin | |
Plugin URI: https://deeb.me | |
Description: 10 ways to peel an orange | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} |
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 | |
# | |
# Author: Abdallah Deeb <abdallah@deeb.me> | |
# Requirements: python, pip, virtualenv, virutalenvwrapper, git | |
# | |
# Edit the following 2 lines | |
PROJECTNAME=proj | |
APPNAME=myapp | |
if [ -n "$2" ] | |
then |
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
IPRANGE=10.10.10.0/24 | |
nmap -sU -pU:123 -Pn -n --script=ntp-monlist $IPRANGE | grep -B 4 ntp-monlist | grep report | awk '{ print $5 }' |
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
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_URI} !\.(png|css)$ | |
RewriteRule (.*) n.php [L,QSA] |
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
[Definition] | |
failregex = <HOST>.*] "POST /wp-login.php | |
ignoreregex = |
NewerOlder