Apr 26, 2011

shutdown --help

  • Linux

miclle@ubuntu:~$ shutdown –help

Usage: shutdown [OPTION]… 时间 [信息]

使系统关闭。

Options:

-r reboot after shutdown

-h halt or power off after shutdown

-H halt after shutdown (implies -h)

-P power off after shutdown (implies -h)

-c cancel a running shutdown

-k only send warnings, don’t shutdown

-q, –quiet reduce output to errors only

-v, –verbose increase output to include informational messages

–help display this help and exit

–version output version information and exit时间 可以使用不同的格式,最常用的是简单的一个单词 “now”,其使系统立即关闭。  其它可用的格式有 +m ,此 m是关机前等待的分钟数;hh:mm 其指定以 24 小时制中的时间。已登录的用户被一条发送到他们终端的一条消息警告,您可以包含一条可选的 消息 到此项中。  使用 -k选项可以发送警告而不真的关机。如果给出 时间 ,此命令将留在前端指导关机发生。  可以使用 Control-C 取消它,或者被其他用户以 -c 选项取消。系统默认进入维护状态 (单用户) 模式,你可以使用 -r 或 -h 更改此行为,其分别指定系统重启或关闭。-h 选项可以进一步由 -H 或 -P来指定伺候是关机还是切断电源。  默认动作由 shutdown 脚本决定。

Apr 24, 2011

时间即生命

  • 时间
  • 生命

我自己就是浪费了很多时间的一个人。我不打麻将,我不经常的听戏看电影,几年中难

得一次,我不长时间看电视,通常只看半个小时,我也不串门子闲聊天。有人问我:“那么

你大部分时间都做了些什么呢?”我痛自反省,我发现,除了职务上的必须及人情上所不能

免的活动之外,我的时间大部分都浪费了。我应该集中精力,读我所未读过的书,我应该利

用所有时间,写我所要写的东西,但是我没能这样做。我的好多的时间都糊里糊涂的混过去

了,“少壮不努力,老大徒伤悲。”

… …

然而悔之晚矣。

    —- 梁实秋

Apr 20, 2011

化蝶八载风继续吹:张国荣银幕经典回顾(转载)

  • 经典
  • 电影
  • 张国荣
  • 哥哥

原文地址:

http://www.u148.net/article/36157.html 

 

他曾用歌唱出“天空海阔,要做最坚强的泡沫”,又感叹“可会知我心里困倦满腔”,一边吟唱“我纵要依依带泪归去也愿意”,一边又要让“风继续吹”因“不忍远离”,可最爱的歌总算唱过。只是,“谁能代替你地位”?

 

转眼间,哥哥逝去已经八年,伤痛与愕然也许淡漠,思念却从未停止。每年的9月12和4月1,因为哥哥,成了缅怀与追思的时节。也许,心中有爱,他便似从未离开这个世界。

 

2010年,在CNN的两个评选中,哥哥均榜上有名。一是“史上最伟大的二十五位亚洲演员”,一是“过去五十年闻名全球的五大指标音乐人”,在后一个评选中,哥哥位列第三,与迈克尔·杰克逊,披头士,猫王和鲍勃·马利齐头并肩。——是的,他没有被遗忘,反而愈发闪光。

 

今天,让我们一起,回望大银幕上风华绝代的——张国荣。

 

 

《英雄本色》,1986年。饰演:宋子杰。主题歌《当年情》:拥着你当初温馨再涌现/心里边童年稚气梦未污染/今日我与你又试肩并肩/当年情此刻是添上新鲜 ——在吴宇森这部男儿史诗中,哥哥贡献了在周润发的丰神潇洒、狄龙的稳健悲情之外的疯狂和脆弱,他眼神中的矛盾和迷乱叫人心疼。

 

 

《倩女幽魂》,1987年。饰演:宁采臣(剧照来自2011年修复版)主题歌《倩女幽魂》:人生路美梦似路长/路里风霜风霜扑面干/红尘里美梦有几多方向/找痴痴梦幻中心爱/路随人茫茫——王祖贤与哥哥成就了最完美的、空前绝后的小倩和宁采臣。

 

 

《胭脂扣》,1988年。饰演:十二少——凄艳哀怨,吊诡奇谭。电影里如花赴死,十二少偷生;电影外十二少断魂,如花决然随他。如何不叫人唏嘘。

 

 

