Email from client:
Client: Please can you print the attached Poster
Second email from client.
Client: lol It would help if I attached it!
Third time’s the charm? I’ve done this, except I was the designer sending the client proofs. Heh.
I’m really glad I post things to Tumblr. Because believe it or not, not only is it a fun place to see what I found that amuses me, but also a repository of information/art that I’ve done. Just now, I forgot what the exact Linux command was that I had used yesterday. And just copy pasting the same exact command to do the same exact job, yep.
Did your new one land you a job?
So we have a project that required us to find each instance of the word “cookie”. The ColdFusion app we were working with wasn’t setting cookies to HttpOnly which left it open to an XSS attack. We couldn’t find out how to set them without first destroying them, because we’re not CF developers. So in hopes of getting a clue, we searched the CF application for the word cookie in hopes to isolate where it was being created and modify the settings.
In order to do this, I definitely needed to use a grep. But the boss only wanted the list of files that had the word “cfquery” and not the line data. So I needed to be a bit more creative. Pipe, to be exact. Extracting the file names from the line data went to sed. Then, since I had duplicates of each file, I needed a way to filter out duplicates which is where sort comes in handy.
The full command?
grep -ir cfquery * | sed "s/^\(.*\):.*$/\1/" | sort -u
- - -
You know… when I write these Linux/Bash snippets, I always put them into context. But I sometimes wonder if readers prefer seeing where the command comes from(context) or just see the build up(result)?
What do you think is better?