rain-stars pictures 雨星电影 www.rain-stars.com | Danny Yuxing Huang's website

Recycle your files in Linux/Unix

Ever wished that the Linux/Unix shell had a Recycle Bin like Windows or Trash like Mac? Frustrated because you typed "rm *" too quickly? And also angry that it is difficult to recover rm-deleted files? No more fears about accidentally deleting your files!

I have written this simple shell script that moves your files to some temporary folders, instead of deleting them straightaway. These folders are located within /tmp. Thus, they're automatically cleared upon system restart. You can now safely recycle any files, without worrying that these trashed files may fill up your hard disk.

To install the recycle utility, open your terminal and enter the following commands:

wget http://cs.williams.edu/~yh1/recycle
chmod +x recycle
sudo mv recycle /usr/bin/

Use it as if you're using the rm utility. For instance, you want to delete all the folders that start with "log", and all the python files. You can do the following:

recycle log* *.py

Upon successful return, the system notifies you that the files have been recycled to a certain temporary directory. An example looks like this:

Files recyled to: /tmp/recycled-Thu-Jul-22-13.47.16-PDT-2010/

You can easily recover files from these temporary folders based on the date and time of recycle.

If you're unsure, type recycle at the command prompt and a help message will be displayed. Email me if you have doubts or suggestions for improvement. Contact me at http://cs.williams.edu/~yh1/.

One last note: If you should be too used to the your beloved old pal rm, then in your ~/.bashrc make an alias rm that actually calls recycle.

2 Comments Filed under: Blog | Modified: July 26, 2010 at 11:59 am

Inception: Movie Review.

Inception is at best a bowl of colorful salad. It mixes typical Hollywood chase and action sequences, along with popular Freudian psychology, sprinkled with a pinch of philosophies that are not too uncommon since the Matrix. Undeniably, the movie has a smart plot. Everything fits (somewhat) together, as if a key is inserted into a lock and somehow all the pins miraculously align. But I would hesitate to call it witty. The film lacks the spark of intelligence that makes you ponder long after you file toward the exit of the movie theater, along with tens of others who keep saying "The film is cool/good".

One big drawback is that Nolan is being too ambitious in this project. His intentions, to me, are clear. He attempts to make a clever movie with potentially deep philosophical meanings, strung together with action/love sequences. In trying to squeeze so many things within the mere two-and-half hour film, his plan backfires. The film, instead, comprises action/love sequences dotted with such philosophies. In one moment, you would have the characters explaining the Freudian theories in nebulous terms. In the next moment, they start embracing themselves for the enemy gunfire and heart-throbbing car chase. Before you realize it, the scene is saturated with guilt and love (man-woman, father-son). This is followed by a character's confusion with dream, reality, and the subconscious world that seem to bridge the both. All the narrative elements are distinct, just like a bowl of salad. That, I guess, is a rather disappointingly easy formula that manages to cater to everyone's taste. You like the vegetables; you eat it. You don't like the tomatoes; you skip it. You like everything; you gorge down everything. Finally, you walk out of the theater, full and contented, yet uncertain what you have consumed for the past two-and-half hours. Maybe you start questioning whether you have woken up from a dream.

In his ambition, Nolan fills the scenes with heavy-handed discussions on the philosophical motivations. I would be more comfortable with a subtler approach. To be fair, there is a fine tension between how much depth the film should dive into, and how quickly the plot should unroll. This is a delicate balance, especially in an ambitious project like this. In return for deeper discussions of the philosophical motivations, the filmmaker risks sacrificing the popular appeals for fast-paced chase sequences or eye-popping special effects. They cannot afford to lose the audience. In this case, Nolan stops short when the plot opens up for deeper explorations, for instance, as the characters start to embrace their imaginary yet subconscious reality. He sprinkles just enough of the Freudian Iceberg or Plato's Cave for the plot to proceed. And sadly, because he devotes so little time into the philosophical substances, he tends to make the answers come too easy. This prematurely pulls you out of the suspense. It sets you into a comfort zone too soon. You're safe to explain, for instance, the rationale behind Cobb's actions around the mid-point of the narrative. Ellen Page's character, in particular, murders the nail-biting tension that permeates throughout the beginning of the movie. In her bold and daring exploration of Cobb's world, she finds the Pandora's Box and opens it. The beans are spilled. From then onwards, an otherwise multi-dimensional narrative space collapses into something that which is solely driven by actions. Of course there are subsequently some feeble attempts to add twists into the philosophical and psychological sides of the story. By then, however, you are no longer sitting on the edge of your seat yearning to understand the characters. The most exciting part of the roller coast ride is over. You are waiting for the car to return to the base station.

