Skip to content

Instantly share code, notes, and snippets.

View heyseus1's full-sized avatar

Matthew M. heyseus1

View GitHub Profile
@heyseus1
heyseus1 / smartctl.sh
Created July 14, 2016 17:06
for loop for smartctl partitions
for i in {a..z}; do smartctl -H -x /dev/sd${i}; done
@heyseus1
heyseus1 / hadoop.sh
Created July 15, 2016 18:14
for jbod hadoop disk swap
# Hadoop check
#!/bin/sh
woot() {
if [ -n "$( lsmod | grep -i megaraid_sas )" ];
then
echo "Hadoop host has LSI MegaRAID"
/opt/MegaRAID/MegaCli/MegaCli64 -PDList -aAll | egrep -i 'Raw Size:|count|^Device Id: |firmware state' | grep -v 'Count: 0' | perl -p -e 's/Firmware state: (.*)$/Firmware state: $1\n/' | ruby -ne 'puts " " * 4 + $_'
install_deps ()
{
apt-get update
apt-get -y upgrade
apt-get -y install git dialog
}
#----------------------------------------------------------------------------------------------------------------------
RetroPie-git ()
{
@heyseus1
heyseus1 / mulesoftlogger.py
Created September 26, 2016 19:33
python script for mulesoft log collection
#!/usr/bin/env python
### create file appconfig.py
### requires application & ENV id in this format
### copy the text below and adjust in appconfig.py
### applications = [('app-name', 'XXXXXX-XXXXX-XXXXX'),
#### print(applications, "printing APP and env_id")
""" Mulesoft log collection script in json format output
"""
@heyseus1
heyseus1 / mulesoftlogger.sh
Created September 26, 2016 19:34
hacky way to gather logs for mulesoft
~#!/bin/bash
# API log call
##### SUBJECT TO CHANGE!!!!!!#######
# Matthew Morcaldi 2016
show_menu(){
NORMAL=`echo "\033[m"`
MENU=`echo "\033[36m"` #Blue
NUMBER=`echo "\033[33m"` #yellow
FGRED=`echo "\033[41m"`
require 'uri'
require 'net/http'
require 'colorize'
url = URI("") ### add api key URI
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
@heyseus1
heyseus1 / cpu.sh
Created April 28, 2017 21:20
CPU info
#!/bin/sh
CPUFILE=/proc/cpuinfo
test -f $CPUFILE || exit 1
NUMPHY=`grep "physical id" $CPUFILE | sort -u | wc -l`
NUMLOG=`grep "processor" $CPUFILE | wc -l`
if [ $NUMPHY -eq 1 ]
then
echo This system has one physical CPU,
else
echo This system has $NUMPHY physical CPUs,
#!/bin/bash
setjdk() {
if [ $# -ne 0 ]; then
removeFromPath '/System/Library/Frameworks/JavaVM.framework/Home/bin'
if [ -n "${JAVA_HOME+x}" ]; then
removeFromPath $JAVA_HOME
fi
export JAVA_HOME=`/usr/libexec/java_home -v $@`
export PATH=$JAVA_HOME/bin:$PATH
fi
install_deps ()
{
apt-get -y install \
subversion
}
git_tomcat_configs ()
{
cd /
svn export --force svn+ssh://svn.kqed.org/var/svn/repo/config/trunk/tomcat/tomcat_config_java_7/ .
ls -ls /vagrant
@heyseus1
heyseus1 / docker_deploy_atlassian.sh
Created June 8, 2017 18:09
atlassian suite docker deploy
#!/bin/bash
checkroot() {
if [ $UID -ne 0 ] ; then
echo "User has insufficient privilege."
exit 4
fi
}