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
| #dependencies: | |
| sudo apt-get install libopencv-dev build-essential checkinstall cmake pkg-config yasm libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils | |
| #install (download source and cd to source): | |
| mkdir release | |
| cd release | |
| cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON .. | |
| #make : | |
| make -j2 |
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; |
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
| 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
| 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
| 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
| 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
| 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
| 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
| ## 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 |