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

Retrieve local ip independently #888

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .aliases
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ alias canary='/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Ch

# IP addresses
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
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 }'"

# Show active network interfaces
Expand Down
6 changes: 6 additions & 0 deletions .functions
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,9 @@ function o() {
function tre() {
tree -aC -I '.git|node_modules|bower_components' --dirsfirst "$@" | less -FRNX;
}

# echo the IP address for the currently active network interface
function localip() {
local activeIf=$(netstat -rn | grep default | awk '{print $NF}' | head -1)
ipconfig getifaddr ${activeIf}
}
9 changes: 8 additions & 1 deletion .gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
ca = !git add -A && git commit -av

# Switch to a branch, creating it if necessary
go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f"
go = "!f() { git checkout \"$1\" 2> /dev/null || git checkout -b \"$1\"; }; f"

# Show verbose output about tags, branches or remotes
tags = tag -l
Expand Down Expand Up @@ -59,6 +59,9 @@
# Remove branches that have already been merged with master
# a.k.a. ‘delete merged’
dm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"

# Remove stale branches that are gone on remote
dg = "!git branch -vv | grep ': gone]'| grep -v '\\*' | awk '{ print $1; }' | xargs -I F git branch -D \"F\""

# List contributors with number of commits
contributors = shortlog --summary --numbered
Expand All @@ -79,6 +82,10 @@
fi \
}; f"

# Compare two branches and show which commits are not in the first
# but in the second branch
compare = "!f() { git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative $1..$2; }; f"

[apply]

# Detect whitespace errors when applying a patch
Expand Down
6 changes: 3 additions & 3 deletions .macos
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ defaults -currentHost write NSGlobalDomain com.apple.trackpad.trackpadCornerClic
defaults -currentHost write NSGlobalDomain com.apple.trackpad.enableSecondaryClick -bool true

# Disable “natural” (Lion-style) scrolling
defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false
# defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false

# Increase sound quality for Bluetooth headphones/headsets
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40
Expand All @@ -181,8 +181,8 @@ defaults write NSGlobalDomain InitialKeyRepeat -int 10
# Set language and text formats
# Note: if you’re in the US, replace `EUR` with `USD`, `Centimeters` with
# `Inches`, `en_GB` with `en_US`, and `true` with `false`.
defaults write NSGlobalDomain AppleLanguages -array "en" "nl"
defaults write NSGlobalDomain AppleLocale -string "en_GB@currency=EUR"
defaults write NSGlobalDomain AppleLanguages -array "en"
defaults write NSGlobalDomain AppleLocale -string "en_US@currency=EUR"
defaults write NSGlobalDomain AppleMeasurementUnits -string "Centimeters"
defaults write NSGlobalDomain AppleMetricUnits -bool true

Expand Down