Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make public ip alias working again #945

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
13 changes: 12 additions & 1 deletion .aliases
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ alias dt="cd ~/Desktop"
alias p="cd ~/projects"
alias g="git"

alias gs="git status"
alias gd="git diff"
alias ga="git add"
alias gcm="git commit -m"
alias gp="git push"



# Detect which `ls` flavor is in use
if ls --color > /dev/null 2>&1; then # GNU `ls`
colorflag="--color"
Expand Down Expand Up @@ -56,7 +64,8 @@ alias chrome='/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome'
alias canary='/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary'

# IP addresses
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
alias ip{4,}='dig @resolver4.opendns.com myip.opendns.com +short -4' #you can use ip4 or ip to get your ipv4
alias ip6='dig @ns1.google.com TXT o-o.myaddr.l.google.com +short -6' #https://unix.stackexchange.com/a/81699
alias localip="ipconfig getifaddr en0"
alias ips="ifconfig -a | grep -o 'inet6\? \(addr:\)\?\s\?\(\(\([0-9]\+\.\)\{3\}[0-9]\+\)\|[a-fA-F0-9:]\+\)' | awk '{ sub(/inet6? (addr:)? ?/, \"\"); print }'"

Expand Down Expand Up @@ -137,6 +146,8 @@ alias pumpitup="osascript -e 'set volume output volume 100'"
# Kill all the tabs in Chrome to free up memory
# [C] explained: http://www.commandlinefu.com/commands/view/402/exclude-grep-from-your-grepped-output-of-ps-alias-included-in-description
alias chromekill="ps ux | grep '[C]hrome Helper --type=renderer' | grep -v extension-process | tr -s ' ' | cut -d ' ' -f2 | xargs kill"
# force kill all chrome tabs (previous method didnt work after BIG SUR)
alias killchrome='kill -9 $(ps aux | grep -i "Chrome\ Helper" | awk "{print $2}")'

# Lock the screen (when going AFK)
alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend"
Expand Down
4 changes: 4 additions & 0 deletions .bash_profile
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@ complete -W "NSGlobalDomain" defaults;

# Add `killall` tab completion for common apps
complete -o "nospace" -W "Contacts Calendar Dock Finder Mail Safari iTunes SystemUIServer Terminal Twitter" killall;

# https://obihann.github.io/archey-osx/
clear
archey
7 changes: 5 additions & 2 deletions .gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
[commit]

# https://help.github.com/articles/signing-commits-using-gpg/
gpgsign = true
# gpgsign = true

[diff]

Expand Down Expand Up @@ -180,4 +180,7 @@

[init]

defaultBranch = main
defaultBranch = master
[user]
name = Kunsang Norbu Tsering
email = [email protected]
60 changes: 30 additions & 30 deletions .macos
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
#sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "0x6D746873"

# Disable the sound effects on boot
sudo nvram SystemAudioVolume=" "
# sudo nvram SystemAudioVolume=" "

# Disable transparency in the menu bar and elsewhere on Yosemite
defaults write com.apple.universalaccess reduceTransparency -bool true
# defaults write com.apple.universalaccess reduceTransparency -bool true

# Set highlight color to green
defaults write NSGlobalDomain AppleHighlightColor -string "0.764700 0.976500 0.568600"

# Set sidebar icon size to medium
defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 2
# defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 2

# Always show scrollbars
defaults write NSGlobalDomain AppleShowScrollBars -string "Always"
Expand All @@ -46,7 +46,7 @@ defaults write NSGlobalDomain NSToolbarTitleViewRolloverDelay -float 0

# Disable smooth scrolling
# (Uncomment if you’re on an older Mac that messes up the animation)
#defaults write NSGlobalDomain NSScrollAnimationEnabled -bool false
defaults write NSGlobalDomain NSScrollAnimationEnabled -bool false

