Skip to content

Instantly share code, notes, and snippets.

View djosix's full-sized avatar
🐑
In a relationsheep

Yuan-Kui Li djosix

🐑
In a relationsheep
View GitHub Profile
@djosix
djosix / ANSI.md
Created February 7, 2023 11:26 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@djosix
djosix / qe.py
Last active June 25, 2021 10:01
Python directory-based command queue executor
import os
import json
import re
import glob
import time
import traceback
import functools
import subprocess as sp
from datetime import datetime
from threading import Thread, Event
  1. vim ~/.zshrc, add history-substring-search to the plugin array.

     66 # Which plugins would you like to load?
     67 # Standard plugins can be found in ~/.oh-my-zsh/plugins/*
     68 # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
     69 # Example format: plugins=(rails git textmate ruby lighthouse)
     70 # Add wisely, as too many plugins slow down shell startup.
     71 plugins=(zsh-autosuggestions zsh-completions history-substring-search)
    

Streaming with SOX

  • FILE audio file I/O
  • -d default audio device I/O
  • -p pipe: standard I/O

The simplest sox command format

sox INPUT_FILE OUTPUT_FILE
@djosix
djosix / ipydbg.py
Last active June 18, 2021 17:39
Pop IPython embed shell when any exception is raised (before ei)
import sys
import inspect
import traceback
import importlib
import readline
import contextlib
__all__ = [
'probe',
@djosix
djosix / dnsbin_leaker.py
Created July 3, 2020 03:58
Leak data using DNSBin
#!/usr/bin/env python3
import socket, os
class DNSBinLeaker:
def __init__(self, dnsbin_id, leak_id='leak'):
assert len(dnsbin_id) == 20
assert all(c in '0123456789abcdef' for c in dnsbin_id)
assert 0 < len(leak_id) < 20 and leak_id.isalnum()
// ==UserScript==
// @name JAV101 Likes Ratio
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://v.jav101.com/*
// @grant none
// ==/UserScript==
import requests, re, random
sess = requests.Session()
def test(answers, time_fn):
assert len(answers) == 35
res = sess.get('https://test.mensa.no')
m = re.search(r'authorizationToken = (.+);', res.text)
import numpy as np
import random
import os
import time
data = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0,
0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0,
0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 3, 0, 0, 0,
0, 3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 3, 0, 0, 0, 0,
import functools
import asyncio
import boto3
class AsyncBoto3Client:
def __init__(self, *args, **kwargs):
client = boto3.client(*args, **kwargs)
self.__client = client
for name in dir(client):