http://wowlegacy.ml/
下载地址:http://pan.baidu.com/s/11l3fi
下载地址:http://pan.baidu.com/s/11l3fi
全新的软件,具有超乎 Chrome Sync 的神级同步配置能力。
请 XP 和 Windows 7 用户在使用前务必下载 .NET Framework 4.0 并进行安装。
ppt.cc/fVjECx ppt.cc/fEnHsx ppt.cc/fRZTnx ppt.cc/fSZ3cx ppt.cc/fLOuCx ppt.cc/fE9Nux ppt.cc/fL5Kyx ppt.cc/fIr1ax ppt.cc/f71Yqx tecmint.com linuxcool.com linux.die.net linux.it.net.cn ostechnix.com unix.com ubuntugeek.com runoob.com man.linuxde.net v.gd/4A2G5b v.gd/VBg0IE v.gd/kVkm7n v.gd/jCKP1G linuxprobe.com linuxtechi.com howtoforge.com linuxstory.org systutorials.com ghacks.net linuxopsys.com v.gd/2P9wTx v.gd/FtfpqE v.gd/eMfHsm v.gd/Ub7mqv v.gd/RReVk0 v.gd/vS3uTI v.gd/4Zxmba v.gd/1BnFph
sudo gem install heroku
It may ask you for your password, so be sure to type that in when
required. Once it’s installed you can go ahead and get the Toto gem (the
actual engine), together with a Ruby server to run it, if you don’t
already have one. I recommend the Thin server.sudo gem install toto thin
After this, we’re ready to get stared. The first thing we need to do
is grab a copy of Dorothy. Dorothy is the generic template for Toto—it
basically has the set of folders and layouts you need together with a
configuration file. Clone a copy of Dorothy using the following command,
changing “myblog” to whatever folder name you want to put your new blog
into:git clone git://github.com/cloudhead/dorothy.git myblog
Note: this creates your blog folder in the directory you’re currently
in (i.e. by default it will be the “Home” location on OS X). Now we
need to set up Heroku for this newly created blog. We’ll navigate to our
new folder and do this using the following commands (again substitute
“myblog” to your blog’s name):cd myblog
heroku create myblog --stack bamboo
The “—stack bamboo” bit specifies a Heroku stack which supports
Varnish, the caching engine Toto uses (newer stacks on Heroku no longer
have it). And that’s it. To deploy and view the new blog just type:git push heroku master
heroku open
You should now see a newly deployed Toto blog running on Heroku. If
you have a custom domain, there is a free module in Heroku that will let
you use it (more info over at Heroku docs) I also recommend using their section on deployment with Git to learn more about it if you’re not familiar with Git—it’s very simple once you learn the basics.yyyy-mm-dd-post-permalink.txt
So if you’re publishing a post on 7th May 2010 called “Blog Updates”, you’ll name the file like: 2010-05-07-blog-updates.txttitle: "Blog Updates And News"
slug: blog-updates
Then right below this, leave an empty line and start writing the post. Toto uses Markdown
for formatting. If you’ve never used it before, check out the site,
it’s a very easy way to format your content without writing any HTML. If
you do want to use HTML, no problem, you can do that too.git add .
git commit -a -m "written some new articles"
git push heroku master
thin start
This will launch the Thin Ruby server. To see the site running on
your machine, open a browser and navigate to: “http://localhost:3000”<%= yield %>
This is where all the posts or the page content goes—i.e. it will
replace “yield” when you load the page. All the other code around
“yield” will show up on every page, so this is where you’ll add your
navigation, header, footer and so on.<meta name="description"
content="<%= @context[:description] || 'Default description' %>" />
“Default description” will be used unless a bit of meta info called
‘description’ is provided in the post text file. When you want to use a
custom description just add this to the top of the post file:title: "Some Interesting Post"
date: 2010/05/07
description: "Custom description goes here..."
<title>
<% if @path == 'index' %>
Your Blog Name
<% elsif @path.split('/').compact.length == 4 %>
<%= title %> - Your Blog Name
<% else %>
<%= @path.capitalize.gsub(/[-]/, ' ') %> - Your Blog Name
<% end %>
</title>
Basically, “Your Blog Name” on the 3rd line will show up as the title
if you’re on the home page. The 5th line will render the title of the
blog post before the blog name when you’re on a blog post page. Finally,
the 7th line will will show the title as: “About – Your Blog Name” when
you’re on the About page—the @path...
bit will be replaced
with the title of the page you’re on. So edit the three instances of
“Your Blog Name” to whatever you wish. The code here isn’t particularly
clean, but it works well enough.@path
variable. So for example, our navigation code may look something like this:<ul>
<li><a href="/">Home</a></li>
<li><a href="/archive">Archive</a></li>
<li><a href="/books">Books</a></li>
</ul>
The @path
variables gives us the current location we’re at. So if we’re at the books page, @path
will be “books”. The home path is called “index”. We can use this to
set up some simple conditional statements to add an “active” class to
the list items, which we can then target with CSS to add custom
highlighting. The code will look as follows:<ul>
<li <%= ' class="active"' if @path == 'index' %>>
<a href="/">Home</a>
</li>
<li <%= ' class="active"' if @path == 'archive' %>>
<a href="/archive">Archive</a>
</li>
<li <%= ' class="active"' if @path == 'books' %>>
<a href="/books">Books</a>
</li>
</ul>
articles.reverse.each do |article|
We want to limit the output to only a few items…say 10. This way we
won’t fill up Feedburner’s cache. I changed this line to read:articles.reverse[0..10].each do |article|
Now, to use Feedburner you’ll obviously want to place a subscribe
link on your “layout.rhtml” file to point to your Feedburner subscribe
URL. What you’ll also want to do though is add a bit of meta at the top
of the layout file to say that the RSS for this page is located at
Feedburner. Edit “layout.rhtml” and add this line between the
<head> tags:<link rel="alternate" type="application/rss+xml"
title="myblog" href="http://feeds.feedburner.com/myblog" />
Make sure to change the two instances of “myblog” above to whatever
it is your blog is called and your Feedburner URL is. This will make
sure that if someone uses a browser-based RSS reader, they’ll be
redirected to Feedburner for the feed.<% articles.select {|a| a[:date] <= Date.today}[0...10].each do |article| %>
This will show the latest 10 articles on the index page, published
today or earlier, but will not show any articles with a date set in the
future. When that date arrives, they’ll automatically show up.articles.select {|a| a[:date] <= Date.today}.reverse[0...10].each do |article| %>
title: "Rocket Surgery Made Easy"
date: 2010/01/18
category: book
thumbnail: http://img.usabilitypost.com/books/rocketsurgery.png
book_author: Steve Krug
I’ve got a couple more tags in there, but you get the idea. I’m
adding all the extra stuff I need about this type of post here, and I’m
using the “category: book” as the key to sorting these types of posts on
the index pages.<% @articles.select {|a| a[:category] == 'book' }[0...10].each do |article| %>
<a href="<%= article.path %>"><%= article.title %></a>
<img src="<%= article.thumbnail %>" />
by <%= article.book_author %>
etc ...
<% end %>
Basically, you open the loop by selecting just the book posts. You
can then access their special tags by simply calling them out, like
“article.thumbnail” or “article.book_author”. This gives you a lot of
flexibility for setting up custom categories and types of posts on your
blog.<a href="<%= article.path %>#disqus_thread">0 Comments</a>
When you load the page, for a moment you’ll see everything as “0
Comments”. Once Disqus loads though, it will change all the counters to
their proper values, and the link will point to the comments section of
that particular post.set [:setting], [value]
So if you want to set the default blog author, you’d add the following line:set :author, "Dmitry Fadeyev"
Now, if you don’t specify a blog author in the post meta, the default
one will be used. The settings I’ve got for this blog look like this:set :author, "Dmitry Fadeyev"
set :date, lambda {|now| now.strftime("%d %b %Y") }
set :summary, :max => 1000, :delim => /~\n/
set :disqus, 'fadeyev'
set :title, 'Dmitry Fadeyev'
set :url, 'http://fadeyev.net'
Note the “:delim” setting. This sets a delimiter for the post
summary. To use this, I just type “~” at the end of a paragraph in a
post, and add an extra line break afterwards. Everything before the
delimiter becomes part of the post summary shown on the index page
(called with “article.summary”). I’ve also customized the date to look
how I want it. Here’s a list of the Ruby date symbols you can use to format the date.sudo gem install rack-rewrite
If you use Heroku, you’ll need to add the new gem to the “.gems” file
in your blog’s directory. The .gems file will then look something like:builder
rdiscount
toto
rack-rewrite
Finally, add the following code to your “config.ru” file, above the “run toto” line:# Redirect www to non-www
gem 'rack-rewrite', '~> 0.2.1'
require 'rack-rewrite'
if ENV['RACK_ENV'] == 'production'
use Rack::Rewrite do
r301 %r{.*}, 'http://yoursite.com$&', :if => Proc.new {|rack_env|
rack_env['SERVER_NAME'] != 'yoursite.com'
}
end
end
Change the two instances of “yoursite.com” above to your blog’s
domain. You can also do it the other way around, i.e. redirect non-www
requests to www. To do this just add www to the two instances of
“yoursite.com”, making it “www.yoursite.com”.使用时,输入rake new,回车,然后输入文章名称,就会生成文章的模板。然后可以继续编辑。
可以很方便地部署到heroku。
另外还建立了另外一个task:rake publish,会默认提交代码,并push到github和heroku。
from https://github.com/phaibin/MarkdownBlog
(https://github.com/luckypoemster/MarkdownBlog )
-lbforum_env.bat*#启动lbforum运行的虚拟环境及,并为lbforum的manage.py提供快捷方式%mg%,比如初始化数据库%mg%
syncdb
|~sites/#站点配置/模板/静态文件
|
~default/#默认站点 -......
|~src/#django的app目录
| |+account/#account相关app。具体站点通常会对用户中心进行定制,所以该app在实际应用中很可能需要针对实际情况进行修改。
| |+djangohelper/#一些django的辅助函数等,
| |+lbforum/#lbforum的主app,论坛功能都在改app中
| |+lbregistration/#registration app的lbforum扩展,主要去掉邮件地址认证功能
| |+onlineuser/#显示在线用户的app(可复用的django app,可脱离lbforum单独使用)
|
+simpleavatar/#头像功能的app(可复用的django app,可脱离lbforum单独使用,依赖djangohelper) As we are on the way to make NewEdit THE programmer editor I think, that a new unique name will help here much (NewEdit is just cheap...). I suggest to use 'UliPad'. It has the shortcut of UnLImited. It tells it is a plain text editor (Pad). It tells something about the original author (LImodou). But the most important advantage is: Google has no entry for 'UliPad' yet!Wonderful! It seems many people like it.
1
2
|
# 在~/.bash_profile 中增加
export CLICOLOR=1
|
from __future__ import
from __future__ import
”后即可使使用python的未来特性了。python的完整future特性可见 __future__
。python3中所有字符都变成了unicode。在python2中unicode字符在定义时需要在字符前面加 u,但在3中则不需要家u,而且在加u后程序会无法编译通过。为了解决该问题可以 “from future import unicode_literals” ,这样python2中字符的行为将和python3中保持一致,python2中定义普通字符将自动识别为unicode。
1
2
3
4
5
6
7
|
try:#python2
from UserDict import UserDict
#建议按照python3的名字进行import
from UserDict import DictMixin as MutableMapping
except ImportError:#python3
from collections import UserDict
from collections import MutableMapping
|
1
2
3
4
5
|
import sys
if sys.version > '3':
PY3 = True
else:
PY3 = False
|
$ pip install livereloadIf you don't have pip installed, try easy_install:
$ easy_install livereload
<script type="text/javascript" src="http://127.0.0.1:35729/livereload.js"></script>But a browser extension will make your life easier, available extensions:
$ livereload [-p port]your browser will reload, if any file in the working directory changed.
$ livereload -p 8000It will set up a server at port 8000, take a look at http://127.0.0.1:8000. Oh, it can livereload!
#!/usr/bin/env python from livereload.task import Task Task.add('static/style.css') Task.add('*.html')Now livereload will only guard static/style.css and html in your workding directory.
#!/usr/bin/env python from livereload.task import Task from livereload.compiler import lessc Task.add('style.less', lessc('style.less', 'style.css'))And it will compile less css before refreshing the browser now.
[2013-06-19 11:11:07,499 pyinotify ERROR] add_watch: cannot watch somefile WD=-1, Errno=No space left on device (ENOSPC)If so, you need to increase the number of "user watches". You can either do this temporarily by running (as root):
echo 51200 > /proc/sys/fs/inotify/max_user_watchesTo make this change permanent, add the following line to /etc/sysctl.conf and reboot:
fs.inotify.max_user_watches = 51200
[root@www vhosts]# service httpd restartStopping httpd: [ OK ]Starting httpd: Syntax error on line 290 of /etc/httpd/conf/httpd.conf:DocumentRoot must be a directory[FAILED]
[root@www vhosts]# grep denied /var/log/audit/audit.log[root@www vhosts]# ls -Zdrwxr-xr-x root root root:object_r:user_home_t www.mydomain.com
type=AVC msg=audit(1278157850.075:163): avc: denied { search } for pid=10100 comm=”httpd” name=”vhosts” dev=dm-1 ino=4391538 scontext=root:system_r:httpd_t:s0 tcontext=root:object_r:user_home_t:s0 tclass=dir
[root@www vhosts]# cd ..[root@www www]# chcon -R -t httpd_sys_content_t vhosts/
[root@www www]# ls -Z vhosts/drwxr-xr-x root root root:object_r:httpd_sys_content_t www.mydomain.com
OK,访问一下网站,也能正常访问了。[root@www www]# service httpd startStarting httpd: [ OK ]
[liang@iMac: ~]$ telnet localhost 11211但这个结果实在是太简陋了,很不直观。而且有些情况下是无法使用 telnet 连接 memcache 服务器的(比如在外网),这时候如果有一个像 PhpMyAdmin 那样的 Web 程序来管理 memcache 服务器的话,是一件非常方便的事情。
Trying ::1…
Connected to localhost.
Escape character is ‘^]’.
stats
STAT pid 6404
STAT uptime 8865
STAT time 1279025383
STAT version 1.2.8
……
END
define(‘ADMIN_USERNAME’,'admin’); // Admin Username然后把 memcache.php 上传到网站,使用浏览器打开就可以看到 memcache 服务的状态。
define(‘ADMIN_PASSWORD’,'adminpassword’); // Admin Password
define(‘DATE_FORMAT’,'Y/m/d H:i:s’);
define(‘GRAPH_SIZE’,200);
define(‘MAX_ITEM_DUMP’,50);
$MEMCACHE_SERVERS[] = ‘localhost:11211′; // add more as an array
//$MEMCACHE_SERVERS[] = ‘mymemcache-server2:11211′; // add more as an array