《倩女幽魂Ⅱ》,1990年。饰演:宁采臣——梦如路长,快乐少年郎。

 

 

《纵横四海》,1991年。饰演:阿占。主题歌《风继续吹》:风继续吹/不忍远离/心里极渴望希望留下伴着你 ——港版《祖与占》,一代人的经典回忆。只可惜,红豆与钵仔糕尘世徜徉,而斯人已去。

 

 

《阿飞正传》,1991年。饰演:旭仔。主题歌《何去何从》:我的心/是寂寞是孤寂/我的爱/是迷惘无所寄/黑夜中 寻觅一些感动/不知何去何从 ——忘情的独舞,眼角眉梢的幽寂。今夕何夕?故人西去。

 

 

《霸王别姬》,1993年。饰演:程蝶衣——“说好了是一辈子,差一年,差一个月,差一个时辰,都不是一辈子!”十年后,你终于化蝶,一辈子,如此而已。

 

 

《霸王别姬》,1993年。饰演:程蝶衣——“蝶衣,你真是不疯魔不成活啊。”哥哥又何尝不是?

 

 

《白发魔女传》,1993年。饰演:卓一航。主题歌《红颜白发》:若这一生/欠这一晚/谁说爱是这样难/恨爱之间分不散/红颜白发/更觉璀璨 ——自古美人如名将,不许人间见白头。有些事,也许不见得就不是好的。

 

《金枝玉叶》,1994年。饰演:顾家明。主题歌《追》:一追再追/只想追赶生命里一分一秒/原来多么可笑/你是真正目标

 

 

《东邪西毒》,1994年。饰演:欧阳锋(剧照来自2008年修复的《东邪西毒:终极版》) “很多年之后,我有个绰号叫做‘西毒’。其实任何人都可以变得狠毒,只要你尝试过甚么叫‘忌妒’。我不会介意他人怎样看我,我只不过不想别人比我更开心。”——希望你在天国,能比别人更开心。

 

 

《东邪西毒》,1994年。饰演:欧阳锋(剧照来自2008年修复的《东邪西毒:终极版》) “我知道要想不被人拒绝,最好的方法是先拒绝别人。”

 

 

《夜半歌声》,1995年。饰演:宋丹平。主题歌《夜半歌声》:用尽一生/也愿意去等/总会有一天/把心愿完成/带着你飞奔找永恒

 

 

《风月》,1996年。饰演:郁忠良——哥哥与陈凯歌的再度合作,可惜影片未臻完美,亦被掩盖于《霸王别姬》的光芒之后。

 

 

《新上海滩》,1996年。饰演:许文强——哥哥版的许文强更加悲情,更加沧桑,强烈的末世感令人绝望窒息。

 

 

《春光乍泄》,1997年。饰演:何宝荣 ——何宝荣也许是华语同志片中最让人怜惜的角色,他孩子一般任性迷惘,在命运的河流中挣扎沉浮,渴望爱又无力爱。自我放逐,毫无方向。这到底是何宝荣,还是张国荣本人?

 

 

《摄氏零度·春光再现》,1999年。《春光乍泄》的纪录片。

 

 

《恋战冲绳》,2000年。饰演:Jimmy——哥哥后期难得的轻松搞笑片,倘若电影照进现实,该有多好?

 

 

《异度空间》,2003年。饰演:阿占 ——因入戏太深而深陷困扰,也许是造成悲剧的间接原因之一。将自己变成戏中人,是影迷的福气,戏中人上身,却是我们难以痊愈的心头伤口。

 

 

为你只是你那么贪靓,为何不走得漂亮一些?

为你钟情 倾我至诚 请你珍藏 这份情 然后百年 终你一生 用那真心痴爱来做证

Apr 20, 2011

Ubuntu下使用Squid代理服务器

  • Linux
  • Ubuntu
  • Squid
  • 代理
  • 宽带
  • 光纤
  • 电信
  • 吭爹

小区宽带升级成了光纤,2M变成了10M,爽!不过很吭爹的是,只能连四能PC,再连就不能上外网了,日啊!电信你大爷,你就是李莲英!

人民群众是智慧滴!GOOGLE了一把找到解决办法:

我这有一台Ubuntu的内网服务器,可以通过Squid代理服务器使其它PC上网,

安装:

root@ubuntu:~$ apt-get install squid

