Skip to content

Instantly share code, notes, and snippets.

@ehsanpo

ehsanpo/Daily.sh Secret

Last active August 16, 2024 12:12
Show Gist options
  • Select an option

  • Save ehsanpo/1c205438c1e67b7c8e12a35e996e50f3 to your computer and use it in GitHub Desktop.

Select an option

Save ehsanpo/1c205438c1e67b7c8e12a35e996e50f3 to your computer and use it in GitHub Desktop.
#!/bin/bash
NAME="$(id -F)"
HI="Good Morning, $NAME"
Weather=$(curl -s http://wttr.in/malmo?T | grep -m 1 -Eo -e '-?[[:digit:]].*°.+')
echo "Warming up"
brew update
brew outdated
brew upgrade
brew upgrade --cask
brew cleanup -s
#now diagnotic
brew doctor
brew missing
# gem update --system
# Clean logs
# Get the current day of the week (1 = Monday, 7 = Sunday)
DAY_OF_WEEK=$(date +%u)
# Get the current day of the month
DAY_OF_MONTH=$(date +%d)
# Check if it's the first Monday of the month
if [ "$DAY_OF_WEEK" -eq 1 ] && [ "$DAY_OF_MONTH" -le 7 ]; then
rm ~/bin/brew_update_logs.txt
fi
# npx browserslist@latest --update-db
# change mac
NEWMAC= openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'
sudo ifconfig en0 ether $NEWMAC
say "$HI"
say "Weather today is $Weather"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment