Skip to content

Instantly share code, notes, and snippets.

@luw2007
luw2007 / upgrade_VirtualBox_modules.md
Created January 29, 2013 06:34
fedora 18 更新内核后, 重新VirtualBox 模块

更新fc18 内核后, 启动VirtualBox 报错, 需要重新编译VirtualBox 的模块. 但是最近VirtualBox 更新编译方法, 以前都是执行sudo /etc/init.d/vboxdrv setup .

按照提示执行, 报错如下:

○ → sudo /etc/sysconfig/modules/VirtualBox.modules
[sudo] password for lw:
ERROR: Module vboxdrv not found.
ERROR: Module vboxnetflt not found.
ERROR: Module vboxnetadp not found
@luw2007
luw2007 / xi_an_tour.md
Created January 29, 2013 09:00
西安旅游攻略脑图
@luw2007
luw2007 / kindle_touch_update_5.3.2.md
Last active December 11, 2015 21:29
刷kindle touch 5.3.2 遇到问题

今天刚知道 kindle touch 最近出了5.3.2的升级包。 下载到kindle 根目录无法升级。KT 5.3.2和多看兼容情况看完才知道由于早些时候装了大量kindle touch的扩展,导致无法升级。 万幸开发组给出了5.3.2的镜像。

###遇到的问题: 1.直接刷5.3.2的工程模式包(mmcblk0p2), 出现ssh无法连接。

现象是ssh连接的时候,显示端口没有打开 。但是可以ping 192.168.15.244 。原因未知(个人猜测是装了usb net 之类的东西,导致端口无法正常开启)。 解决方案,刷其他的工程模式包 ,我找的是http://www.mobileread.com/forums/showthread.php?t=170929 中给出的kt_5.0.1-mmcblk0p2_diags+ssh.img.gz。刷完之后, 可以正常连接ssh。

2.刷到5.3.2之后一直不知道怎么安装多看。 也没有人提到过。

@luw2007
luw2007 / phone_spam_messages.md
Last active December 11, 2015 22:39
长期受到各种短信骚扰, 实在不能忍了。 必须干掉它们。

移动

  • 掌上精彩:

    发“qxzsjc" 到10086

    回复短信, 表示取消成功。

  • 移动-139邮箱:

@luw2007
luw2007 / split_str.py
Created January 31, 2013 15:17
比如我有一个列表(字符串) l1 = "abcdef",然后有对应的另一个列表l2 = [1, 2, 1, 1, 2, 2] 两个列表是对应的,现在我要更加列表l2的叠加值分段返回l1,如果设定l2列表叠加的值>=3为一段 返回 ["ab", "cde", "f"] 这样
def split_(l1, l2):
out = []
w = i = 0
for j, item in enumerate(l2, 1):
w += item
if w >= 3:
out.append(l1[i:j])
w, i = 0, j
if i != j:
out.append(l1[i:])
景区景点名称 门票价格
旺季 淡季
阿房宫遗址 50  
西安半坡遗址博物馆 65 45
宝鸡嘉陵江源头景区 40  
宝鸡市陈仓区钓鱼台 35  
宝塔山 65  
碑林博物馆 80 50
def checkio(n):
'return roman numeral using the specified integer value from range 1...3999'
if 1 <= n <= 3999:
return ''.join(to_roman(n))
def to_roman(num):
roman = [["","I","II","III","IV","V","VI","VII","VIII","IX"],
@luw2007
luw2007 / ikandou_books_orderby_download.txt
Created February 27, 2013 02:00
ikandou 目前下载次数排名
60261 PHP经典实例
28526 史蒂夫·乔布斯传
27804 拖延心理学
26647 明朝那些事儿(1-9)
22816 Steve Jobs
22395 百年孤独
21999 金庸全集三联版
21238 中国历代政治得失
20224 不二
19241 三体
@luw2007
luw2007 / dig_ikandou.py
Created February 27, 2013 07:25
用来抓取 ikandou.com 网站中的书籍信息的脚本 需要安装 mongodb 数据库. - pymongo 用于存储数据库 - requests 方便的读取页面 - pyquery 使用jquery 的语法来控制网页和xml, 其基于lxml - lxml
#!/usr/bin/env python2
#-*- coding:utf-8 -*-
"""
用来抓取 ikandou.com 网站信息的脚本
需要安装 mongodb 数据库.
- pymongo 用于存储数据库
- requests 方便的读取页面
- pyquery 使用jquery 的语法来控制网页和xml, 其基于lxml
- lxml
@luw2007
luw2007 / cms_dotnet.md
Created March 4, 2013 07:15
.net cms pickup

#.NET

http://stackoverflow.com/questions/954764/good-net-based-cms http://space.itpub.net/82080/viewspace-626939 http://www.hualay.net/blog/Bloger-Wikipedia/106/106.html

##Orchard Orchard is a free, open source, community-focused project aimed at delivering applications and reusable components on the ASP.NET platform. It will create shared components for building ASP.NET applications and extensions, and specific applications that leverage these components to meet the needs of end-users, scripters, and developers. Additionally, we seek to create partnerships with existing application authors to help them achieve their goals. Orchard is delivered as part of the ASP.NET Open Source Gallery under the Outercurve Foundation. It is licensed under a New BSD license, which is approved by the OSI. The intended output of the Orchard project is three-fold:

Individual .NET-based applications that appeal to end-users , scripters, and developers