root@ubuntu:~$ vim /etc/squid/squid.conf

/INSERT YOUR OWN RULE(S) 找到  大概在671行的样子

INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS

Example rule allowing access from your local networks.

Adapt localnet in the ACL section to list your (internal) IP networks

from where browsing should be allowed

#http_access allow localnet

http_access allow localhost

And finally deny all other access to this proxy

http_access deny all #修改这个地方接受所有IP,当然也可以限定只允许一些IP

http_access allow all

退出保存!

执行:

root@ubuntu:~$ squid -z

root@ubuntu:~$ /etc/init.d/squid reload

root@ubuntu:~$ /etc/init.d/squid restart

root@ubuntu:~$ squid -k parse

按教程来了这几步,好像没有生效,后来重启了一下就可以用了!

在其它PC上就可以设置代理,代理IP是刚刚设置代理服务器的网IP,端口是默认的3128

其它命令:

root@ubuntu:~$ squid (后台启动)

root@ubuntu:~$ squid -k shutdown (关掉代理)

Apr 11, 2011

初识Arduino

  • 硬件
  • Arduino

无意间在GOOGLE邮件列表中看到新车间的话题,看到他们的四旋翼项目,很感兴趣,读小学时候曾把家里的电器都拆过,很是喜欢折腾啊,后来大点了要考试,折腾代替不了考试,这个兴趣如此就停了好多年。

Arduino是一个开放的硬件平台,包括一个简单易用的I/O电路板,以及一个基于Eclipse的软件开发环境。Arduino即可以被用来开发能够独立运行,并具备一定互动性的电子作品,也可以被用来开发与PC相连接的外围装置,这些装甚至还能够与运行在PC上的软件(如Flash,Max/Msp,Director,Processing等)进行沟通。

从淘宝上购得一块Arduino MEGA ATmega1280 AVR开发板,198RMB啊,买回来没两天,因为写了一个程序,把控制器芯片固件损坏了,郁闷了几天,没办法只得去买块Arduino USBtinyISP v3.0 专用下载器来刷板,RMB49。

今天订的无刷电机、电调已到货,回家继续折腾…

感慨二下:有淘宝真TM方便!搞硬件很烧钱!

Apr 11, 2011

jQuery Plugins

  • JavaScript
  • 前端
  • jQuery

sausage.js

Sausage

is a jQuery UI widget for contextual pagination. It complements long or

infinite-scrolling pages by keeping the user informed of her location

within the document.Javascript-283 in Useful JavaScript and jQuery Tools, Libraries, PluginsjQuery Waypoints

Waypoints is a small jQuery plugin that makes it easy to execute a function whenever you scroll to an element.Javascript-234 in Useful JavaScript and jQuery Tools, Libraries, PluginsPietimer jQuery Plugin

Pietimer injects a canvas element into the page which has an ever reducing pie shaped timer.Javascript-303 in Useful JavaScript and jQuery Tools, Libraries, PluginsImageLens: a jQuery plug-in for Lens Effect Image Zooming

You can use this jQuery plug-in to add lens style zooming effect to an image.Javascript-306 in Useful JavaScript and jQuery Tools, Libraries, PluginsTimeglider jQuery Plugin/Widget

Timeglider

is a zooming, panning data-driven timeline — great for history

projects, project planning or any other tasks where you’ll need to

display a time frame.Javascript-307 in Useful JavaScript and jQuery Tools, Libraries, Plugins960 Grid on jQuery-Mobile

A

port of a 960 grids to use in jQuery mobile. It aims to bring more

flexibility to jQuery-mobile layouts and thus makes it easier to use on

tablets. The code is available on Github under MIT license.Javascript-130 in Useful JavaScript and jQuery Tools, Libraries, PluginsdiagonalFade jQuery plugin

A

jQuery plugin allowing you to easily specify direction, fade-in,

fade-out, and a host of other options to a grouping of elements.Javascript-308 in Useful JavaScript and jQuery Tools, Libraries, PluginsWijmo jQuery UI Widgets

Wijmo

is a complete kit of over 30 UI widgets with everything from

interactive menus to rich charts. If you know jQuery, you know Wijmo.

Complete with documentation and professional support, every widget is

hand-crafted and includes premium themes.Javascript-267 in Useful JavaScript and jQuery Tools, Libraries, PluginsLettering.js – A jQuery Plugin for Radical Web Typography