# Increase window resize speed for Cocoa applications
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
Expand Down Expand Up @@ -180,7 +180,7 @@ sudo systemsetup -settimezone "Europe/Brussels" > /dev/null
###############################################################################

# Enable lid wakeup
sudo pmset -a lidwake 1
# sudo pmset -a lidwake 1

# Restart automatically on power loss
sudo pmset -a autorestart 1
Expand All @@ -189,16 +189,16 @@ sudo pmset -a autorestart 1
sudo systemsetup -setrestartfreeze on

# Sleep the display after 15 minutes
sudo pmset -a displaysleep 15
# sudo pmset -a displaysleep 15

# Disable machine sleep while charging
sudo pmset -c sleep 0
# sudo pmset -c sleep 0

# Set machine sleep to 5 minutes on battery
sudo pmset -b sleep 5
# sudo pmset -b sleep 5

# Set standby delay to 24 hours (default is 1 hour)
sudo pmset -a standbydelay 86400
# sudo pmset -a standbydelay 86400

# Never go into computer sleep mode
sudo systemsetup -setcomputersleep Off > /dev/null
Expand Down Expand Up @@ -285,11 +285,11 @@ defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
# Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false

# Enable spring loading for directories
defaults write NSGlobalDomain com.apple.springing.enabled -bool true
# Disable spring loading for directories
defaults write NSGlobalDomain com.apple.springing.enabled -bool false

# Remove the spring loading delay for directories
defaults write NSGlobalDomain com.apple.springing.delay -float 0
# defaults write NSGlobalDomain com.apple.springing.delay -float 0

# Avoid creating .DS_Store files on network or USB volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
Expand Down Expand Up @@ -345,8 +345,8 @@ chflags nohidden ~/Library && xattr -d com.apple.FinderInfo ~/Library
sudo chflags nohidden /Volumes

# Remove Dropbox’s green checkmark icons in Finder
file=/Applications/Dropbox.app/Contents/Resources/emblem-dropbox-uptodate.icns
[ -e "${file}" ] && mv -f "${file}" "${file}.bak"
# file=/Applications/Dropbox.app/Contents/Resources/emblem-dropbox-uptodate.icns
# [ -e "${file}" ] && mv -f "${file}" "${file}.bak"

# Expand the following File Info panes:
# “General”, “Open with”, and “Sharing & Permissions”
Expand All @@ -363,13 +363,13 @@ defaults write com.apple.finder FXInfoPanesExpanded -dict \
defaults write com.apple.dock mouse-over-hilite-stack -bool true

# Set the icon size of Dock items to 36 pixels
defaults write com.apple.dock tilesize -int 36
# defaults write com.apple.dock tilesize -int 36

# Change minimize/maximize window effect
defaults write com.apple.dock mineffect -string "scale"

# Minimize windows into their application’s icon
defaults write com.apple.dock minimize-to-application -bool true
# defaults write com.apple.dock minimize-to-application -bool true

# Enable spring loading for all Dock items
defaults write com.apple.dock enable-spring-load-actions-on-all-items -bool true
Expand Down Expand Up @@ -748,31 +748,31 @@ defaults write com.apple.QuickTimePlayerX MGPlayMovieOnOpen -bool true
###############################################################################

# Enable the WebKit Developer Tools in the Mac App Store
defaults write com.apple.appstore WebKitDeveloperExtras -bool true
# defaults write com.apple.appstore WebKitDeveloperExtras -bool true

# Enable Debug Menu in the Mac App Store
defaults write com.apple.appstore ShowDebugMenu -bool true
# defaults write com.apple.appstore ShowDebugMenu -bool true

# Enable the automatic update check
defaults write com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true
# defaults write com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true

# Check for software updates daily, not just once per week
defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
# defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1

# Download newly available updates in background
defaults write com.apple.SoftwareUpdate AutomaticDownload -int 1
# defaults write com.apple.SoftwareUpdate AutomaticDownload -int 1

