Thursday, March 28, 2013

Ubuntu Apt Error

昨天装wps装毁了...结果apt update就error了,怎么修复呢?
如下:
sudo gedit /var/lib/dpkg/status
Delete the WPS-office block
然后一切似乎就科学了~
sudo apt-get update
sudo apt-get upgrade

Sunday, March 17, 2013

Some Nice Apps on My Galaxy Nexus~

First Recommendatory Series: Google's Apps
Such as Google Map and Google Calendar and so on, are daily application we use, here I want to recommend some wonderful and little software I love very much on my mobile phone.

1.Any.Do <@https://play.google.com/store/apps/details?id=com.anydo&feature=nav_result#?t=W251bGwsMSwyLDNd>
It is a task list, and can sync with Google Task. All my task relied on it to remind me to finish before the deadline. A more wonderful reason for using it is its smooth widget.
2.Good Morning<@https://play.google.com/store/apps/details?id=com.flywheelsoft.goodmorning&feature=search_result#?t=W251bGwsMSwxLDEsImNvbS5mbHl3aGVlbHNvZnQuZ29vZG1vcm5pbmciXQ..>
This is an alarm. The most powerful feature in it is that it can speak the weather and your calendar right out, when you need an alarm to call you up in the morning. Sometimes, you can set a math problem which only be solved can you be able to shutdown the annoying sound, in which case, you must be awake...
3.Battery Widget Reborn<@https://play.google.com/store/apps/details?id=net.hubalek.android.reborn.beta&feature=search_result#?t=W251bGwsMSwxLDEsIm5ldC5odWJhbGVrLmFuZHJvaWQucmVib3JuLmJldGEiXQ..>
The widget gives a nice notification on your status bar which included the battery remaining percentage. And when you slide down the status bar, you can set the information of your battery to display, such as the temperature and the volt or the time left to run out of charge or to get charged of the battery.
4.Power Toggles<@https://play.google.com/store/apps/details?id=com.painless.pc&feature=search_result#?t=W251bGwsMSwxLDEsImNvbS5wYWlubGVzcy5wYyJd>
While I am using the official version of android 4.2.2, so the status bar has no quick power toggles which is very convenient design in CyanogenMod's rom. And this app gives the even TWO lines of the quick toggles displayed in the slided status bar with at most 8 different toggles in each line. A nice additional feature is that it can also display the date or the remaining battery percentage or the version of your android in the status bar.
5.Full Screen Toggle<@Just Google it, since it not supplied in the Google Play>
Do you like the Navigation Bar at the bottom of your phone? For me, I don't. So thanks to this app, I can kill the navigation bar to make the screen look more larger and clean.
6.GN Full Screen Helper<@Just Google it, since it not supplied in the Google Play>
For the feature above, how can you return to previous page or call out the menu of something? Just install this application, and all problem will be thrown out of mind. In this fantastic app, a wonderful animation of the functions that navigation bar has will display when you touch the edge of the side of the screen
7.PGM2<@Just Google it, since it not supplied in the Google Play>
It is a gesture application which can totally free the function of the power button. And it has many other gestures which depends the need of the user herself.

Monday, February 25, 2013

My First Crawler

import urllib2
from pyquery import PyQuery as pq

url = "http://api.jquery.com/category/selectors/"
result = urllib2.urlopen(url).read().decode("utf8")
q = pq(result)
result_of_bookmarks = q('a[rel="bookmark"]')
bookmarks = result_of_bookmarks.map(lambda i, e: pq(e).text())
'''
for item in bookmarks:
    print item.encode('utf8')

'''

result_of_sumaries = q('div[class="entry-summary"]')
sumaries = result_of_sumaries.map(lambda i, e: pq(e).text())
'''
for item in sumaries:
    print item.encode('utf8')
'''
Query = {}
for i in range(len(bookmarks)):
    Query[bookmarks[i]] = sumaries[i]

Sunday, February 24, 2013

Ubuntu Sublime Python Env


