Skip to content

Instantly share code, notes, and snippets.

View unacceptable's full-sized avatar
👑
Listen. Strange women lying in ponds distributing swords is no basis for a sys..

Robert J. unacceptable

👑
Listen. Strange women lying in ponds distributing swords is no basis for a sys..
View GitHub Profile
#!/bin/bash
set -e
# ANSI color table that relates to RGB (NOT true RGB)
# Written by: Robert J.
# _/ _/ _/ _/ _/
# _/_/_/_/_/ _/ _/_/_/ _/_/_/ _/_/_/ _/_/_/
# _/ _/ _/ _/ _/ _/ _/ _/_/ _/ _/
# _/_/_/_/_/ _/ _/ _/ _/ _/_/ _/ _/
# _/ _/ _/ _/_/_/ _/_/_/ _/_/_/ _/ _/
@unacceptable
unacceptable / Desktop-Cleanup.sh
Last active March 27, 2017 20:57
This is a was one of my first bash scripting projects: using cron and bash script to move photos to appropriately named directories under ~/Pictures. Please don't judge this too hard. I need to rewrite this in a better fashion at some point.
#!/bin/bash
set -e
# Writen by: Robert J.
##### Recommended Crontab:
##########################
# * * * * * ~/Applications/Startup/Desktop-Cleanup.sh
# Here is a fish for your viewing pleasure:
#!/bin/bash
set -e
# Written by: Robert J.
#######################################
### Info Function #####################
#######################################
db_info(){
DB_SSH_USR=user

processcount.sh

Description

This is a simple oneliner that I wrote so that I could quicly get an overview of the counts of each process.

NOTE:

Too many TASK_UNINTERRUPTIBLE processes can cause significant Disk Utilization.

Example

@unacceptable
unacceptable / README.md
Last active February 27, 2019 08:19
This leverages the AWS CLI to easily check availability and order a domain.

Order domain.sh

Description

Have you ever wished that there was an easy way to order domains via the command line? Look no further! You can check a domain's availability and order it via this utility.

Prerequisits

Install the AWS CLI

@unacceptable
unacceptable / Monitoring.py
Last active July 14, 2017 01:55
This is just a simple verbiage generation script for CRM.
#!/usr/bin/python
import sys;
import re;
#######################################
### Main Function #####################
#######################################
def main():
@unacceptable
unacceptable / aws_scan.sh
Last active September 6, 2017 14:20
This is a quick and dirty to scan the EC2 and RDS instances on an account, and by no means is using best practices for parsing json.
while read -r region; do
printf "%s:\n" "$region";
aws ec2 describe-instances --region "$region" | \
awk -F '"' '/InstanceType/ {print $4}' | \
sort | \
uniq -c;
aws rds describe-db-instances --region "$region" | \
awk -F '"' '/DBInstanceClass/ {print $4}' | \
sort | \
uniq -c;
@unacceptable
unacceptable / watch_brute_force_source_ips
Last active October 2, 2017 01:11
Watch brute force attempts on a non-secured server. (will list IPs)
tail -f /var/log/secure | awk -F "=" '/fail/ && /rhost/ {print$7}'
# .bash_profile
# Shell look and path
export PS1='$(date +%H:%M) \[\e[0;32m\]Mac Shell: \W/>\$ \[\e[m\]'
PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$HOME/Scripts/.bin"
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
# Shell Histroy:
HISTTIMEFORMAT="%d/%m/%y %T "
@unacceptable
unacceptable / BinSort.py
Last active November 30, 2018 19:41
This is a simple binary sort algorithm written in Python.
#!/usr/bin/env python
import logging
import sys
import json
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def main():