Blog 1

Random Talk on Random Thoughts

Resolving Jekyll's YAML Exception

| Comments |

Problem

  1. Created a new Octopress post with rake in Windows 7’s Git Bash.
  2. Wrote the post using gVim.
  3. Ran rake generate, and got an YAML exception:

    YAML Exception reading [filename].markdown: invalid byte sequence in UTF-8

Omit Forward Slashes on WWW

| Comments |

This Sunday, I saw a piece of news which was written in 2009, but I think that many Internet users don’t know about its main idea.

...the address could have worked perfectly well without the two extra
unnecessary keystrokes.

Although it is a piece of old news, it is quite exciting to me. It is likely that some netizens who usually use a modern browser, which automatically fills up the type of protocol used on the left-hand side of the three ‘w’s in the input URL1, find this information useless. However, I sometimes need to specify the communication protocol in the URL (say, changing HTTP to HTTPS) for browsing some web contents.


Notifying Search Engines of New Sitemaps

| Comments |

After viewing Sam Kuo’s article on eavatar.com, I changed my Rakefile according to the instructions there. However, I was unsure where the source code should be added. Thus, I read Larry Nung’s working example, and knew that it should immediately follow line 29 of the file. However, I updated Octopress’s source code recently.1 Therefore, the file looked different from Nung’s one—in my own version of the file, I saw the following lines of code which caused me to think twice before really modifying the file. (Click “Commit history” to see the highlighted section of code.)

Part of my `Rakefile` at commit 27d0510Commit history
1
2
3
4
if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
  puts '## Set the codepage to 65001 for Windows machines'
  `chcp 65001`
end

Finally, I decided to add the code for ping services behind the above section of code.


  1. Commit 27d0510 

WebView Vulnerability in Facebook Android SDK: Embedded OAuth

| Comments |

That said, I hacked around to see if injecting Javascript on the WebView was possible and it was, with a bit of change I could actually get the user name and password of the victim by making him/her uninstall Facebook on their phone and use FB login in my app.

Mohit Kanwal

Tonight, I had read an article on the security risk of using Facebook on Android. I am shocked at Kanwal’s discovery about WebView.

I will avoid using Facebook on Android.

Internet Explorer a Security Risk: Use Firefox or Chrome

| Comments |

I’ve just read a piece of news about M$’s Internet Explorer on examiner.com. The U.S. authorities has advised Internet users to avoid using IE. As can be seen in the news, the security problem had not yet been fixed. Even though some experts have it fixed, I won’t use IE anymore on my desktop, which runs on GNU/Linux.


Liquid Exceptions During Generation of My Blog on Windows 7

| Comments |

Background

The crash of my computer in the last weekend motivated me to think about using Octopress on Windows 7. It is an irony that the computer had been fixed before I could finally build the site with rake generate and start writing posts for this blog on Windows 7.

Problems

Provided that a blogger have some experience in using computers, the setup should be easy for his/her who wish to start a new Octopress blog on Windows and post simple contents like text, pictures, videos, etc.

However, I would post something more complicated, such as code blocks with syntax highlighting. Having spent time experimenting with code and commands, I don’t want to forget them and it’s better to write them down. I prefer a blog over a paper notebook.

Before writing anything new, I tested if I could locally build the site from the source branch cloned from the remote repository on GitHub on this Sunday, and the first Liquid exception occurred. I remembered rake said something like this.1

C:\github\vincenttam.github.io>rake generate
## Generating Site with Jekyll
unchanged sass/print.scss
identical source/stylesheets/screen.css 
Configuration from C:/github/vincenttam.github.io/_config.yml
Building site: source -> public
Liquid Exception: Pygments can't parse unknown language: tex. in 2014-03-16-latex-template-for-essays.markdown
C:/github/vincenttam.github.io/plugins/pygments_code.rb:27:in `rescue in pygments'
C:/github/vincenttam.github.io/plugins/pygments_code.rb:24:in `pygments'
C:/github/vincenttam.github.io/plugins/pygments_code.rb:14:in `highlight'
C:/github/vincenttam.github.io/plugins/code_block.rb:82:in `render'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:94:in `block in render_all'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:92:in `collect'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:92:in `render_all'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:82:in `render'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/template.rb:124:in `render'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/template.rb:132:in `render!'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/convertible.rb:79:in `do_layout'
C:/github/vincenttam.github.io/plugins/post_filters.rb:167:in `do_layout'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.12.1/lib/jekyll/post.rb:195:in `render'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.12.1/lib/jekyll/site.rb:200:in `block in render'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.12.1/lib/jekyll/site.rb:199:in `each'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.12.1/lib/jekyll/site.rb:199:in `render'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.12.1/lib/jekyll/site.rb:41:in `process'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.12.1/bin/jekyll:264:in `<top (required)>'
C:/Ruby193/lib/ruby/gems/1.9.1/bin/jekyll:23:in `load'
C:/Ruby193/lib/ruby/gems/1.9.1/bin/jekyll:23:in `<main>'
Build Failed

Advantages of Blogs Over Paper Notebooks

| Comments |

  1. Blogs
    • Accessible anywhere anytime, as long as an Internet connection is available.
    • Multiple concurrent users: it can be viewed by multiple readers at the same time.
    • Perfectly reproduced: contents of the blog can be copied into the computer.
    • Searching: readers can find information useful for them quickly.
    • Characters can usually be neatly displayed, despite the author’s poor handwriting.
  2. Paper notebooks
    • Subject to aging: oxidized pages will become yellow; ink will fade out.
    • Easily damaged: pages are easily torn if the owner doesn’t take care of the notebook.
    • Difficult for sharing: unless you take a photo of it and share it on the Internet, others can’t view the notebook while you’re using it.
    • Inconvenient and inefficient to locate information: readers need to turn over the pages and skim through them to find the useful parts.

Privacy of the shared contents

Once something is uploaded to the Internet, it is likely that the uploaded contents can never be deleted because

  • it’s not always possible to delete the uploaded resources in the server; and
  • there’s no absoulutely legitamate way to delete the backups of the uploaded resources at other locations where you have no access rights, for example, others’ computers.

In short, there’s no absoulute privacy for contents uploaded to the Internet. They’re expected to (be exposed to the) public.1

Usages of blogs

They can be used to write something that

  • you want to share; and
  • you don’t mind to share—it won’t be part of your private information.

Knowledge and universal facts are typical examples of impersonal information.


My Desktop Crashed!

| Comments |

Beginning

Last Saturday night, I used my Ubuntu Desktop to watch some videos. While it was playing, the recently upgraded Firefox suddenly hanged. The screen was freezed, and the sound continued to play. To avoid disturbing my neighbour, I muted the monitor speakers. I initially guessed that the newly upgraded Firefox didn’t work well with Linux kernel 3.2.0-61, which was released on May 2 2014. I forced the machine to halt by pressing the power button for a while. Then I switched on the computer again, and chose “Memtest86+” in the GRUB menu. Within several minutes, the words in the blue screen blurred due to some blinking dots.