Skip to content

Instantly share code, notes, and snippets.

View petergi's full-sized avatar
💭
Just Busy Living On The Side Of A Square

Peter Giannopoulos petergi

💭
Just Busy Living On The Side Of A Square
View GitHub Profile
@petergi
petergi / With Brew Info
Created June 14, 2020 15:18
Homebrew: Open Brew Package Info Website
brew home $1 2> /dev/null || brew cask home $1

OBD Protocol IDs and Names

ID Name
1 SAE J1850 PWM
2 SAE J1850 VPW
3 AUTO, ISO 9141-2
4 ISO 14230-4 (KWP 5BAUD)
@petergi
petergi / moshInstall2AmazonAMI.sh
Created July 29, 2021 19:22 — forked from pesblog/moshInstall2AmazonAMI.sh
mosh install to AWS EC2 (Amazon AMI)
#!/bin/sh
sudo yum -y install autoconf automake gcc gcc-c++ make boost-devel zlib-devel ncurses-devel protobuf-devel openssl-devel
cd /usr/local/src
sudo wget http://mosh.mit.edu/mosh-1.3.2.tar.gz
sudo tar xvf mosh-1.2.4.tar.gz
cd mosh-1.2.4
sudo ./autogen.sh
sudo ./configure
sudo make

Top Header

sub header

sub header 2

sub header 3

Add a blank line to end a paragraph.

#!/bin/bash
hostname=$(HOSTNAME | sed 's/.local//g' | sed 's/.gateway//g' )
# if hostname is >35 characters, truncates to make it fit on std. 80 window
if [ ${#HOSTNAME} -gt 35 ]
then
hostname=${HOSTNAME:0:35}
fi
system_profiler SPDisplaysDataType | grep Resolution
networksetup -listallhardwareports
#!/bin/bash
mem=$(sysctl -n hw.memsize)
mem="$((mem/1073741274)) GB"
echo $mem
#!/bin/bash
model=$(system_profiler SPHardwareDataType | awk '/Model Identifier/ { print $3 }')
# use grep to find the model in the list, then delete from ) to end of line
modelname=`grep $model $DIR/Models.txt | sed -e 's/).*/)/g'`
echo $modelname