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
| #!st_test_env/bin/python | |
| from stalker import db | |
| db.setup() | |
| db.init() | |
| import datetime | |
| from stalker import Studio | |
| my_studio = Studio( |
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
| from bottle import route, run | |
| @route('/') | |
| def index(): | |
| '''test me''' | |
| return '<h1>Hello Bottle!</h1>' | |
| run(host='localhost', port=8080, server='gunicorn', | |
| reload=True, workers=4, debug=True) |
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
| ffmpeg -i movie.mkv -r 30 -strict -2 -async 1 -acodec aac -ac 2 -ab 160k -threads 0 -preset slower -profile:v high -level 4.1 -f mp4 -refs 4 ipadVideo.mp4 |
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 nltk | |
| import sys | |
| import string | |
| import re | |
| text = open('test.txt').read() | |
| text = ' '.join(re.findall('[%s]+' % string.ascii_letters, text)) | |
| # Used when tokenizing words | |
| sentence_re = r'''(?x) # set flag to allow verbose regexps | |
| ([A-Z])(\.[A-Z])+\.? # abbreviations, e.g. U.S.A. |
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 sys | |
| import maya.OpenMaya as OpenMaya | |
| import maya.OpenMayaMPx as OpenMayaMPx | |
| kPluginCmdName = "spHelloWorld" | |
| # Command | |
| class scriptedCommand(OpenMayaMPx.MPxCommand): | |
| def __init__(self): | |
| OpenMayaMPx.MPxCommand.__init__(self) |
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 maya.OpenMayaMPx as OpenMayaMPx | |
| import maya.OpenMaya as OpenMaya | |
| class MeasureNode(OpenMayaMPx.MPxNode): | |
| kPluginNodeId = OpenMaya.MTypeId(0x00000120) | |
| pos1 = OpenMaya.MObject() | |
| pos2 = OpenMaya.MObject() | |
| midpoint = OpenMaya.MObject() |
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
| # | |
| # Recommended minimum configuration: | |
| # | |
| acl manager proto cache_object | |
| acl localhost src 192.168.2.0/24 | |
| acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1 | |
| # Example rule allowing access from your local networks. | |
| # Adapt to list your (internal) IP networks from where browsing | |
| # should be allowed |
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
| """ This programme implements a polyalphabetic cipher. """ | |
| import string | |
| ALPHABET = string.ascii_lowercase | |
| CHARACTERS_THAT_MUST_REMAIN_THE_SAME = string.digits + string.punctuation + string.whitespace | |
| def cycle_get(lst,index): | |
| """ |
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
| sudo yum -y update | |
| sudo yum -y groupinstall "Development Tools" | |
| sudo yum -y install git libcurl-devel libcurl | |
| # jansson C json library | |
| sudo yum -y install jansson | |
| sudo yum -y install jansson-devel | |
| # install cpuminer | |
| git clone --recursive https://github.com/pooler/cpuminer.git |
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 socket, struct, fcntl | |
| sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
| sockfd = sock.fileno() | |
| SIOCGIFADDR = 0x8915 | |
| def get_ip(iface = 'eth0'): | |
| ifreq = struct.pack('16sH14s', iface, socket.AF_INET, '\x00'*14) | |
| try: | |
| res = fcntl.ioctl(sockfd, SIOCGIFADDR, ifreq) | |
| except: |