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
require 'json' | |
require 'pry' | |
require 'active_support' | |
require 'date' | |
require 'csv' | |
class GHAudit | |
def initialize | |
@file = File.open('./gh_audit.json','r') |
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
# setup metasploit from master on github: https://github.com/rapid7/metasploit-framework/wiki/Setting-Up-a-Metasploit-Development-Environment | |
# good help on console and metasploit: http://www.offensive-security.com/metasploit-unleashed/Msfconsole | |
#start msfconsole | |
use auxiliary/scanner/http/apache_mod_cgi_bash_env | |
set VHOST app.local | |
set TARGETURI "/all" | |
set RPORT 3000 |
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 | |
# from http://ubuntuserverguide.com/2012/06/how-to-installing-nginx-with-php5-and-mysql-support-on-ubuntu-server-12-04-lts.html | |
PHP_SCRIPT=/usr/sbin/php-fastcgi | |
FASTCGI_USER=www-data | |
FASTCGI_GROUP=www-data | |
PID_DIR=/var/run/php-fastcgi | |
PID_FILE=/var/run/php-fastcgi/php-fastcgi.pid | |
RET_VAL=0 | |
case "$1" in |
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
SELECT table_schema "Data Base Name", SUM( data_length + index_length) / 1024 / 1024 | |
"Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema ; |
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
CREATE USER 'joe'@'%' IDENTIFIED BY 'xxxxxx'; | |
# ALL PRIVILEGES is everything except grant | |
GRANT ALL PRIVILEGES ON APP_production_temp.* TO 'joe'@'%'; | |
GRANT SELECT ON APP_production.* TO 'joe'@'%'; | |
GRANT SELECT ON stats_production.* TO 'joe'@'%'; |
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
1. Convert PEM into pub SSH key file: | |
ssh-keygen -e -f amazon-ec2-key.pem >> amazon-ec2-key.pem.pub | |
2. Generate a PEM from a SSH key: | |
openssl rsa -in my_tunneler -outform pem > my_tunneler.pem |
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
# Create a user with Login | |
sql = [%(CREATE ROLE jsmith WITH PASSWORD 'foobar' LOGIN)] | |
# # Allow to connect | |
sql << %(GRANT CONNECT ON DATABASE reports TO jsmith) | |
# # Allow to use schema | |
sql << %(GRANT USAGE ON SCHEMA public TO jsmith) | |
# # grant on current objects | |
sql << %(GRANT SELECT ON ALL TABLES IN SCHEMA public TO jsmith) | |
# # grant on future objects | |
sql << %(ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO jsmith) |
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 | |
@slave_status = Hash[%x(mysql -uroot -e 'SHOW SLAVE STATUS \\\G').split(/\s*\n\s*/).map { |e| spl = e.split(/\:\s*/); spl.size == 2 ? [spl.first, spl.last] : nil }.compact] | |
def slave_healthy? | |
@slave_status['Slave_IO_Running'] == 'Yes' && | |
@slave_status['Slave_SQL_Running'] == 'Yes' && | |
@slave_status['Seconds_Behind_Master'] != 'NULL' && | |
@slave_status['Seconds_Behind_Master'].to_i < 1800 | |
end |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>com.hankbeaver.DockerForMacLoopBack</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/System/Library/CoreServices/Spotlight.app/Contents/MacOS/Spotlight</string> | |
</array> |
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
#Gemfile contents | |
source "https://rubygems.org" | |
gem 'octokit' | |
gem "pry" | |
# END Gemfile | |
require 'rubygems' | |
require 'bundler/setup' | |
require 'octokit' | |
require 'csv' |