CSS

does not offer a complete down-to-the-letter control. Here you’ll find

kerning type, editorial design, manageable code and complete control —

just a few examples of what can easily by done with Lettering.js.Javascript-160 in Useful JavaScript and jQuery Tools, Libraries, Pluginsjslide

jslide is a jQuery plugin to create a simple slideshow of list elements, containing either images or other content.Javascript-201 in Useful JavaScript and jQuery Tools, Libraries, PluginsIsotope: A jQuery Plugin for Magical Layouts

An

exquisite jQuery plugin for magical layouts. Enables filtering,

sorting, and dynamic layouts. Isotope’s capabilities are designed to be

used together cohesively. You can do it all — filter, sort, change

layout modes, add items — and Isotope will handle it with ease.Javascript-131 in Useful JavaScript and jQuery Tools, Libraries, PluginsBetter Check Boxes with jQuery and CSS

In

this short tutorial, the authors will create a replacement for the

default browser checkboxes in the form of a simple jQuery plugin.Javascript-286 in Useful JavaScript and jQuery Tools, Libraries, PluginsThumbnails Navigation Gallery with jQuery

In

this tutorial the authors are going to create an extraordinary gallery

with scrollable thumbnails that slide out from a navigation. They are

going to use jQuery and some CSS3 properties for the style.Javascript-270 in Useful JavaScript and jQuery Tools, Libraries, PluginsjQuery Quicktag

Quicktag is a tagging plugin for the jQuery JavaScript library.DataTables (table plug-in for jQuery)

DataTables

is a plug-in for the jQuery Javascript library. It is a highly flexible

tool, based upon the foundations of progressive enhancement, which will

add advanced interaction controls to any HTML table.Javascript-262 in Useful JavaScript and jQuery Tools, Libraries, PluginsjQuery Tags Input

This

plugin will turn your boring tag list into a magical input that turns

each tag into a style-able object with its own delete link. The plugin

handles all the data — your form just sees a comma-delimited list of

tags.Javascript-274 in Useful JavaScript and jQuery Tools, Libraries, Pluginsjquery.timepickr.js

a jQuery library that enhances a date picker input area with a more convenient date selection.Javascript-224 in Useful JavaScript and jQuery Tools, Libraries, Plugins原文地址:

http://www.smashingmagazine.com/2011/04/07/useful-javascript-and-jquery-tools-libraries-plugins/

Apr 11, 2011

一些JavaScript的工具和实用程序

  • JavaScript

TestSwarm: Continious & Distributed JS Testing

TestSwarm

is an open source project by Mozilla Labs (and created by John Resig)

which aims to simplify the complicated and time-consuming process of

running JavaScript test suites in multiple browsers. It offers a

continious & distributed testing environment that can be used by

multiple users running the tests in various browsers with a

“set-and-forget” logic.Javascript-212 in Useful JavaScript and jQuery Tools, Libraries, PluginsMinimee

On

the Web, speed is important — so when it comes to CSS and JavaScript

files, size does matter. By automatically minimizing and combining your

files for you, Minimee takes the heavy lifting out of keeping your files

nice and clean. Minimee is an ExpressionEngine add-on only.Javascript-169 in Useful JavaScript and jQuery Tools, Libraries, PluginsDoctor JS

Doctor

JS is a tool which analyzes your JavaScript code. The tool tests how

well your code is written in regards to polymorphism, prototypes,

exceptions and callbacks. You might want to check out

JSLint as well.Javascript-174 in Useful JavaScript and jQuery Tools, Libraries, PluginsRemy Sharp’s JSConsole

A

JavaScript (and CoffeeScript) web console, useful for quick

experimentation, debugging, presentations (for live coding) and

workshops. Also available as a native iOS app from the iTunes store.Javascript-269 in Useful JavaScript and jQuery Tools, Libraries, PluginsJavaScript Library Boilerplate

Why

go through the tedium of creating both a closure AND a .noConflict

method when all you want to do is create your own JavaScript Library?

With JavaScript Library Boilerplate, you can hit the ground running and

create your own JavaScript Library in no time![Javascript-260 in Useful JavaScript and jQuery Tools, Libraries, Plugins](http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2011/04/javascript-260.jpg)jsdoc-toolkit

JsDoc

Toolkit is an application, written in JavaScript, for automatically

