├── package.json ├── noreallyjustfuckingstopalready.plugin.zsh ├── flu.sh └── README.md /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "noreallyjustfuckingstopalready", 3 | "repo": "eventi/noreallyjustfuckingstopalready", 4 | "version": "0.0.1", 5 | "description": "Please OS X just fucking reset your DNS cache please", 6 | "global": "1", 7 | "install": "install -b flu.sh ${PREFIX:-/usr/local}/bin/flu.sh", 8 | "scripts": ["flu.sh"] 9 | } 10 | -------------------------------------------------------------------------------- /noreallyjustfuckingstopalready.plugin.zsh: -------------------------------------------------------------------------------- 1 | # Do plugin setup to make this easily loadable by oh-my-zsh, zgen and other 2 | # oh-my-zsh-compatible frameworks 3 | 4 | if [[ "$(uname -s)" = "Darwin" ]]; then 5 | # Add the plugin's diretory to user's path 6 | PLUGIN_HOME="$(dirname $0)" 7 | export PATH=${PATH}:${PLUGIN_HOME} 8 | alias flush-osx-cache=flu.sh 9 | fi 10 | -------------------------------------------------------------------------------- /flu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # HT https://support.apple.com/en-us/HT202516 3 | LONGVERSION=$(sw_vers -productVersion) 4 | #Why do people grep | awk ? awk has pattern matching; please stop! 5 | MINOR=$(echo $LONGVERSION | cut -d. -f2) 6 | UPDATE=$(echo $LONGVERSION | cut -d. -f3) 7 | 8 | if (( $MINOR < 7 )) ; then 9 | FLUSH="dscacheutil -flushcache" 10 | elif (( $MINOR < 10 )) ; then 11 | FLUSH="killall -HUP mDNSResponder" 12 | elif (( $MINOR == 10 )) ; then 13 | if (( $UPDATE < 4 )) ; then 14 | FLUSH="discoveryutil mdnsflushcache" 15 | else 16 | FLUSH="killall -HUP mDNSResponder" 17 | fi 18 | else 19 | echo VERSION $LONGVERSION 20 | FLUSH="killall -HUP mDNSResponder" 21 | echo "¯\_(ツ)_/¯" 22 | fi 23 | 24 | echo "Flushing DNS Cache for $LONGVERSION" 25 | echo "$FLUSH #(งツ)ว" 26 | $FLUSH 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Please OS X (or whatever your name is) just fucking reset your DNS cache please 2 | 3 | Installation: 4 | ===== 5 | From source: 6 | ----- 7 | git clone https://github.com/eventi/noreallyjustfuckingstopalready.git 8 | cd noreallyjustfuckingstopalready 9 | install -b flu.sh ${PREFIX:-/usr/local}/bin/flu.sh 10 | sudo flu.sh 11 | 12 | With https://github.com/bpkg/bpkg do: 13 | 14 | `bpkg install -g eventi/noreallyjustfuckingstopalready` 15 | 16 | Antigen 17 | ----- 18 | Add `antigen bundle eventi/noreallyjustfuckingstopalready` to your `.zshrc` with your other bundle commands. 19 | 20 | Antigen will handle cloning the plugin for you automatically the next time you start zsh. You can also add the plugin to a running zsh with `antigen bundle eventi/noreallyjustfuckingstopalready` for testing before adding it to your `.zshrc`. 21 | 22 | Oh-My-Zsh 23 | ----- 24 | cd ~/.oh-my-zsh/custom/plugins 25 | git clone git@github.com:eventi/noreallyjustfuckingstopalready.git 26 | 27 | Then add the repo to your plugin list 28 | 29 | Zgen 30 | ----- 31 | Add `zgen load eventi/noreallyjustfuckingstopalready` to your .zshrc file in the same function you're doing your other `zgen load` calls in. zgen will take care of cloning the repository and adding it to your `$PATH`. 32 | 33 | F.A.Q 34 | ===== 35 | **Q) What? Why?** 36 | 37 | A) "What if ping was different on every build of linux. Shit gets old." 38 | (HT post_break https://news.ycombinator.com/item?id=11902850) 39 | 40 | **Q) "... The `dscacheutil -flushcache` command he lists for Snow Leopard still works for me (OS X Yosemite here)."** 41 | 42 | A) The command didn't fail, but it didn't clear the cache either: (HT masklinn https://news.ycombinator.com/item?id=11902754) 43 | 44 | 45 | Contributors: 46 | 47 | * https://github.com/justindowning 48 | * https://github.com/jwerle 49 | * https://github.com/unixorn 50 | * https://github.com/kenahoo 51 | --------------------------------------------------------------------------------