1) Change Environment Path
Find the file named "Python.Sublime-build":
{
    "cmd": ["python", "-u", "$file"],
  "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}
Change the Python path to yours in the Environment like:
{
"cmd": ["/home/hiddenghost/pyenv/bin/python", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}

2) Python Project Configuration Example
With the project name --> "*.sublime-project"
{
"folders":
    [
        {
            "path": "/home/hiddenghost/Documents/hiddenghost"
        }
    ],
    "build_systems":
    [
        {
       "name": "Run Tests",
        "env":
        {
        "PYTHONPATH": "/home/hiddenghost/pyenv/bin/python:/home/hiddenghost/pyenv/lib/python2.7/site-packages"
        },
       "working_dir": "/home/hiddenghost/Documents/hiddenghost",
       "cmd": ["/home/hiddenghost/pyenv/bin/python", "$file"],
       "selector": "source.python"
   }
    ]
}


Thursday, March 8, 2012

Funny Tips

1) GNU:是 Stallman 选择用来描述自由软件基金会(Free Software Foundation, FSF)所开发的一个完全类似 Unix 操作系统的项目名称,其实际上是一个递归的缩写—'GNU's Not Unix'...


2) Hurd:对于GNU来说,Richard Stallman选择使用一个成为Mach的微内核,并结合了一组服务器,他称这写服务器为'Hurd'(这一名称由GNU的主要内核成员Thomas Bushnell杜撰而来).其也是一个间接的递归:
               HURD—HIRD of Unix-Replacing Daenons.
               HIRD—HURD of Interfaces Representing Depth.

Sunday, January 22, 2012

iPad OpenVPN

测试相关设备:iPad2 3G(64G) 5.0.1(Cydia)


提示:安装Cydia的补丁的时候,有的时候会出现四分之一屏的不兼容的bug,所以最好提前安装好SBSettings和启动安全模式的手势操作,以免bug.(我第一次就出了这bug!)


1.进入Cydia,下载必要的软件包:OpenSSH,OpenSSL,SBSettings.<PS:对于我的iPad,安装OpenSSH的时候自动关联安装OpenSSL>


2.打开Cydia并且搜索GuizmOVPN,注意安装最新的版本,老的版本会出现不跳出登陆的对话框的情况.


3.重启后运行GuizmVPN,然后在REGISTER里面注册.


4.注册的时候需要先在 http://www.guizmovpn.com/ 里面注册一个账户,然后在iPad中安装 cr-guizmovpn.ipa下载链接( http://dl.dbank.com/c0cibvgjls ),这是算号器,可以生成一个registered界面需要的Serial的号码~...


5.将你服务器的每一个openvpn配置文件压缩到zip中


6.在GuizmVPN中切换到Settings打开Web Server...


7.在你电脑的浏览器里输入Web Server显示的IP地址,将之前压缩好的ZIP文件上传...


8.这时我们回到GuizmOVPN点General 选项,我们就可以看到你的服务器了,选择后链接就可以会跳出对话框,提示输入用户名和密码了,然后链接就可以使用了.

Friday, September 30, 2011

Android OpenVPN

1.在Market当中下载OpenVPN Setting和OpenVPN Installer
2.安装OpenVPN Installer...
        在第一个路径选项中选择 /system/bin
        在第二个路径选项中选择 /system/xbin/bb
         <这里对于我的设备(N1 with MIUI)无效,不知原因>
         解决方法: a>进入手机Emulator...
                           b>将system加读写权限< mount -o remount wr /system >
                           c>cd进入/system/xbin/然后新建bb的文件夹 < mkdir bb >
                           d>手动链接文件:
                                < ln -s /system/bin/ifconfig /system/xbin/bb/ifconfig
                                < ln -s /system/bin/route /system/xbin/bb/route >
3.进入OpenVPN Setting, Menu — Advanced —Path to OpenVPN binary 
                                               将目录改为 /system/bin/opencpn保存返回.
4.在SD卡的根目录创建openvpn的文件夹,并且将自己vpn放入其中.
                                        <文件夹中的.opvn文件也可以辨析>
5.再次打开OpenVPN Setting的时候,其中就有链接openvpn的开关了...

祝使用愉快...