generating template-formatted, multi-page HTML (or XML, JSON, or any

other text-based) documentation from commented JavaScript source code.Js-010 in Useful JavaScript and jQuery Tools, Libraries, PluginsJasmine: BDD for your JavaScript

Jasmine

is a behavior-driven development framework for testing your JavaScript

code. It does not depend on any other JavaScript frameworks. It does not

require a DOM. And it has a clean, obvious syntax so that you can

easily write tests.Js-011 in Useful JavaScript and jQuery Tools, Libraries, PluginsObfuscateJS: JavaScript compressor

The

obfuscator currently removes whitespace and comments. It renames

variablenames with a local scope to a shorter version, And as an

advanced option it renames all variables with a certain prefix to a

shorter name.Javascript-282 in Useful JavaScript and jQuery Tools, Libraries, PluginsOnline JavaScript beautifier

This

beautifier will reformat and reindent bookmarklets, ugly javascript,

unpack scripts packed by the popular Dean Edward’s packer, as well as

deobfuscate scripts processed by javascriptobfuscator.com.PEG.js

PEG.js

is a parser generator for JavaScript based on the parsing expression

grammar formalism. It enables you to easily build fast parsers which

process complex data or computer languages. You can use it as an

underlying tool when writing various data processors, transformers,

interpreters, or compilers.Javascript-228 in Useful JavaScript and jQuery Tools, Libraries, PluginsJSONView

JSONView is a Firefox extension that helps you view JSON documents in the browser.Js-014 in Useful JavaScript and jQuery Tools, Libraries, PluginsjsPerf: JavaScript performance playground

jsPerf

aims to provide an easy way to create and share test cases, comparing

the performance of different JavaScript snippets by running benchmarks.JSonduit

JSonduit is a service that can turn practically anything on the web

into a JSON feed that any website or mobile app can consume.Javascript-182 in Useful JavaScript and jQuery Tools, Libraries, Pluginsjsplumb

jsPlumb

provides a means for a developer to visually connect elements on their

web page, in much the same way you might have seen on Yahoo Pipes. It

uses Canvas in modern browsers, and Google’s ExplorerCanvas script for

stone-age browsers. The current version (1.2.5) can be used with jQuery,

MooTools and YUI3.Javascript-193 in Useful JavaScript and jQuery Tools, Libraries, PluginsHelma

Helma

is a server-side JavaScript environment and web application framework

for fast and efficient scripting and serving of your websites and

Internet applications.Js-015 in Useful JavaScript and jQuery Tools, Libraries, PluginsHTML + JSON Report

Online HTML5 JSON Report format to view any JSON data in a human-readable HTML view.Javascript-300 in Useful JavaScript and jQuery Tools, Libraries, PluginsJSON Editor

This

editor allows for easy editing of json strings, after loading a sample

from the dropdown list click ‘build tree’, expand the tree, click nodes

and start changing.Javascript-222 in Useful JavaScript and jQuery Tools, Libraries, PluginsJSCSSP, a CSS parser in JavaScript

JSCSSP

is a CSS parser written in cross-browser JavaScript. It parses a string

containing CSS styles and outputs a CSS Object Model (warning: not the

CSS Object Model). It can preserve some comments, at-rules and style

rules that your browser does not recognize and trashes, and even

whitespaces if you absolutely need to preserve indentation and blank

lines.原文地址:

http://www.smashingmagazine.com/2011/04/07/useful-javascript-and-jquery-tools-libraries-plugins/

Apr 11, 2011

一些非常不错的JavaScript库

  • JavaScript

Respond.js: Fast CSS3 Media Queries for Internet Explorer 6-8 and More

The

goal of this script is to provide a fast and lightweight script to

enable responsive Web designs in browsers that don’t support CSS3 Media

Queries. In particular, Internet Explorer 8 and under.Javascript-154 in Useful JavaScript and jQuery Tools, Libraries, PluginsBlackbird: Open Source JavaScript Logging Utility

Blackbird offers a dead-simple way to log messages in JavaScript and an attractive console to view and filter them.Javascript-199 in Useful JavaScript and jQuery Tools, Libraries, PluginsTreesaver.js

Treesaver

is a JavaScript framework for creating magazine-style layouts using

standards-compliant HTML and CSS. It is free for all uses and made

available under the MIT or GPLv2 licenses.Js-001 in Useful JavaScript and jQuery Tools, Libraries, PluginsBibliotype

Bibliotype is a (very) simple HTML, CSS and JS based library for rapid prototyping long-form typography and reading on tablets.Useful-tool-127 in Useful JavaScript and jQuery Tools, Libraries, PluginsHighcharts – Interactive JavaScript charts

Highcharts

is a charting library written in pure JavaScript, offering an easy way

of adding interactive charts to your web site or web application.

Highcharts currently supports line, spline, area, areaspline, column,

bar, pie and scatter chart types.Javascript-264 in Useful JavaScript and jQuery Tools, Libraries, PluginsjStat: a JavaScript statistical library

jStat

is a statistical library written in JavaScript that allows you to

perform advanced statistical operations without the need of a dedicated

statistical language (i.e. MATLAB or R).Js-007 in Useful JavaScript and jQuery Tools, Libraries, Pluginshighlight.js

Highlight.js

highlights syntax in code examples on blogs, forums and in fact on any

web pages. It’s very easy to use because it works automatically: finds

blocks of code, detects a language, highlights it.Javascript-268 in Useful JavaScript and jQuery Tools, Libraries, PluginsVisual Event JS Library

Events

in Javascript are often seen as a bit of an enigma. This is odd given

that Javascript is very much an event driven language, but it is

typically down to their complex nature and difficulty to debug. To this

end the author created Visual Event to help track events which are

subscribed to DOM nodes.Js-005 in Useful JavaScript and jQuery Tools, Libraries, PluginsUnderscore.js

Underscore

is a utility-belt library for JavaScript that provides a lot of the

functional programming support that you would expect in Prototype.js (or

Ruby), but without extending any of the built-in JavaScript objects.Javascript-279 in Useful JavaScript and jQuery Tools, Libraries, PluginsPopcorn.js

Popcorn.js, is a HTML5 javascript library for integrating the web into video production.Javascript-315 in Useful JavaScript and jQuery Tools, Libraries, PluginsSlickGrid!

SlickGrid is a JavaScript grid/spreadsheet component.Js-004 in Useful JavaScript and jQuery Tools, Libraries, PluginsJavaScript InfoVis Toolkit

The JavaScript InfoVis Toolkit provides tools for creating Interactive Data Visualizations for the Web.Javascript-237 in Useful JavaScript and jQuery Tools, Libraries, PluginsHandlebars.js: Minimal Templating on Steroids

Handlebars

provides the power necessary to let you build semantic templates

effectively with no frustration. You might want to read ThinkVitamin’s

article

Getting Started with Handlebars.js, too.Javascript-280 in Useful JavaScript and jQuery Tools, Libraries, PluginsBackbone.js

Backbone

supplies structure to JavaScript-heavy applications by providing models

with key-value binding and custom events, collections with a rich API

of enumerable functions, views with declarative event handling, and

connects it all to your existing application over a RESTful JSON

interface.Javascript-313 in Useful JavaScript and jQuery Tools, Libraries, Plugins[Load JavaScript and Stylesheets on Demand SidJS](http://www.diveintojavascript.com/projects/sidjs-load-javascript-and-stylesheets-on-demand)

SidJS

is a lightweight JavaScript library used to load JavaScript scripts and

CSS stylesheets on demand. It increases AJAX applications performance

by loading resources when they’re needed.OpenFaces

OpenFaces

is an open-source library of AJAX-powered JSF components, an Ajax

framework and a client-side validation framework. OpenFaces is based on

the set of JSF components formerly known as QuipuKit. It contains fully

revised codebase of QuipuKit and introduces many new components and

features.Js-009 in Useful JavaScript and jQuery Tools, Libraries, Pluginsd3.js

D3

allows you to bind arbitrary data to a Document Object Model (DOM), and

then apply data-driven transformations to the document.Javascript-238 in Useful JavaScript and jQuery Tools, Libraries, PluginsTempo: JSON rendering engine

Tempo

is a tiny JSON rendering engine that enables you to craft data

templates in pure HTML. It not only makes AJAX content easier to work

with but also manages clear separations of concerns, i.e. no HTML in

your JavaScript files![Js-002 in Useful JavaScript and jQuery Tools, Libraries, Plugins](http://media.smashingmagazine.com/cdn_smash/wp-content/uploads/2011/04/js-002.jpg)Art Deco – Selectable Text

A

quick proof-of-concept of split typography, based on Pierre

Fix-Masseau’s Art Deco style. The challenge here was to achieve ‘split

letters’ as part of a Web page layout, while retaining the ability to

select text.Javascript-153 in Useful JavaScript and jQuery Tools, Libraries, PluginsUsing Less.js to Simplify Your CSS3

LESS is an amazing little tool that extends CSS with the addition of variables, mixins, operations and nested rules.Javascript-175 in Useful JavaScript and jQuery Tools, Libraries, PluginsPhantomJS: Headless WebKit with JavaScript API

PhantomJS

is a headless WebKit with JavaScript API. It has fast and native

support for various web standards: DOM handling, CSS selector, JSON,

Canvas, and SVG.原文地址:

http://www.smashingmagazine.com/2011/04/07/useful-javascript-and-jquery-tools-libraries-plugins/

Apr 8, 2011

ubuntu把nginx添加到启动项中

  • Linux
  • nginx
  • rails
  • vps
  • chkconfig

网站用nginx在跑,网站经常疑似被挂掉,只因没钱买了个便宜的VPS,米国滴,经常被重启,为毛?米国也有G党?有木有?有木有?太坑爹了!

解决办法是把nginx添加到启动项中去,在 /etc/init.d/ 目录下添加 nginx 文件:

root@ubuntu: /etc/init.d/# vim nginx#! /bin/sh

chkconfig: - 58 74

description: nginx is the Nginx daemon.

Description: Startup script for nginx webserver on Debian. Place in /etc/init.d and

run ‘sudo update-rc.d nginx defaults’, or use the appropriate command on your

distro.

#

Author: Ryan Norbauer

Modified: Geoffrey Grosenbach http://topfunky.com

Modified: David Krmpotic http://davidhq.com

set -e

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

DESC=”nginx daemon”

NAME=nginx

DAEMON=/usr/local/nginx/sbin/$NAME

CONFIGFILE=/usr/local/nginx/conf/nginx.conf

PIDFILE=/usr/local/nginx/logs/$NAME.pid

SCRIPTNAME=/etc/init.d/$NAME

Gracefully exit if the package has been removed.

test -x $DAEMON   exit 0

d_start() {

$DAEMON -c $CONFIGFILE   echo -en “\n already running”

}

d_stop() {

kill -QUIT cat $PIDFILE   echo -en “\n not running”

}

d_reload() {

kill -HUP cat $PIDFILE   echo -en “\n can’t reload”

}

case “$1” in

start)

echo -n “Starting $DESC: $NAME”

d_start

echo “.”

;;

stop)

echo -n “Stopping $DESC: $NAME”

d_stop

echo “.”

;;

reload)

echo -n “Reloading $DESC configuration…”

d_reload

echo “.”

;;

restart)

echo -n “Restarting $DESC: $NAME”

d_stop

One second might not be time enough for a daemon to stop,

if this happens, d_start will fail (and dpkg will break if

the package is being upgraded). Change the timeout if needed

be, or change d_stop to have start-stop-daemon use –retry.

Notice that using –retry slows down the shutdown process

somewhat.

sleep 1

d_start

echo “.”

;;

*)

echo “Usage: $SCRIPTNAME {start stop restart reload}” >&2

exit 3

;;

esac

exit 0

root@ubuntu: /etc/init.d/# chmod +x nginx

root@ubuntu: /etc/init.d/# update-rc.d nginx defaults

好像到这里就完事了…

查看一下

root@ubuntu: chkconfig –list

nginx                     0:off  1:off  2:on   3:on   4:on   5:on   6:off

相关链接:

https://github.com/lxneng/confs/blob/master/ubuntu/etc/init.d/nginx

https://github.com/lxneng/confs/raw/master/ubuntu/etc/init.d/nginx

http://hi.baidu.com/nivrrex/blog/item/afb98c54a6f7a1143a29353e.html

感谢国家,感谢罗小能

Apr 6, 2011

统计MySQL中某个数据库中有多少张表(转载)

  • MySQL

mysql> SELECT count(*) TABLES, table_schema FROM information_schema.TABLES

where table_schema = ‘db_production’ GROUP BY table_schema;

+——–+——————-+

TABLES table_schema     

+——–+——————-+

    169 db_production

+——–+——————-+

原文:http://blog.lxneng.com/?p=37