Skip to content

Instantly share code, notes, and snippets.

View ryanmaclean's full-sized avatar
Harnessing GenAI 💜

Ryan MacLean ryanmaclean

Harnessing GenAI 💜
View GitHub Profile
@ryanmaclean
ryanmaclean / remove_bad_known_host.sh
Created May 19, 2016 00:06
Remove an Entry From known_hosts
#!/bin/bash
# Replace '1d' with the offending line number, for example '10d' would be for the 10th line
# The line number is the number after ":" in your warning, for example:
# "Offending ECDSA key in /home/root/.ssh/known_hosts:10"
sed -i '1d' ~/.ssh/known_hosts
@ryanmaclean
ryanmaclean / check_homebrew_install.sh
Last active January 5, 2022 16:53
Check if Homebrew is Installed Via Bash
#!/bin/sh
# Check to see if Homebrew is installed, and install it if it is not
command -v brew >/dev/null 2>&1 || { echo >&2 "Installing Homebrew Now"; \
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"; }
@ryanmaclean
ryanmaclean / 6mcal.sh
Created April 25, 2016 21:00
Display 6 Month Calendar in Bash
#!/bin/bash
cal -A 3 -B 2
# Result
# February 2016 March 2016 April 2016
#Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa
# 1 2 3 4 5 6 1 2 3 4 5 1 2
# 7 8 9 10 11 12 13 6 7 8 9 10 11 12 3 4 5 6 7 8 9
#14 15 16 17 18 19 20 13 14 15 16 17 18 19 10 11 12 13 14 15 16
#21 22 23 24 25 26 27 20 21 22 23 24 25 26 17 18 19 20 21 22 23
@ryanmaclean
ryanmaclean / osx_port_scan.sh
Created April 25, 2016 05:52
Mac OSX: Port Scan Your Own Network with Netcat from Homebrew
#!/bin/bash
# Turn on job control to do more than one at a time
set -m
# Check to see if Homebrew is installed, and install it if it is not
command -v brew >/dev/null 2>&1 || { echo >&2 "You will need Homebrew to use this tool, installing now"; /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"; }
# Check to see if `netcat` is installed, install it if it is not
command -v netcat >/dev/null 2>&1 || { echo >&2 "You will also need netcat in order to use this tool, installing it now"; brew install netcat; }

git clone --recursive http://github.com/ryanmaclean/5-min-belk-stack.git

@ryanmaclean
ryanmaclean / remove_stopped_dockers.sh
Created April 10, 2016 22:48
Remove all stopped Docker Containers
#!/bin/bash
docker rm $(docker ps -a | sed '1d' | awk '{print $1}')
@ryanmaclean
ryanmaclean / delete_all_docker_images.sh
Created April 10, 2016 22:44
Forcefully Delete All Local Docker Images
#!/bin/bash
docker rmi -f $(docker images | sed '1d' | awk '{print $3}')
@ryanmaclean
ryanmaclean / cat_eof_es_example.sh
Last active May 6, 2016 22:54
Cat EOF (Here File) for Elasticsearch Config File
#!/bin/bash
cat >> /etc/elasticsearch/elasticsearch.yml << EOF
cluster.name: ELASTICAWESOME
cloud.aws.access_key: ACCESS_KEY_HERE
cloud.aws.secret_key: SECRET_KEY_HERE
cloud.aws.region: us-east-1
discovery.type: ec2
discovery.ec2.tag.Name: "ELKBEE"
http.cors.enabled: true
http.cors.allow-origin: "*"
@ryanmaclean
ryanmaclean / logitech_custom_buttons_ubuntu.md
Last active January 23, 2024 07:58
Change Logitech Mouse Button Keys in Ubuntu Vivid

Change Logitech Mouse Buttons in Ubuntu

Dependencies

We'll need to install xbindtools and xev prior to configuring our mouse buttons:

sudo apt-get install xev xbindtools
@ryanmaclean
ryanmaclean / match_non_whitespace.md
Last active January 11, 2016 21:38
Regex: Match all but Space Character

Regex to Match All Characters Except Spaces

[^\s]+