Posts

Showing posts from December, 2012

[Level 2] Python abstract method testing

#!/bin/env python import os, sys from abc import * # ================================================= class ToolCmd(object): __metaclass__ = ABCMeta def __init__(self): pass @abstractmethod def doLocalAction(self): pass class DoAction(ToolCmd): def __init__(self): pass def doLocalAction(self): print 'doLocalAction()' # ================================================= class Test1(DoAction, ToolCmd): def __init__(self): pass class Test2(ToolCmd): def __init__(self): pass #class Test3(ToolCmd, DoAction): # def __init__(self): # pass # ================================================= t1 = Test1() t1.doLocalAction() t2 = Test2() t2.doLocalAction() #t3 = Test3() #t3.doLocalAction() # ================================================= Test Run: (Run-time error) $ ./c.py doLocalAction() Traceback (most recent call last): File "./c.py", line 42, in t2 =...

[Level 2] Scan wifi channel in Ubuntu.

#!/bin/bash iwlist wlan0 scanning | grep Channel: | grep -v grep | cut -d: -f2 | sort Wish this helps. regards, Stanley Huang

[Level 1] How to mount exFAT filesystem in Ubuntu 10.04

You could install fuse-exfat to mount exFAT file system. e.g. $ sudo add-apt-repository ppa:relan/exfat $ sudo apt-get update $ sudo apt-get -y install fuse fuse-exfat exfat-utils Wish this helps. regards, Stanley Huang

[Level 1] Install Everpad (Evernote) on Ubuntu.

If you want to use evernote on Ubuntu, you could try everpad. $ sudo add-apt-repository ppa:nvbn-rm/ppa $ sudo apt-get update && sudo apt-get install everpad Wish this helps. regards, Stanley Huang