Search

11/17/2011

guard/guard - GitHub

guard/guard - GitHub

Guard is a command line tool to easily handle events on file system modifications (FSEvent / Inotify / Polling support).


tag: git hub watch guard

11/11/2011

s3fs

如果 brew install s3fs 不會過的話,
手動安裝fuse4x 之後再執行 brew intsall s3fs.

11/10/2011

HTTP cookie - Wikipedia, the free encyclopedia

HTTP cookie - Wikipedia, the free encyclopedia

Setting a cookie
Transfer of Web pages follows the HyperText Transfer Protocol (HTTP). Regardless of cookies, browsers request a page from web servers by sending them a usually short text called HTTP request. For example, to access the page http://www.example.org/index.html, browsers connect to the server www.example.org sending it a request that looks like the following one:


GET /index.html HTTP/1.1
Host: www.example.org

browser
-------→
server

The server replies by sending the requested page preceded by a similar packet of text, called 'HTTP response'. This packet may contain lines requesting the browser to store cookies:

HTTP/1.1 200 OK
Content-type: text/html
Set-Cookie: name=value
Set-Cookie: name2=value2; Expires=Wed, 09 Jun 2021 10:18:14 GMT
 
(content of page)

browser
←-------
server


(content of page)
browser
←-------
server
The server sends lines of Set-Cookie only if the server wishes the browser to store cookies. Set-Cookie is a directive for the browser to store the cookie and send it back in future requests to the server (subject to expiration time or other cookie attributes), if the browser supports cookies and cookies are enabled. For example, the browser requests the page http://www.example.org/spec.html by sending the server www.example.org a request like the following:
GET /spec.html HTTP/1.1
Host: www.example.org
Cookie: name=value; name2=value2
Accept: */*

browser
-------→
server
This is a request for another page from the same server, and differs from the first one above because it contains the string that the server has previously sent to the browser. This way, the server knows that this request is related to the previous one. The server answers by sending the requested page, possibly adding other cookies as well.
The value of a cookie can be modified by the server by sending a new Set-Cookie: name=newvalue line in response of a page request. The browser then replaces the old value with the new one.
The term "cookie crumb" is sometimes used to refer to the name-value pair.[23] This is not the same as breadcrumb web navigation, which is the technique of showing in each page the list of pages the user has previously visited; this technique, however, may be implemented using cookies.
Cookies can also be set by JavaScript or similar scripts running within the browser. In JavaScript, the object document.cookie is used for this purpose. For example, the instruction document.cookie = "temperature=20" creates a cookie of name temperature and value 20.[24]
[edit]

HttpOnly cookie

設定cookie時可以指定為 HttpOnly Cookie, 這個 cookie 無法被 javascript 讀出來 (ex: document.cookie)

The Will Will Web | 設定 Cookie 時可善用 HttpOnly 特性減低網站安全風險(XSS)

Cookie hijacking 是個很常見的 XSS 攻擊手法,大多是利用網站既有的 XSS 漏洞並透過 JavaScript 取得 documnet.cookie 資料,而 documnet.cookie 就包含所有你在該網頁所有可用的 Cookie 資料,但若你的網站程式在設定 Cookie 的時候有特別加上 HttpOnly 屬性,就可以進一步避免該頁的 Cookie 被 JavaScript 存取,也可保護使用者的 Cookie 不會偷走。


[Security] HTTP-only cookies
Vidar wrote an interesting article pointing me to HTTPOnly-cookies. Microsoft created this extension to the cookie standard, to allow servers to issue cookies with a special HttpOnly-flag. This flag makes the cookie inaccessible to javascript in supported browsers (currently only newer versions of IE supports this feature fully).

The set-cookie header looks like this:
Set-Cookie: USER=123; expires=Wednesday, 09-Nov-99 23:12:40 GMT; HttpOnly


HttpOnly - OWASP

HTML5 Canvas的Origin-Clean安全原則 - 黑暗執行緒

HTML5 Canvas的Origin-Clean安全原則 - 黑暗執行緒

前幾天介紹了如何利用toDataURL()將canvas繪製結果轉為圖檔的做法,但實際應用時,卻發現常常會冒出奇怪的錯誤:

在IE, Chrome或Safari上出現: SECURITY_ERR: DOM Exception 18
在FireFox則是冒出: 0x805303e8 (NS_ERROR_DOM_SECURITY_ERR)
原來,跟Cross-Site Scripting的限制一樣,HTML canvas也有其安全原則! 簡單來說,可想成每個canvas有個origin-clean旗標,一開始預設為true,一旦有下列任一情況發生時,origin-clean旗標即被設為false:

drawImage()時,使用與document不同來源(origin,跟瀏覽器跨網域議題裡網域的概念差不多)的image或video作為材料
drawImage()時,使用orgin-clean=false的canvas作為材料
fillStyle使用其他來源的image或video作為pattern
fillStyle使用其他orgin-clean=false的canvas建立的pattern
strokeStyle使用其他來源的image或video作為pattern
strokeStyle使用其他orgin-clean=false的canvas建立的pattern
fillText()或strokeText()使用其他來源的字型
一旦canvas的orgin-clean旗標被設為false,此時若呼叫toDataURL()、getDataImage()或measureText()等方法,都會引發安全性錯誤[DOMException.SECURITY_ERR (18)]! 最簡單的例子,就是網站A網頁上的canvas,在drawImage時,引用了放在網站B的某個圖檔當作 src,則該canvas就無法再執行toDataURL()了!

新店步道

(美美美) 直潭山登山步道導覽圖
銀河洞越嶺步道 @ 我的赤腳旅行‧My Barefoot Travel :: 隨意窩 Xuite日誌
[台北新店].行啟紀念碑.屈尺道碣.礦工寮.和美山新步道.灣潭 (Tony的自然人文旅記第0807篇)
[新北市新店] .碧潭.和美山步道 (Tony的自然人文旅記第0832篇)

邪典電影 - 维基百科,自由的百科全书

邪典電影 - 维基百科,自由的百科全书

邪典電影(Cult Film)是指那些在小圈子內被支持者喜愛及推崇的電影,也可稱為非主流電影或另類電影。這種電影通常難以獲得小圈子外的大規模票房成功。它不是一種嚴格的電影類型,也不是一種電影風格。因為所處的地區不同,Cult Film的定義非常難下定論,例如香港的武俠片以及日本的特攝片尤其是怪獸系列,被歐美視為Cult Film,在當地則列入主流電影,廣範且成功得到商業利益。


Top Ten Cult Films, Then And Now - Santa Cruz News
1. THE BIG LEBOWSKI (1998) The movie that saved cult movies. Coming off hits Raising Arizona and Fargo, no one expected anything less than a slam dunk at the box office from the Coen brothers when Lebowski was released. But writer/directors the Coens had layered the movie so densely—packing it with circular dialogue, out-there characters and enough quotable lines for 10 movies—that audiences simply couldn’t digest it in one sitting in theaters.

The Big Lebowski disappeared quickly, and it wasn’t until movie geeks started watching the movie over and over that its sheer magnificence shone through. The Big Lebowski had such an effect on fans that in the early 2000s they started dressing in robes like The Dude and going to midnight screenings (full disclosure: I was one of them). Viewings were accompanied by White Russians and sometimes bowling (never on Shabbas).

Eventually, four duderinos started the now-legendary Lebowski Fests, wrote a book about it called I’m a Lebowski, You’re a Lebowski where they extensively quoted the movie’s cultists (full disclosure: I was one of them), and finally brought the original cast back together in New York for a reunion this month.

2. DONNIE DARKO (2001) The fact that this film flopped can’t be blamed entirely on the fact that it was released right after 9/11, or even that final cut was taken away from director Richard Kelly, resulting in a theatrical version that didn’t make sense. Even after the director’s cut restored the film’s logic with extensive backstory, people realized that this movie was just un-freakin’-believably weird.

But Donnie Darko’s creepy vision of a teenager either losing his mind or trapped in a time-travel nightmare hooked fans on home video. (Kelly is adamant that the sci-fi stuff in the film should be taken as real, and the director’s cut makes this way more obvious, but after many viewings of both I actually prefer the greater ambiguity of the theatrical version.) Jake Gyllenhaal’s performance as the title character is perfectly twisted, and Kelly’s use of the soundtrack is genius. The film’s current level of cult fame was best summed up in Campbell electro group the Limousines’ song “Very Busy People”: “That Donnie Darko DVD has been repeating for a week, and we know every single word.”

3. ANCHORMAN (2004) Loved by many, loathed by some, this first collaboration from producer Judd Apatow, director Adam McKay and star Will Ferrell eventually paved the way for their megahit Talladega Nights. But at the time, the mainstream found Anchorman puzzling, and audiences never gave it a chance.

It had that stupid Ron Jeremy–parodying subtitle “The Legend of Ron Burgundy,” and was filled with highly improvised, absurd and even nonsensical humor, not to mention an unrecognizable Paul Rudd (I still forget it’s him). What’s more, it is the kind of movie that makes you laugh maybe three or four times on first viewing, a little more often the second time through, and so on until it can have fans rolling in sheer anticipation of lines and news-anchor gang fights to come. Steve Carell recently named über-dolt Brick Tamland as his favorite character he’s ever played. He also loves lamp.

4. FIGHT CLUB (1999) In his great tell-all What Just Happened? , producer Art Linson remembers that Fox executives completely freaked out when they first saw the movie they had paid David Fincher to make out of Chuck Palahniuk’s book. The way he tells it, they were downright scared of the film and its Molotov cocktail of anti-consumerism, violence, anarchy and man boobs, and made it their mission to sabotage the success of their own movie.

But it quickly found an audience on DVD, with a whole generation of disaffected suburban white kids turning “I am Jack’s (fill in the blank)” into their own punk manifesto. Most fascinating to me is Fincher’s obsession with putting bizarre suicide attempts at the end of his films (he also did it in Se7en and The Game). His recurring message seems to be: In order to be free in the modern world, you have to be willing to give up everything, including your life. In any case, the finale, set to the Pixies’ “Where Is My Mind?,” is one of the most subversive and lyrical of any film ever.


5. AUDITION (1999) Japanese director Takashi Miike is a cult-movie machine. Ichi the Killer, Visitor Q and Gozu all have their followings, but Audition is the film that made movie geeks sit up and take notice. Ironically, it’s also his most simple and straightforward film.

The first hour is deceptively mundane, telling the story of a Japanese widower who is convinced to audition girls to be his new wife (using a nonexistent film role as cover). He picks the one who seems to be the sweetest and most submissive of all, Asami.

Of course, this is all a set-up for one of the nastiest third acts in the history of horror, and the film quickly became a favorite of both gorehounds and art-movie types with a strong stomach. Everybody else walked out (I first saw it at a mall in L.A. where most of the small audience really did). The last decade has seen a return to extreme filmmaking—from junk like August Underground to the incredible French film Inside—but nothing has had the power of Miike’s movie.


6. THE ROOM (2003) A brief history of The Room: Rejected by the studios, director Tommy Wiseau spends $6 million financing his own film, of which he is also the star. Critics barely even have time to rip it to shreds before it disappears from theaters.

Then, like so many cult films before it, it gets booked as a midnight movie. For six years, it plays once a month in L.A., and word of mouth spreads about this latest contender in the “worst film of all time” sweepstakes, a barely comprehensible melodrama driven not so much by its love-triangle plot as by non sequiturs and unintentionally hilarious dialogue.
Wiseau suddenly claims the unintentional humor was intentional. No one believes him. The movie goes on the road to sold-out screenings, beginning in New York. The two most famous WTF scenes—a rooftop conversation (“I did not hit her, I did not … Oh, hi Mark!”) and a scene where the guys throw around a football in tuxedos, go viral on YouTube, drawing even more barely suspecting victims to its midnight screenings.

Fans begin throwing plastic spoons at the screen (a reference to a framed picture of a spoon that Wiseau fixates on for no reason), inviting comparisons to the rabid cult of Rocky Horror Picture Show 30 years earlier. Wiseau’s performance alone—he comes across like a malfunctioning Christopher Walken android with a heavy, impossible to place accent—guarantees this will be a cult favorite for years to come.

7. MULHOLLAND DRIVE (2001) Throughout his career, David Lynch has basically made one cult film after another, his dream-state logic and hallucinogenic imagery never fully connecting with mainstream audiences. Whether it’s Eraserhead, Blue Velvet, TV’s Twin Peaks or Wild at Heart, his films were pretty much surefire cult stuff until the ’90s, when the Twin Peaks movie, some failed TV shows and Lost Highway turned even movie geeks off.

His comeback was this film, originally filmed as a TV movie, then reworked extensively to be a feature film after ABC execs rejected it. (Its history can be traced even further back, as Lynch has said it was born out of his ideas for a third season of Twin Peaks that never came about.) In retrospect, it’s easy to see that Lost Highway was basically a failed dry run for Mulholland Drive—it uses identical plot devices like characters with two different identities and nonlinear structures.

But with Mulholland Drive, possibly his best film, Lynch was able to prop up his mysterious storyline with an actual narrative solution, which was so subtly embedded in the film that most viewers didn’t catch it until the second or third viewings (anyone who never figured it out or wrote the movie off as nonsensical should google Lynch’s own 10 clues).

Of course, it’s not all about the destination—the journey through the world of Mulholland Drive is one of the most fascinating Lynch has ever devised, with Naomi Watts’ intense performance grounding the surreal surroundings.


8. WET HOT AMERICAN SUMMER (2001) The people behind this movie claim it’s based on their actual experiences. If that’s even remotely true, summer camp may quickly replace drugs and gangs as the number-one threat to the youth of America.

In reality, this movie is an absurdist twist on the early-’80s films that tried to cash in on the success of Animal House by setting their teen hi-jinx at camp. (Yes, Meatballs, but also the much lesser-known Gorp, which like this movie is set at a Jewish summer camp).

Wet Hot American Summer throws in black comedy, Monty Python–type scenes like the most awesomely funny motorcycle chase ever, and insane plot threads like a talking can of vegetables and the threat of Skylab falling on Camp Firewood. Most critics and audiences didn’t get it, and despite a cast featuring Janeane Garofalo, David Hyde Pierce, Paul Rudd, Elizabeth Banks and Amy Poehler (not to mention the screen debut of The Hangover’s Bradley Cooper), it flopped big time. But it found a cult following on video and within a few years was making the midnight movie rounds.

9. HAROLD & KUMAR GO TO WHITE CASTLE (2004) The little stoner movie that could. Written off by the uninitiated as braindead on arrival, those who actually gave this movie a chance were surprised to discover it’s actually a pretty sharp piece of social satire. Stars John Cho and Kal Penn deserve a lot of the credit for playing Harold and Kumar with charm and a certain innocence.

The other smart thing about Harold & Kumar Go to White Castle is that unlike bad stoner movies like Pineapple Express, it doesn’t overcomplicate things with unnecessary plot. This movie is, on a story level at least, about nothing but Harold and Kumar trying to find a White Castle. What they encounter along the way, like Neil Patrick Harris in the cameo that made him cool, is what makes the movie.

The cult for this got so big that there was a 2008 sequel, Harold & Kumar Escape From Guatanamo Bay, with a slightly bigger budget and a slightly bigger take at the box office. It satisfied cultists, leading to the upcoming A Very Harold & Kumar Christmas.

10. BLACK DYNAMITE (2009) The blaxploitation genre was deserted by the masses long ago; even Quentin Tarantino couldn’t do much for it with his tribute, Jackie Brown. Along comes musclebound actor Michael Jai White (best known for bits parts in Universal Soldier and The Dark Knight, and for starring in Spawn), who had an idea in 2006 for the ultimate blaxploitation badass, making a $500 trailer and co-writing a script with director Scott Sanders and co-star Byron Minns.

The humor is so deadpan and the attention to detail so perfect that it’s almost too easy to call Black Dynamite a spoof or even an homage—it’s more like an honest-to-god blaxploitation film with every element pushed to the point of absurdity. White’s portrayal of the Vietnam vet/ex-CIA title character is almost freakishly spot on, and the movie follows in the footsteps of Rudy Ray Moore’s Dolemite with its vision of an oversexed, superbad African American alpha male on a rampage.

The lines are endlessly quotable (“Why, Black Dynamite? Why?”), and even the little soul songs that describe the plot throughout the film are note-perfect. The movie was finally released in 2009, but only played in theaters for two weeks; it found a following at midnight screenings and on DVD. You can bet Tarantino has two copies.



TOP TEN CLASSIC CULT FILMS

1. BLADE RUNNER (1982) In three decades, the reputation of Ridley Scott’s best film has swung slowly from “unlovable big-budget sci-fi flop” to “the pinnacle of cinematic achievement.” No kidding, this is now the movie that every geek on the Internet seems to use to prove they have good taste in movies—the ultimate insult in a movie-related flame war goes something along the lines of “Well, I watch movies like Blade Runner and The Big Lebowski, you probably like Twilight.”

That’s a far cry from what people were saying in 1982, when it failed to be the blockbuster hit that everyone expected from the director of Alien and a leading man who had just played Han Solo and Indiana Jones. But critics and audiences found Scott’s vision of epic future-fail too dark, and Harrison Ford too cold and distant as android hunter Rick Deckard.
On home video though, there was time to watch every incredible detail of Scott’s dystopian Los Angeles in 2019 (it could still happen, people!) over and over. And now we know that Ford played the character that way to suggest that Deckard was himself an android (don’t argue, just give in to the red-eye and unicorn clues).

After exhausting the five-disc “Ultimate Collector’s” DVD (with all three cuts of the movie) and reading the making-of book, I can safely say there’s nothing about the story of this movie that hasn’t been told by now. And yet, there’s a mystical, more-than-the-sum-of-its parts quality to the film that continues to promise the revelation of new secrets with each repeat viewing. In other words, it is the ultimate cult movie.

2. THE ROCKY HORROR PICTURE SHOW (1975) This ranking doesn’t have much to do with the quality of the film: it is neither as life-alteringly amazing as its die-hard fans claim, or as abysmally awful as its critics say. It’s a fun, campy and, for its time, pretty edgy little genre mash-up that manages to pay tribute to musicals, monster movies and science fiction double features at the same time that it subverts their button-down moralizing. (Tim Curry as the cross-dressing Dr. Frank-N-Furter is the highlight of every scene he’s in.)
The simple truth is: There wouldn’t be cult films as we know them today without Rocky Horror Picture Show. It started the midnight movie craze and still brings out hordes of dressed-up, line-spewing, toast-chucking fanatics wherever and whenever it’s shown.


3. THIS IS SPINAL TAP (1984) There’s a reason why this is the most quoted cult film of all time. First-time viewers will latch on to the most obvious jokes—“these go to 11,” “none more black.”

But getting sucked into this mother of all mockumentaries is like going down the rabbit hole. By the third or fourth viewing, more subtle stuff like “mime is money” is starting to jump out, and by the 10th, completely buried jokes like the one about Boston: “I wouldn’t worry about it, though, it’s not a big college town.” To think that most of this dialogue was improvised is mind-blowing, although I was lucky enough to interview Michael McKean in character as David St. Hubbins, and I can attest that his improvised answers were as funny as anything in the film.

It’s also hard to believe it took so long to find an audience on video, although director Rob Reiner has said that the movie went over the heads of many people who thought Spinal Tap was a real band. Ironically, they did become one, with McKean and co-stars Christopher Guest and Harry Shearer “getting the band back together” for albums in 1992 and 2009, and touring.


4. NIGHT OF THE LIVING DEAD (1968) Every installment of Romero’s original zombie trilogy is an important cult film, but this one takes the cake because without it, we wouldn’t have the modern zombie movie. Before this, zombies were the stuff of quaint voodoo flicks, but Night of the Living Dead changed everything. It used the idea of the dead coming back to life to eat the living as a blank slate onto which the whole world could project its fears.

Endless big-brain theories sprung up to explain the film: Did the undead symbolize the oppressed proletariat? The revenge of the third world? And all this over a little black-and-white drive-in movie made for $140,000. Romero’s most brilliant move was making the zombies slow, lurching ghouls who overwhelm their prey with sheer numbers and relentless onslaught—they literally “crowd out” most of their victims. The ending is one of the most shocking in movie history, although I’ve never believed the official line that its racial overtones were unintentional. The scene may have, as Romero says, been written before African American Duane Jones was cast as Ben, but I guarantee everyone involved knew the message they were sending when they shot it.

5. MONTY PYTHON AND THE HOLY GRAIL (1975) There’s a long-running debate among Monty Python fans as to which is their best film, Holy Grail or Life of Brian. But really, there’s no contest: Holy Grail is perfect, from the many scenes that could have been skits in their earlier TV series (“Bring out your dead,” the Bridge of Death, etc.) to the funny throwaway lines like “Someday, all this will be yours”… “What, the curtains?”

What’s most ingenious about it all is that, rather than trying to hide the absurdity of a poorly financed comedy troupe trying to pull off a medieval period piece, the Pythons play it up whenever possible. The characters don’t ride horses, they skip along while banging coconuts together to sound like hooves, and the epic moment of their discovery of Camelot is undercut by the dismissive “It’s only a model.” Graham Chapman is perfect as the beleagured King Arthur, who has to put up with mouthy peasants, rude French soldiers and a Black Knight who doesn’t know when to call it a day.


6. REPO MAN (1984) Though it’s now one of the iconic cult films of the ’80s, writer-director Alex Cox’s debut studio film came this close—more than once—to never being released at all. Cox, a UCLA film student at the time, wasn’t about to languish in development hell, however, and he gained his first real notoriety when he took out an ad in Variety daring Universal to make his movie. Still, he told me his midnight-movie favorite never would have seen the light of day if it hadn’t been for one man named Kelly Neal, who believed in it so much he kept shuttling it from one college campus to the next until it finally caught on. Neal lost his job at Universal because of it, but cult film fans got Emilio Estevez—pretty in punk before Pretty in Pink—as a young misfit who falls in with Harry Dean Stanton and a bunch of crazy repo men. They’re all on the trail of a mysterious 1964 Chevy Malibu that could be carrying aliens, a neutron bomb or time-machine technology. Along the way, Estevez learns the repo code, discovers the secret of air fresheners and sings classic punk tunes. It’s not as weird as it sounds, though. It’s much, much weirder.


7. PINK FLAMINGOS (1972) Chicken sex. Semen injections. Girl-on-girl vomit. Turd eating. Edith Massey. Those are just a few of the things that make Pink Flamingos the kind of movie that makes you want to take a shower after watching it.

The story of transvestite Divine’s quest to be “the filthiest person alive,” it’s got to be the most revolting film ever made. But its hour-and-a-half-long wallow in perversity and bad taste is exactly what made it so notorious, putting director John Waters on the map. When I interviewed him a few years ago, Waters marveled at how much things have changed since then, with Pink Flamingos playing on TV: “How can that be?” he pondered. “I mean, cable, but still.”

8. THE TEXAS CHAINSAW MASSACRE (1974) It’s hard to imagine now what it was like for audiences to see TCM when it came out. Wes Craven told me that when he saw it in a theater shortly after it was released, he found it so shocking and insane that he thought it might have been made by some sick cult somewhere.

He wasn’t that far off, as the production of director Tobe Hooper’s meat-versus-steel nightmare was as terrifying as the film itself (Edwin Neal, who plays the hitchhiker, said after filming wrapped: “If I see Tobe Hooper again, I’ll kill him”).

Though John Carpenter’s Halloween gets all the credit/blame for starting the slasher-movie cycle, Hooper’s film had most of the key elements of the formula in place: a masked killer, a group of teens being picked off one by one in a series of bizarre murders and, most importantly, the “Final Girl” element that would come to be mandatory.

Perhaps it doesn’t get the recognition it deserves as a trendsetter because it’s so weird and surreal that it’s hard to group it in with other movies; there hasn’t been one quite like it before or since.


9. TAXI DRIVER (1976) When the people responsible for making one of the most important films of all time are on record publicly questioning whether it ever should have been made in the first place, you know you’re talking about a film that transcends the normal considerations of what makes a movie “good” or “bad.”

Nor is there any notion of good or bad to be found in Martin Scorsese’s film, a reflection of the murky moral universe Americans felt themselves adrift in during the post-Watergate years of the mid-1970s. Taxi Driver never loses its power to disturb because it has no exterior moral universe whatsoever; the only codes of behavior on the table come out of the inner workings of Travis Bickle’s brain, and it’s pretty spooky in there. Robert De Niro allegedly studied both taxi drivers and mental illness to prepare for the role; the movie ends up being about both and neither.


10. ERASERHEAD (1977) To paraphrase Laurence Fishburne in The Matrix: No one can be told what Eraserhead is. You have to see it for yourself. Made for $10,000 over five years of on-again, off-again production, David Lynch’s debut film is as unsettling now as it was three decades ago. Not since Luis Buñuel and Salvador Dali collaborated on Un Chien Andalou in 1929 had there been a film whose surreal imagery tapped so directly into the viewer’s subconscious.

Eraserhead is uncomfortable viewing, and its most disturbing scenes (with the “baby,” for instance) are now the stuff of legend. But nothing is more revealing about this movie than the fact that the dream sequences are no weirder than those the characters experience in waking life. In Lynch’s world, there’s no such divide.

11/03/2011

iTerm2

iTerm2

iTerm2 is a terminal emulator for Mac OS X that does amazing things.

iTerm2新手应知特色功能
一种是用鼠标,在iterm2中,选中某个路径或者某个词汇,那么,iterm2就自动复制了。
在新Tab中自动使用前一Tab路径
command+d:垂直屏幕切割;
command+shift+d:水平屏幕切割
command+enter进入与返回全屏模式
保存当前快照 Window > Save Window Arrangement.
恢复快照: Window > Restore Window Arrangement
可以在Preferences > General > Open saved window arrangement.设置自动恢复快照
cmd+i can rename a tab

利口酒

利口酒 - 维基百科,自由的百科全书

利口酒,即餐後甜酒,譯自法語名稱Liqueur,還曾轉音為「利喬酒」或「力嬌酒」。它是用白蘭地為基酒,加入果汁和糖漿再浸泡各種水果或香料植物製成。所以利口酒氣味芬芳,口味甘美,適合餐前飯後單獨飲用。利口酒比重較大,所以特別適合用以調配各種色彩層次的雞尾酒。
目前利口酒也有用威士忌作基酒的,或用葡萄酒作基酒,用葡萄酒作基酒的利口酒已經和苦艾酒很相似了,不過比苦艾酒甘甜。

11/02/2011

Check if gzip is enabled

Check if gzip is enabled

curl -I -H "Accept-Encoding: gzip,deflate" "$URL" --silent | grep -i "Content-Encoding:"

# OR
curl -H "Accept-Encoding: gzip,deflate" "$URL" --silent --write-out "%{size_download}" --output /dev/null
curl "$URL" --silent --write-out "%{size_download}" --output /dev/null
# 2nd must be greater the 1st


function check_compression {
local unzipped=`curl "$1" --silent --write-out "%{size_download}" --output /dev/null`
local zipped=`curl -H "Accept-Encoding: gzip,deflate" "$1" --silent --write-out "%{size_download}" --output /dev/null`
echo "unzipped size: $unzipped, zipped size: $zipped"
}


telnet l.yimg.com 80
GET /f/a/tw/js/flash_general_20090213.js HTTP/1.1
HOST: l.yimg.com

response:
function yad_ad_090213(e,q,t,o,g,m,l,s,h,d,a){var f=window.location.href;if(e&&q&&t&&o&&g&&m&&l&&s&&h&&d&&a){if(typeof(this["yad_plugin_flash"+d])=="undefined"){var b=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var c=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var p=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;yad_ControlVersion=function(){var v=-1,w,u;try{w=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.8");v=w.GetVariable("$version")}catch(u){}return v};yad_GetSwfVer=function(){var B=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var y=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var x=navigator.plugins["Shockwave Flash"+y].description;var w=x.split(" ");var v=w[2].split(".");var A=v[0];var u=v[1];if(w[3]!=""){yad_tempArrayMinor=w[3].split("r")}else{yad_tempArrayMinor=w[4].split("r")}var z=yad_tempArrayMinor[1]>0?yad_tempArrayMinor[1]:0;var B=A+"."+u+"."+z}}else{if(b&&c&&!p){B=yad_ControlVersion()}}return B};yad_getVerNum=function(v){if(v==-1){return v}else{if(v!=0){if(b&&c&&!p){yad_tempArray=v.split(" ");yad_tempString=yad_tempArray[1];yad_versionArray=yad_tempString.split(",")}else{yad_versionArray=v.split(".")}var x=yad_versionArray[0];var u=yad_versionArray[1];var w=yad_versionArray[2];return x}else{return -1}}};var k=yad_GetSwfVer(),n=yad_getVerNum(k);this["yad_plugin_flash"+d]=false;if(n>=d){this["yad_plugin_flash"+d]=true}}var r="",j="clickTAG";for(i=0;i<e.length;i++){i==0?r+=j+"="+encodeURIComponent(e[i])+"&yad_time="+h+"&yad_page="+encodeURIComponent(f)+"&":r+=j+i+"="+encodeURIComponent(e[i])+"&yad_time="+h+"&yad_page="+encodeURIComponent(f)+"&"}this["yad_plugin_flash"+d]?document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+m+'" height="'+l+'" id="adbn_swf_'+g+'" ><param name="movie" value="'+q+'" /><param name="wmode" value="'+s+'" /><param name="loop" value="true" /><param name="quality" value="high" /><param name="allowScriptAccess" value="'+a+'" /><param name="flashvars" value="'+r+'" /><embed src="'+q+'" loop="true" wmode="'+s+'" quality="high" name="adbn_swf_'+g+'" width="'+m+'" height="'+l+'" flashvars="'+r+'" type="application/x-shockwave-flash" allowScriptAccess="'+a+'"></embed></object>'):document.write('<a href="'+t+'" target="_blank"><img src="'+o+'" width="'+m+'" height="'+l+'" border="0" /></a>')}}function yad_showAd_090213(){if(yad_pos.lastIndexOf("%")!=-1){yad_pos="yad"}if(yad_url&&yad_swf&&yad_aurl&&yad_aimg&&yad_pos&&yad_w&&yad_h&&yad_wmode&&yad_time&&yad_ver&&yad_allowscript){yad_ad_090213(yad_url,yad_swf,yad_aurl,yad_aimg,yad_pos,yad_w,yad_h,yad_wmode,yad_time,yad_ver,yad_allowscript)}}yad_showAd_090213();var yad_flash_lib_loaded_090213=true;

telnet l.yimg.com 80
GET /f/a/tw/js/flash_general_20090213.js HTTP/1.1
HOST: l.yimg.com
Accept-Encoding: gzip, deflate

response:
HTTP/1.1 200 OK
Date: Wed, 26 Oct 2011 15:27:01 GMT
Cache-Control: max-age=31536000
Expires: Thu, 25 Oct 2012 15:27:01 GMT
Last-Modified: Fri, 13 Feb 2009 06:26:17 GMT
Accept-Ranges: bytes
Vary: Accept-Encoding
Content-Type: application/x-javascript
Content-Encoding: gzip
Age: 594506
Content-Length: 1180
Connection: keep-alive
Server: YTS/1.20.4

?Vko?6?+
?1D;v^k?Ё?dE?u??`-QIT?W\W$%?;m??׹????屓1????c?fR?2đ?"??E?ZD.Y???(?n ?7d?I!|?0??C?CAB?B@?B(?%&[&??!`?(?$?}Ͻ???ݙ?1?c?z,?.?)،I?|?q?%I?TK;??g?Ϗ?w?:?u???<?t?d?wd3?/??!)5??&??;??mEyJ?اq??|H? d??7<??5A7k?
i?g?????w<?x`h???n̾}?1?j???g?^=?y{?5,p??DA`/g]???`???,?k7MB&?o?L???Y??mvǸ??fz??i?bWN?fG?
ӎ??؎r{????,???V?????Ȫ???k?]?V?????^U??[?&?{'?YS{'??a??k?ܬ:?????3޹t??b?Q????q?N??a?Z}??O????NȜ?ǟ????d?7dW???Cf?2A?????l??Mc??????ox??X6:?N?̲?g???Y&ħ??<%Z/?4W?G???N?]
?Q????nj8?2WE????nn'?w????m??w????ɇ????????yO??dn`plG?10?? S?P-?2?.?yZz?c?W{??1QE?` s??^?dSF??-Lzr??!*?{?????^?A??tD???ۍ???-9@??*?i??5R??RF??i???4ƵV5Ƽ??wC??dm?zQH%????{?䵓???S????p????D; Ǻ<F??`?r???8J&ӔD?K??|??Y?`??F????悞? ??U?m?ä??x???SW8??Y?f????湱jN??j๐_j???? Yoiq=?b?????Y??????g??5?*??ײ&߼??????a?c???D-#?[??:"?`վ??<d?yȉK[?n???o??L?

Connection closed by foreign host.


SSL:
openssl s_client -connect www.example.com:443 -state


GET /foo/javascripts/bar.js?0.0.26 HTTP/1.1
HOST:www.example.com
Accept-Encoding: gzip,deflate

curl -H "Accept-Encoding: gzip,deflate" https://www.htctouch.com/personalize/javascripts/htc-scenebuilder.js?0.0.26

How to Change the Default Email Client on Mac OS X

How to Change the Default Email Client on Mac OS X

1. Launch Apple Mail (Mail.app).
If you've not set up Mail, set up a dummy POP, IMAP, or Exchange account (it will try and verify, get an error, but still allow you to continue). Keep filling in information and hitting continue until you can get to the next step:
2. Go to Mail > Preferences in the menu.
3. Click on "General" tab.
4. In the "Default Email Reader" pull-down menu, choose Select, browse to the email client application you want to use, highlight it and click "Select".
5. Close the Preferences dialog box.