Pages

Thursday, January 28, 2010

Ourselves

When you try to show others you're [.good.kind.smart.evil.cool.], in fact you're demonstrating to yourself because you don't beleve it.

Sunday, January 10, 2010

Make things happen

Getting things done is not the same as making things happen. You can:
  • …reply to emails
  • …pay the bills 
  • …cross off to-do’s
  • …fulfill your obligation 
  • …repeat what you heard 
  • …go with the flow 
  • …anticipate roadblocks 
  • …aim for “good enough”
 Or you can:
  •  …organize a community 
  • …take a risk 
  • …set ambitious goals 
  • …give more than you take
  •  …change perceptions 
  • …forge a new path 
  • …create possibility
  •  …demand excellence 
 "Don’t worry too much about getting things done.Make things happen! "

Friday, January 8, 2010

Another brick in the (corporate) wall

When trying to open GMail, Google Reader or other Google sites that require authentication, I got the following error:


              Error 107 (net::ERR_SSL_PROTOCOL_ERROR): Unknown error.


I am behind a proxy, that authenticates itself with certificate to GMail. So the traffic goes encrypted to the proxy and only then the proxy encrypts it with the certificate from Google. Anyway, to pass this I added  the --use-system-ssl option for the Chrome shortcut, in the Target field, like: 


"C:\Documents and Settings\\Local Settings\Application Data\Google\Chrome\Application\chrome.exe" --use-system-ssl


I found too little information on the issue and also on what this parameter does, so any information is welcomed. 


Some links:
Chromium Issue 30689,  and one from Chrome support forum.

Thursday, January 7, 2010

Stylesheets in Firefox and Chrome

  1. Background

              A basic security idea for browser's security is the same-origin policy (discussion here) which protects web sites from one another. For example, the same-origin policy stops a news site from reading the contents of your Gmail inbox or use Javascript to access information from other frames in the same window. 
    Different browsers have different security approaches:

    Google Chrome :
    • prevents users from clicking Internet-based hyperlinks to local web pages 
    • blocks local web pages from reading the contents of arbitrary web sites
    Firefox:
    • blocks local web pages from reading Internet pages
    • restricts a local web page to reading only files in the same directory, or a subdirectory
  2. Problem: 
              If you have an .xml file that references an .xls,  (both files are locale),  when I open it in Firefox the stylesheet is not applied. The contents appear unformatted.  If I open it with Chrome a blank page appears,  and I get an error on the Developer Console:
    Unsafe attempt to load URL file:///C:/test.xsl from frame with URL file:///test.xml. Domains, protocols and ports must match.

  3. Workaround:

    • Firefox: This site explains how to enable local documents to have access to all other local documents, including directory listings. And security implications, recommended settings, etc.
    • From a discussion on issue 39616, a workaround for Chrome is to start it with following 2 flags:  --enable-file-cookies --disable-web-security. 

  4. References:

Regular expressions patterns with grep

I know there is a lot of documentation on the topic of regular expression (like the Regexp bible, Mastering Regular Expressions, by Jeffrey Friedl ) so just some short examples I have used:
  1. ls -l |egrep '.*\.[ch]p{0,2}$'
    Matches  strings with a character repeated any number of times (0+), followed by the '.' character which is escaped(to not be interpreted as the '.' which represents any character), then 'c' or 'h' followed by  0, 1, or 2 'p's. '$' means 'end of line' (the caret ('^') could be used similarly to mark the begging of line).
    But this would also match files like  "main.cp" which is not what I want so:
  2. ls -l |egrep '.*\.(c|cpp|h|hpp)$'
    Matches just specific extensions (enclosed in "(...)").
  3. ls -l |egrep -v '.*\.[ch]p{0,2}$'
    The '-v' parameter excludes the lines matching this pattern
  4. ls -l |egrep -w "file123"
    Matches word "file123", but not "file1234" or "file12345". Full description from man grep :
    -w, --word-regexp
        Select  only  those  lines  containing  matches  that form whole words.  The test is that the matching substring must  either  be at  the  beginning  of  the line, or preceded by a non-word constituent character.  Similarly, it must be either at the end  of the line or followed by a non-word constituent character.  Word-constituent characters are letters, digits, and the  underscor
    e
  5. grep -A n -B m 'pattern'
    Shows the lines matching the pattern, and also n lines after, and m lines before the match.
Good references:
Enjoy! :)