Skip to content

Instantly share code, notes, and snippets.

@wadewegner
Last active June 20, 2018 14:38
Show Gist options
  • Select an option

  • Save wadewegner/57b366eac6a9d28adf409ec8d068e378 to your computer and use it in GitHub Desktop.

Select an option

Save wadewegner/57b366eac6a9d28adf409ec8d068e378 to your computer and use it in GitHub Desktop.

Revisions

  1. wadewegner revised this gist Jun 20, 2018. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,8 @@
    # Usage: na
    # Expected output: en0
    alias na="ifconfig | pcregrep -M -o '^[^\t:]+:([^\n]|\n\t)*status: active' | egrep -o -m 1 '^[^\t:]+'"

    # Usage: nr en0
    nr() {
    sudo ifconfig $1 down;sleep 10;sudo ifconfig $1 up
    }
  2. wadewegner created this gist Jun 20, 2018.
    5 changes: 5 additions & 0 deletions .zshrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    alias na="ifconfig | pcregrep -M -o '^[^\t:]+:([^\n]|\n\t)*status: active' | egrep -o -m 1 '^[^\t:]+'"

    nr() {
    sudo ifconfig $1 down;sleep 10;sudo ifconfig $1 up
    }