Standard escape codes are prefixed with Escape:
- Ctrl-Key:
^[ - Octal:
\033 - Unicode:
\u001b - Hexadecimal:
\x1B - Decimal:
27
| from ctypes import * | |
| # Let's map the Microsoft types to ctypes for clarity | |
| BYTE = c_ubyte | |
| WORD = c_ushort | |
| DWORD = c_ulong | |
| DWORD64 = c_ulonglong | |
| LPBYTE = POINTER(c_ubyte) | |
| LPTSTR = POINTER(c_char) | |
| HANDLE = c_void_p |
| """ | |
| Convert YouTube subtitles(vtt) to human readable text. | |
| Download only subtitles from YouTube with youtube-dl: | |
| youtube-dl --skip-download --convert-subs vtt <video_url> | |
| Note that default subtitle format provided by YouTube is ass, which is hard | |
| to process with simple regex. Luckily youtube-dl can convert ass to vtt, which | |
| is easier to process. |
テスト用に自己証明書を用いてローカルhttpsサーバーを立てるなどの際に、クライアントから危険な接続として扱われないように証明書を設定をする方法について説明する。
通常ホストの真正性を確認するためにはドメイン名を使用するが、環境の都合上ローカルにDNSを立てるのが難しい場合がある。クライアントへの介入が難しい場合は/etc/hostによる書き換えも出来ない。
そこで、x509.v3のsubjectAltName拡張を用いてIPをホスト名の代わりに使用し、任意のIPアドレスに立てたサーバーを真正なものとして扱えるようにする。
| # -*- coding: utf-8 -*- | |
| import re | |
| import sys | |
| def process_file(procnet): | |
| sockets = procnet.split('\n')[1:-1] | |
| return [line.strip() for line in sockets] | |
| def split_every_n(data, n): |
| @echo on | |
| REM checked for Windows 10 | |
| REM fork from https://gist.github.com/theultramage/cbdfdbb733d4a5b7d2669a6255b4b94b | |
| REM you may want full list https://gist.github.com/raspi/203aef3694e34fefebf772c78c37ec2c | |
| REM SET attrib=+ATTRIB_HIDE | |
| SET attrib=-ATTRIB_HIDE | |
| REM Hard disk burst ignore time | |
| powercfg -attributes 0012ee47-9041-4b5d-9b77-535fba8b1442 80e3c60e-bb94-4ad8-bbe0-0d3195efc663 %attrib% |
# yum
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
pycurl: libcurl link-time ssl backend (nss) is different from compile-time ssl backend (openssl)
Please install a package which provides this module, or
verify that the module is installed correctly.| #!/usr/bin/env python3.6 | |
| import asyncio | |
| from contextlib import closing | |
| import aiohttp | |
| import tqdm | |
| async def download(session, url, progress_queue): |
| { | |
| "video": { | |
| "id": "sm13924244", | |
| "title": "【ポポポポーン】あいさつするたび速度落ちるね【シーク禁止】", | |
| "originalTitle": "【ポポポポーン】あいさつするたび速度落ちるね【シーク禁止】", | |
| "description": "ポポポポーン教信者なら余裕だよな? 加速:<a href=\"https:\/\/www.nicovideo.jp\/watch\/sm13924147\" class=\"watch\">sm13924147<\/a> ピッチアップ:<a href=\"https:\/\/www.nicovideo.jp\/watch\/sm13941513\" class=\"watch\">sm13941513<\/a> ピッチダウン:<a href=\"https:\/\/www.nicovideo.jp\/watch\/sm13941810\" class=\"watch\">sm13941810<\/a> あいさつするたび〇〇【<a href=\"https:\/\/www.nicovideo.jp\/mylist\/24558006\" target=\"_blank\" rel=\"noopener\">mylist\/24558006<\/a>】 移動順 加速→ピッチアップ→減速→ピッチダウン→加速(以下ry 無限ループってこわくね?", | |
| "originalDescription": "ポポポポーン教信者なら余裕だよな? 加速:sm13924147 ピッチアップ:sm13941513 ピッチダウン:sm13941810 あいさつするたび〇〇【mylist\/24558006】 移動順 加速→ピッチアップ→減速→ピッチダウン→加速(以下ry 無限ループってこわくね?", | |
| "thumbnailURL": "https:\/\/tn.smilevideo.jp\/smile?i=13924244", | |
| "largeThumbnailURL": null, | |
| "postedDateTime": "2011\/03\/22 02:18:29", |
| 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 |