Skip to content

Instantly share code, notes, and snippets.

@MohamedAlaa
Last active October 25, 2018 19:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save MohamedAlaa/58206c8ba8e3e8510496 to your computer and use it in GitHub Desktop.
Save MohamedAlaa/58206c8ba8e3e8510496 to your computer and use it in GitHub Desktop.
osx computer info in terminal
#!/bin/bash
echo "--------------------------------------------------------------------------------"
uname -a
echo "--------------------------------------------------------------------------------"
MEMORY=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Memory' | awk '{print $1 $2 $3}'`
echo "$MEMORY"
echo "--------------------------------------------------------------------------------"
CORES_COUNT=`sysctl hw.ncpu | awk '{print $2}'`
echo "CPU"
sysctl -n machdep.cpu.brand_string
echo "$CORES_COUNT Cores"
echo "--------------------------------------------------------------------------------"
df -h
echo "--------------------------------------------------------------------------------"
echo Local IPs
ifconfig | grep 'inet ' | awk '{print $2}' | sed 's/addr:/ - /g'
echo "--------------------------------------------------------------------------------"
SERVER_NAME=`hostname`
echo "SERVER INFO: $SERVER_NAME"
echo "SERVER ROLE: solo"
echo "GEM_HOME: $GEM_HOME"
echo "--------------------------------------------------------------------------------"
@x1unix
Copy link

x1unix commented Feb 17, 2017

Why SERVER ROLE is hardcoded?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment