Setup Lighttpd for Vedio Streaming

Lighttpd is said that much lighter that Apache. I tried to set it up for flv and H.264 streaming. The configuration is relatively easy.

1. Download lighttpd-1.4.29.tar.gz

2. Download lighttpd-1.4.18_mod_h264_streaming-2.2.0.tar.gz
(This is the patch for mod_h264)

3. Open tar ball of lighttpd
tar zxvf lighttpd-1.4.29.tar.gz

4. Patch h264-mod
mv lighttpd-1.4.29 lighttpd-1.4.18
tar zxvf lighttpd-1.4.18_mod_h264_streaming-2.2.0.tar.gz

5. config /etc/lighttpd.conf
basic setup:

server.port = 80
server.username = “lighttpd”
server.groupname = “lighttpd”
server.document-root = “/var/www”
server.tag = “lighttpd”
server.pid-file = “/var/run/lighttpd.pid”
server.errorlog = “/var/log/lighttpd/error.log”
include “conf.d/access_log.conf”
index-file.names += (
“index.html”, “index.htm”, “index.php”
)
include “conf.d/mime.conf”

6. module.conf
server.modules = (
“mod_access”,
“mod_fastcgi”,
“mod_h264_streaming”,
“mod_flv_streaming”,
“mod_rewrite”,
“mod_auth”,
)
h264-streaming.extensions = ( “.mp4” )
flv-streaming.extensions = ( “.flv” )

7. Setup vhost
There’re many samples out there for this part already, so I won’t write any here.

8. FCGI
I had FCGI installed in advance. To have lighttpd uses FCGI, edit

conf.d/fastcgi.conf

fastcgi.server = (
“.php” =>
(( “host” => “127.0.0.1”,
“port” => 81,
“bin-path” => “/usr/local/bin/php”
)),
)
9. restart lighttpd
Then you can see the lighttpd started fcgi process

10. Use jwplayer
download mediaplayer.zip
unzip it and copy “jwplayer.js” and “player.swf” to a folder under docroot of the site
check the “JW Player Quick Start Guide.pdf” in the zip file for how to use javascript to embed jwplayer to stream.

Larry the cat

Source From: http://www.bbc.co.uk/ukchina/simp/elt/take_away_english/111116_tae_343_cat_story.shtml

Larry the cat

Has Larry become just another government fat cat?

Larry the cat is still top dog at Number 10 Downing Street.

The British Prime Minister’s cat was brought in earlier this year after a large rat was seen running around.

But he has lately become tangled up in controversy. On Monday it emerged that a mouse had appeared at a Prime Ministerial dinner.

Then on Tuesday Larry was photographed sleeping on the job, as he took a nap during the arrival of ministers for their weekly cabinet meeting.

Has Larry become just another government fat cat? David Cameron’s spokesman dismissed rumours that the tabby’s predatory drive isn’t as strong as it was believed – even though it has emerged that the PM had to throw a fork at a mouse during a recent dinner with ministers.

Larry isn’t the first ‘First Pet’ to be dogged by controversy. George W Bush’s dog Barney’s pet hate seemed to be journalists. Being on a leash didn’t prevent him from biting a reporter’s finger.

But then, that’s exactly the kind of loyalty a premier needs. Pets are steadfast, companionable and of course never let the cat out of the bag.

Indeed, in the dog eat dog world of politics, it must sometimes feel like a dog is not just man’s best friend, but his only one.

In 1997, while Bill Clinton was himself in the doghouse for his affair with the White House intern Monica Lewinsky, he was photographed constantly in the company of his Labrador, Buddy. As the saying goes: “If you want a friend in Washington, get a dog”.

top dog首领,头号人物
to be tangled up陷入某种纠纷
to sleep on the job怠工,打盹
a fat cat肥猫,指薪水过高的人
to dismiss rumours否认谣言
a tabby(虎斑)猫
predatory drive寻食的本能/动力
the First Pet相当于第一夫人的位置
to be dogged by something受到某事的负面影响

a pet hate特别讨厌的东西或人
to be on a leash拴在链条/绳索上
to bite咬
steadfast立场坚定的,不变的
companionable友善的
to let the cat out of the bag不小心吐露了秘密
dog eat dog狗咬狗,无情竞争
man’s best friend人类最忠实地朋友
to be in the doghouse被打入冷宫

Mammoth hiking Aug. 2011 (3)

[singlepic id=104 w=320 h=240 float=left]

Duck path trail is a beautiful trail with many lakes. It starts from the cold water camp ground close to lake Marry. Last year we only walk a part of it, where i got many gorgeous water fall photos.
It’s 8 miles and a half hike, around 2000 feet elevation gain. On the way, there are lakes called Arrowhead, skeleton lake, Barney and Reds lake. At the end of the trail is the duck lake, very huge and the view is breath-taking. Barney lake is different from the others because of its color, not deep blue but green. At the higher part of the trail where close to the duck lake, you can see 3 lakes down there. Barney lake’s color reminds me sea with reef on the bottom at Hawaii.

Mammoth hiking Aug. 2011 (2)

[singlepic id=103 w=320 h=240 float=left]

For 45 minutes drive from Mammoth and there we came to the Yosemite national park east entrance. A small parking next to the gate was the trail head to the Gaylor lakes and Granite lakes. It starts at 9900 feet.
The beginning of the trail was steep. After getting up to the ridge, around 10600 feet ,  the beautiful view of the Gaylor lake shows up when looking down in the valley. The view of  snow mountains in the far back are amazing too.
Passing Gaylor lake, it’s a easy walk to the upper Gaylor lake then to the miner’s shack, except a part on a snow field and attack of hundreds of mosquitos. I tried to use hood and hat to protect my face but still got a few bites. They even bit through my long sleeve jacket on my shoulder. This year the snow melt later than usual and it seems the mosquito season is delayed too. It’s wise to have some bug nets and bug spray with you. On the way back, i took some nice photos of some wild flower and the granite lake.
The hike was totally 5 miles. Came back to the trail head, we decided to drive a little bit more into the Yosemite. Olmstedt point was 8 miles away. From there view of Half dome is pretty clear. It’s obviously a popular spot of photo shooting.
Tenaya lake is a huge lake on the way to the Olmstede point. It is very beautiful but just not so quiet because of the popularity.
Dinner was at the lodge, including sauteed chicken, boiled corn and veg soup. It was delicious.

Mammoth hiking Aug. 2011 (1)

[singlepic id=100 w=320 h=240 float=left]

Left LA 6am on Friday and arrived Mammoth around noon as planed.
Drove up lake George,  there is a short hike to Barrett lake and T.J. Lake, just good for the first day warm up hike.
Altitude is one important thing can’t be ignored hiking in high sierra mountains. The Mammoth town where we stayed is 8000 feet high, and lake George is above 9000 feet elevation already. As soon as walking up little bit, my heart started beating much faster. I was glad I did some hiking in Baldy last weekend.
This was only a small hike for the body to get adjusted to the  altitude, but I’ve got a few nice photos of the lakes and some wild flowers next to a creek.
Dinner at the lodge,  had fried rice and chicken Veg soup.

Summer wild flowers in Baldy

[singlepic id=99 w=320 h=240 float=left]This was the first time hiking at Mt. Baldy in the mid summer. At the ski hub, i was surprised to see wild flowers were blooming like in the spring.
The ski hub trail is a pretty steep one. It’s about 7 miles round trip with 3800 feet elevation gain. Even it is short, it took us 4 hours to go up and 3 hours to come down.

Yum Repo

Setup /etc/yum.conf
“man yum.conf” is useful to learn all the options

Yum repos are located under
/etc/yum.repos.d

$releasever is decided by distroverpkg in /etc/yum.conf
distroverpkg=redhat-release is set as default
how to get value of distroverpkg
yum whatprovides redhat-release

how to change $arch
man setarch

Yum with multiple repos
http://blog.chrisramsay.co.uk/2009/08/14/yum-with-multiple-repos-yum-plugin-priorities-on-centos/

RPMforge yum repo

To install RPMforge repo in yum,

http://wiki.centos.org/AdditionalResources/Repositories/RPMForge

#wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
#rpm –import http://apt.sw.be/RPM-GPG-KEY.dag.txt
#rpm -K rpmforge-release-0.5.2-2.el5.rf.*.rpm

#rpm -i rpmforge-release-0.5.2-2.el5.rf.i386.rpm

Hiking in Crystal Lake area

[singlepic id=96 w=320 h=240 float=left]Crystal lake area used to be a popular recreation resort for hiking, camping and boating. After the big fire 3 years ago in Los Angeles, some of the road got damaged and this area was closed for a few years. Finally it’s partly reopened again.

The view of beautiful lake between the mountains on the way to the crystal lake trail was amazing. I didn’t expect to see so much water in L.A. area. San Gabriel river east fork and west fork cross here. We hiked in the east fork last year to the bridge to nowehere.

During May, we hiked 3 trails in Crystal Lake area.
Windy Gap trail
The elevation was already very high where the trail starts, it was hard for me to walk fast. The trail was made even difficult to walk since many burned trees fell down and blocked the trail at many spots. The Windy gap was quite windy. Still some snow patches left in the shade.

Smith mountain
It was a beautiful trail with many wild flowers all the way up. but at the very end, there’s a very steep part to the peak, 0.5 miles with 800 feet escalation. Some part requires both hands to climb a little bit. After hiking this trail, my ankles were very sour for a few days.

Winston peak
[singlepic id=95 w=320 h=240 float=left]Because of the road closed for that day’s maintenance, we hiked 8 miles, 4 miles longer than our plan. It was my first time to see the snow plant. And there were so many of them. They look like red flower of some plant. But when you look closer, they don’t have any green leaves or stems.
The last part to the peak didn’t have any used trail. Even it was not very steep, probably with the escalation, I felt pretty tired.