Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'd just do

  dscacheutil -flushcache || \
  discoveryutil mdnsflushcache || \
  killall -HUP mDNSResponder


SO MUCH TYPING


alias d='dscacheutil -flushcache || discoveryutil mdnsflushcache || killall -HUP mDNSResponder'


Just copy/paste it from the internet.

Nothing bad could possibly happen. [1]

[1]: http://thejh.net/misc/website-terminal-copy-paste


You might be interrested in an unreleased security tool I've been working on

Install with

curl http://issh.it/yadummy | sh


How is that any different than installing any opaque binary app?

It all comes downs to whether you trust the source.

At least with the "curl http://xxx | sh" method you can also examine the contents of the script before running it, and even opt to run it after downloading it and checking it locally.

With binary apps off of internet sites, which is what people install and use dozens of times a month, no such luck.


In this case, you have no idea if the connection is MITM'd because of http. You must assume the source untrustworthy, because you don't know who it is. Additionally, assuming the page's source (from which you copy this command) is over http, you must assume the website has compromised (e.g.) your clipboard on copy and you're pasting in malicious unicode characters or whatever. People should have an inherent distrust of binary blobs, too, for whatever that's worth. Same caveats over serving the download over http, with the added benefit of not being able to read the source (necessarily), with the added bonus of now having to assume the build machine has not been compromised.


>People should have an inherent distrust of binary blobs, too, for whatever that's worth.

All you said are true for binary blobs as well. The page could be MITM, etc.

"curl xxx | sh" style deployment has all the same disadvantages of binary blogs, but has the added advantage that you can download and check the code before executing it.



alias dns_flush="dscacheutil -flushcache &> /dev/null ; discoveryutil mdnsflushcache &> /dev/null ; killall -HUP mDNSResponder &> /dev/null ; true"


aliases are your friend


aliases make you week


But they help you avoid typos such as "week".




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: