Skip to content

Instantly share code, notes, and snippets.

@fnky
fnky / ANSI.md
Last active September 2, 2026 10:29
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@196Ikuchil
196Ikuchil / defines.py
Last active February 18, 2023 10:34
リバースエンジニアリング Pythonによるバイナリ解析技法 3.2 python3.7.0
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
@glasslion
glasslion / vtt2text.py
Last active July 10, 2026 06:13
This script convert youtube subtitle file(vtt) to plain text.
"""
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.
@ykst
ykst / local_ssl.md
Last active August 19, 2024 12:14
LANのIPアドレスに対してSANを適用して真正なSSL証明書を作成する手順

LANのIPアドレスに対してSANを適用して真正なSSL証明書を作成する手順

概要

テスト用に自己証明書を用いてローカルhttpsサーバーを立てるなどの際に、クライアントから危険な接続として扱われないように証明書を設定をする方法について説明する。 通常ホストの真正性を確認するためにはドメイン名を使用するが、環境の都合上ローカルにDNSを立てるのが難しい場合がある。クライアントへの介入が難しい場合は/etc/hostによる書き換えも出来ない。 そこで、x509.v3のsubjectAltName拡張を用いてIPをホスト名の代わりに使用し、任意のIPアドレスに立てたサーバーを真正なものとして扱えるようにする。

手順

  • openssl設定ファイルの指定(任意)
@Reboare
Reboare / linux_net_tcp.py
Last active October 29, 2023 14:29 — forked from sp3c73r2038/linux_net_tcp.py
a toolkit Python script looking into /proc/net/tcp
# -*- 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):
@NominaceTacitus
NominaceTacitus / powercfg-win10-more-settings.cmd
Last active August 3, 2024 19:07 — forked from theultramage/powercfg-win7-all-settings.bat
Show/hide hidden settings in Win10 Power Options
@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%
@ifduyue
ifduyue / -.md
Last active June 27, 2026 14:24
Resolve pycurl: libcurl link-time ssl backend (nss) is different from compile-time ssl backend (openssl)
# 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.
@khardix
khardix / download.py
Created October 6, 2017 11:26
Python AsyncIO/aiohttp downloader with progressbars
#!/usr/bin/env python3.6
import asyncio
from contextlib import closing
import aiohttp
import tqdm
async def download(session, url, progress_queue):
@tor4kichi
tor4kichi / #js-initial-watch-data.json
Last active May 28, 2021 05:13
ニコ動HTML5プレイヤーページの動画内部データJSONの例
{
"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",
@lucashxu
lucashxu / nbd.sh
Created July 31, 2017 14:47
Build Network Block Device Kernel Module On CentOS7
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