sonnym | 12 years ago
sonnym's comments
sonnym | 12 years ago
https://en.wikipedia.org/wiki/Betteridge%27s_law_of_headline...
sonnym | 12 years ago
sonnym | 13 years ago
Thanks for the suggestion about -exec +; I will have to remember it in the future.
sonnym | 13 years ago
vim $(grep -lr foo | xargs)
and doing what I need to do on a file by file basis. Otherwise, for renaming functions and the like, I do a lot of:
find . -name foo_fn exec sed -i s/foo_fn/bar_fn/g '{}' \;
I generally love abusing bash. Just today I was asked about how to rename a bunch of files, specifically containing spaces, and came up with either of these two options:
find -name foo_bar -exec cp "'{}'"{,.bak} \;
and
for file in $(find -name foo_bar); do cp "$file"{,.bak}; done
Ultimately, the great thing is, if you learn CTRL-R, you can always search for these types of commands and modify them as necessary for the particular task at hand and not necessarily remember them. One I use all the time, to push git branches upstream is the following:
CTRL-R --set-
which gives me:
git push -f --set-upstream origin `git rev-parse --abbrev-ref HEAD`
This is entirely unique in my history, a common part of my workflow, and trivially searchable.
I also enjoy being able to perform something along the lines of:
vim $(bundle show foo-gem)
sonnym | 13 years ago
sonnym | 13 years ago
sonnym | 14 years ago
If you use the web client, everything is over HTTPS, and, like the gp stated, probably goes nowhere beyond the database, although merely a supposition.
sonnym | 14 years ago
mount /mnt/book && cd /mnt/book && wget ...
work just fine for me with the Sony PRS-300. I imagine things might be a bit different with a more closed system, but this has been doing the trick for a few years.
sonnym | 14 years ago
A lot of the video isn't particularly relevant, but he does discuss how the officers are trained to incite the dog to alert and how the desire for the ball is a prey drive.
sonnym | 14 years ago
sonnym | 14 years ago
This makes me question how much the project will be supported in the future - but I suppose having a large company like LinkedIn invested in the technology is a good sign.
sonnym | 14 years ago
Atwood's point is that checking the "referer" will both be unreliable and, more importantly, lead to false positives; there are better alternatives, namely, double submitting cookies as I have pointed out elsewhere with regard to this article.
sonnym | 14 years ago
curl --referer http://www.example.come http://www.example.com
sonnym | 14 years ago
Since the browser automatically submits the cookie via HTTP Headers, single submission by itself is not safe. Since a third party cannot read the value of the cookie, they cannot recreate the proper request and will, consequently, fail.
Of course, both our methods will fail under an XSS, but should still prevent CSRF. I still think a cryptographically generated secret stored in the cookie is less guessable than a timestamp.
sonnym | 14 years ago
The HTTP referrer, or HTTP "referer" as it is now permanently misspelled, should always come from your own domain. You could reject any form posts from alien referrers. However, this is risky, as some corporate proxies strip the referrer from all HTTP requests as an anonymization feature. You would end up potentially blocking legitimate users. Furthermore, spoofing the referrer value is extremely easy. All in all, a waste of time. Don't even bother with referrer checks.
sonnym | 14 years ago
Although this makes sense, I feel it is not as safe as double submitting cookies, which effectively creates pseudo-random requests, but should still be safe enough in practice.