This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Installing OpenCV python libs on mac to work with virtualenv | |
| # OpenCV 2.4.3 | |
| # Python 2.7.3 installed with brew | |
| # assuming you have virtualenv, pip, and python installed via brew | |
| # assuming $WORKON_HOME is set to something like ~/.virtualenvs | |
| # using homebrew - make sure we're current | |
| brew update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Configure eth0 | |
| # | |
| # vi /etc/sysconfig/network-scripts/ifcfg-eth0 | |
| DEVICE="eth0" | |
| NM_CONTROLLED="yes" | |
| ONBOOT=yes | |
| HWADDR=A4:BA:DB:37:F1:04 | |
| TYPE=Ethernet | |
| BOOTPROTO=static |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import argparse | |
| class DefaultListAction(argparse.Action): | |
| CHOICES = ['file', 'folder'] | |
| def __call__(self, parser, namespace, values, option_string=None): | |
| if values: | |
| for value in values: | |
| if value not in self.CHOICES: | |
| message = ("invalid choice: {0!r} (choose from {1})" | |
| .format(value, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for root, dirnames, filenames in os.walk(some_directory): | |
| for filename in fnmatch.filter(filenames, '*.pdf'): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| filename = filenye[filenye.rfind("/") + 1:].replace(".pdf", "") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cPickle | |
| f = open(some_file, "w") | |
| f.write(cPickle.dumps(binary)) | |
| f.close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| brew install imagemagick --with-ghostscript |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| vlc —no-video-title-show —fullscreen —repeat videonya | |
| vlc --mouse-hide-timeout=1 --qt-minimal-view --video-on-top --no-video-title-show --fullscreen --repeat videonya |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ##Virtualbox change VDI | |
| VBoxManage internalcommands sethduuid [new vdi] | |
| ##Virtualbox change from size changeable to fixed | |
| VBoxManage clonehd vdia.vdi vdib.vdi --variant Fixed | |
| ##Virtualbox change size | |
| VBoxManage modifyhd CentOs.vdi --resize 10000000 (on Mega) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| __author__ = 'phe' | |
| A = -72 | |
| n = 4 | |
| ''' | |
| RSSI = -(10*n*log10(d) + A) | |
| A is the RSSI value at a reference distance | |
| ''' | |
| distance = pow(10.0, ((A + 71)/(10.0*n))) | |
| print distance; |
OlderNewer