This file contains 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 win32serviceutil | |
class SampleService(win32serviceutil.ServiceFramework): | |
_svc_name_ = 'SampleService' | |
_svc_display_name_ = 'Sample Service' | |
_svc_description_ = 'This is Sample service.' | |
def SvcDoRun(self): | |
self.run = True | |
while self.run: |
This file contains 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 win32serviceutil | |
import servicemanager | |
import ctypes | |
import socket | |
import select | |
import netifaces | |
import time | |
from contextlib import closing | |
def suspend(hibernate=False): |
This file contains 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
# -*- coding: utf-8 -*- | |
import lxml.html | |
URLFORMAT = 'http://www.discas.net/netdvd/cd/goodsDetail.do?titleID=%010d' | |
# XPathをコンパイルして再利用する | |
find_title = lxml.etree.XPath( | |
'string(//head/meta[@property="og:title"]/@content)') | |
is_available = lxml.etree.XPath( |
This file contains 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
@echo off | |
if "%1" == "" goto x86 | |
if not "%2" == "" goto usage | |
if /i %1 == x86 goto x86 | |
if /i %1 == amd64 goto amd64 | |
if /i %1 == x64 goto amd64 | |
if /i %1 == ia64 goto ia64 | |
if /i %1 == x86_amd64 goto x86_amd64 | |
if /i %1 == x86_ia64 goto x86_ia64 |
This file contains 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 apt-get install zlib1g-dev libedit-dev llvm-3.5-dev | |
LLVM_CONFIG=/usr/bin/llvm-config-3.5 sudo -E pip install llvmlite | |
sudo pip install enum34 funcsigs numbda |
This file contains 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
#include <iostream> | |
#include <fstream> | |
#include <sstream> | |
#include <cstdint> | |
#include <iomanip> | |
#include <experimental/optional> | |
/* | |
* Get Raspberry Pi serial number | |
*/ |