Summary | How to control (or Understand) your GIST page's files list order. |
Notice | not official documentation. |
# -*- coding: utf-8 -*- | |
#test on python 3.4 ,python of lower version has different module organization. | |
import http.server | |
from http.server import HTTPServer, BaseHTTPRequestHandler | |
import socketserver | |
PORT = 8080 | |
Handler = http.server.SimpleHTTPRequestHandler |
#!/usr/bin/python | |
import fcntl | |
import os | |
import struct | |
import array | |
import sys | |
BLKGETSIZE=0x1260 | |
BLKGETSIZE64=0x80081272 | |
BLKSSZGET=0x1268 |
socat Examples | |
=============== | |
* 注意 | |
- SYSTEM で : を使う時は必ずエスケープすること | |
* 相手に接続 | |
# telnet, netcat, socat それぞれの場合 | |
$ socat - TCP:127.0.0.1:8000 |
Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).
The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int
# -*- Mode: python; tab-width: 4; indent-tabs-mode: nil; coding: utf-8; -*- | |
from ctypes import * | |
user32 = WinDLL('User32') | |
DISPLAY_ON = -1 | |
DISPLAY_OFF = 2 | |
HWND_BROADCAST = 0xffff | |
WM_SYSCOMMAND = 0x0112 | |
SC_MONITORPOWER = 0xf170 |
bool | |
create_process_as_login_user( | |
_In_ const wchar_t* cmdline | |
) | |
{ | |
_ASSERTE(NULL != cmdline); | |
if (NULL == cmdline) return false; | |
DWORD session_id = WTSGetActiveConsoleSessionId(); | |
DWORD explorer_pid = 0xFFFFFFFF; |
How to make an application icon for macOS using
iconset
&iconutil
import asyncio | |
import os | |
from aiohttp import web | |
from aiohttp import streamer | |
@streamer | |
async def file_sender(writer, file_path=None): | |
""" |
uname -r | |
sudo su | |
# useradd builder | |
# groupadd builder | |
cd /home/centos | |
# Get Source Code | |
wget http://vault.centos.org/7.2.1511/updates/Source/SPackages/kernel-3.10.0-327.28.3.el7.src.rpm | |
rpm -ivh kernel-3.10.0-327.28.3.el7.src.rpm | |
# Build Preparation |