It is worth noting that a part of the film, at least in my opinion, is an apt tribute to Stanley Kubrick's classic 2001: A Space Odyssey. Both films are very similar in their portrayals of the dreamy sequences. Kubrick's cinematographic grace---his long, wide shots, his floating camera moves---is matched with Nolan's succinct punctuations in the free-fall sequences. It is especially remarkable that in the world crazy about fast cuts Nolan is able to take a brief respite from all the actions. They are punctuated with slow, surreal yet breath-stopping moments of silence, where (spoilers) characters free-fall back to another dream or the van takes its hour-long leap into the water. It is in such moments that you feel the throbbing heart in your chest and the residual fear from the previous gunfight.

(Thank you, mocha, for keeping me still awake even at 1 am Pacific Time.)

No Comments Filed under: Blog | Modified: July 20, 2010 at 4:00 am

Many faces underground. Berlin.

Click to enlarge.
Berlin

Photographed using my Samsung phone.

No Comments Filed under: Blog, Photos | Modified: June 27, 2010 at 6:39 pm

Sara’s Birthday Party

Photographs by Danny Y. Huang

No Comments Filed under: Blog | Modified: April 17, 2010 at 12:45 am

Zakir Hussain

It is hardly appropriate to use the term "intimate" to describe the physical settings of Zakir Hussain's concert. The interiors of the University of Massachusetts Fine Arts Center are anything but welcoming or cosy. Gray, barren, concrete walls surround the approximately 500-seat audience. But even given such minimalism, the concert was definitely a heart-warming event. The performers were successful in reaching out to the audience, not only through the music, but also through their body languages, their concise introductions on Indian music, their jokes, and their ability to relate the music to everyday life. To describe this event as merely a concert would be an understatement. For this is a lively and interactive shared experience enriched with educational values.

Read more...
No Comments Filed under: Blog | Modified: April 8, 2010 at 11:15 pm

Chinese New Year Celebration 2010

To save an image, right click on its thumbnail and select "Save Link As" (FireFox) or "Download Link" (Safari). Cropping and color adjustment in Google Picasa.

No Comments Filed under: Blog, Photos | Modified: March 5, 2010 at 5:06 pm

The Curious Case of Cows and Corn

Well, we made it despite the weather. A few friends and I were having a barbecue on Stone Hill last Saturday. We built our own grill out of rock where we placed the grill grid. The weather had been fickle for the past weekend. Fortunately, by the time we were ready with the grill, the downpour had stopped. The fire was good, the food was good—everything was good for two hours until a dozen cows and horses paid us a surprise visit around 9 pm at the camp site.

Read more...
No Comments Filed under: Blog | Modified: December 25, 2009 at 11:11 pm

Of Milk Powder and Mao

November, 2006

When you get off the plane at Shenzhen Airport, do not be too surprised if you meet him. He dresses neatly in a well-tailored suit, looks fascinatingly good and speaks fluent English; and he is a beggar. He will tell you how he is out of job and needs money to buy milk powder for his child – not money for alcohol or private vices – milk powder for his infant son. Being a crafty and seasoned traveler, you might offer to buy him some milk powder rather than surrender hard cash. He follows you to the airport mart – you might buy him something extra for his wife, because you rarely see such “noble” beggars. You leave, having done some good, smug and philanthropic. But all the airport staff knows he carts home a bundle of stuff each day, sometimes with hard cash included, and resells these goods to marts in the city for less than the rack rate.

Read more...
2 Comments Filed under: Blog | Modified: December 24, 2009 at 2:49 am