# Install System data files & security updates
defaults write com.apple.SoftwareUpdate CriticalUpdateInstall -int 1
# defaults write com.apple.SoftwareUpdate CriticalUpdateInstall -int 1

# Automatically download apps purchased on other Macs
defaults write com.apple.SoftwareUpdate ConfigDataInstall -int 1
# defaults write com.apple.SoftwareUpdate ConfigDataInstall -int 1

# Turn on app auto-update
defaults write com.apple.commerce AutoUpdate -bool true
# defaults write com.apple.commerce AutoUpdate -bool true

# Allow the App Store to reboot machine on macOS updates
defaults write com.apple.commerce AutoUpdateRestartRequired -bool true
# defaults write com.apple.commerce AutoUpdateRestartRequired -bool true

###############################################################################
# Photos #
Expand Down Expand Up @@ -844,25 +844,25 @@ defaults write com.irradiatedsoftware.SizeUp ShowPrefsOnNextStart -bool false
###############################################################################

# Install Sublime Text settings
cp -r init/Preferences.sublime-settings ~/Library/Application\ Support/Sublime\ Text*/Packages/User/Preferences.sublime-settings 2> /dev/null
# cp -r init/Preferences.sublime-settings ~/Library/Application\ Support/Sublime\ Text*/Packages/User/Preferences.sublime-settings 2> /dev/null

###############################################################################
# Spectacle.app #
###############################################################################

# Set up my preferred keyboard shortcuts
cp -r init/spectacle.json ~/Library/Application\ Support/Spectacle/Shortcuts.json 2> /dev/null
# cp -r init/spectacle.json ~/Library/Application\ Support/Spectacle/Shortcuts.json 2> /dev/null

###############################################################################
# Transmission.app #
###############################################################################

# Use `~/Documents/Torrents` to store incomplete downloads
defaults write org.m0k.transmission UseIncompleteDownloadFolder -bool true
defaults write org.m0k.transmission IncompleteDownloadFolder -string "${HOME}/Documents/Torrents"
# defaults write org.m0k.transmission UseIncompleteDownloadFolder -bool true
# defaults write org.m0k.transmission IncompleteDownloadFolder -string "${HOME}/Documents/Torrents"

# Use `~/Downloads` to store completed downloads
defaults write org.m0k.transmission DownloadLocationConstant -bool true
# defaults write org.m0k.transmission DownloadLocationConstant -bool true

# Don’t prompt for confirmation before downloading
defaults write org.m0k.transmission DownloadAsk -bool false
Expand Down
46 changes: 46 additions & 0 deletions brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,52 @@ brew install ssh-copy-id
brew install tree
brew install vbindiff
brew install zopfli
brew install archey

# Install macos casks
brew install --cask google-chrome
brew install --cask brave-browser
brew install --cask firefox
brew install --cask vivaldi
brew install --cask bettertouchtool
brew install --cask alfred
brew install --cask sublime-text
brew install --cask kitty
brew install --cask local
brew install --cask tinypng4mac
brew install --cask suspicious-package
brew install --cask svgcleaner
brew install --cask runjs
brew install --cask poedit
brew install --cask nsregextester
brew install --cask noun-project
brew install --cask keka
brew install --cask jdiskreport
brew install --cask hacker-menu
brew install --cask geekbench
brew install --cask geektool
brew install --cask docker
brew install --cask deepl
brew install --cask console
brew install --cask bigsur-cache-cleaner


brew install --cask vlc
brew install --cask xld
brew install --cask vox
brew install --cask spek
brew install --cask soulseek
brew install --cask transmission
brew install --cask musicbrainz-picard
brew install --cask moebius
brew install --cask mixed-in-key
brew install --cask losslesscut
brew install --cask fastclicker
brew install --cask cocktail
brew install --cask cncnet
brew install --cask camera-live
brew install bandcamp-dl


# Remove outdated versions from the cellar.
brew cleanup