Skip to content

Instantly share code, notes, and snippets.

View gtors's full-sized avatar

Andrey Torsunov gtors

  • Russian Federation, Kazan
View GitHub Profile
@igrr
igrr / esp.ksy
Created November 25, 2021 20:19
Kaitai Struct description of ESP binary image format (starting from ESP32)
# Try it out by opening https://ide.kaitai.io/ and copying this file there
# Based on an article by @angelcarve about ESP8266 binary image parsing with Kaitai Struct:
# https://carvesystems.com/news/parsing-binaries-with-kaitai-struct/
meta:
id: esp
file-extension: bin
endian: le
seq:
@qoomon
qoomon / conventional_commit_messages_cheatsheet.md
Last active June 10, 2024 16:35
Conventional Commit Messages - Cheatsheet

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@eybisi
eybisi / get_payload.py
Created December 12, 2018 16:18
get decrypted payload from all apk files
#get apks from server? wget -np -e robots=off -m site.com/apk/folder/
#Place all apks in the same dir as py file or change os.listdir parameter
#you can get del.js from my repo https://github.com/eybisi/fridaScripts/blob/master/del.js
import os
from androguard.core.bytecodes import apk
import frida
import time
device = frida.get_usb_device()
files = [f for f in os.listdir("./")]
for f in files:
@sanchezzzhak
sanchezzzhak / clickhouse-get-tables-size.sql
Created January 18, 2018 13:43
clickhouse get tables size
SELECT table,
formatReadableSize(sum(bytes)) as size,
min(min_date) as min_date,
max(max_date) as max_date
FROM system.parts
WHERE active
GROUP BY table

Sony Bravia HTTP API

The sony bravia has a HTTP API interacted with using a Pre-Shared key. There's a more complex auth flow but I've not described it here.

There wasn't any documentation, so I've written some. If you're a TV integrator don't read this, you'll laugh. I'm probably just getting confused by UPnP.

Disclaimer: I've only tested this on my TV, which is a KDL-50W829B. Your TV might not have all of the services; see Available services section for how to discover what your TV supports.

@patrickgill
patrickgill / m3u8download.sh
Last active March 28, 2024 17:50
download m3u8 ts segments, then decode, join, and remux them! (HTTP Live Streaming TS files)
# download
aria2c -x 5 -i file.m3u8
# decode (example)
openssl aes-128-cbc -d -K 15D0F46608409DA364E3F5D92BDE9F61 -iv 00000000000000000000000000000000 -nosalt -in G00000000.ts -out G00000000.d.ts
# join all ts files
cat *.ts > out.ts
# convert ts output file
@peterhurford
peterhurford / pytest-fixture-modularization.md
Created July 28, 2016 15:48
How to modularize your py.test fixtures

Using py.test is great and the support for test fixtures is pretty awesome. However, in order to share your fixtures across your entire module, py.test suggests you define all your fixtures within one single conftest.py file. This is impractical if you have a large quantity of fixtures -- for better organization and readibility, you would much rather define your fixtures across multiple, well-named files. But how do you do that? ...No one on the internet seemed to know.

Turns out, however, you can define fixtures in individual files like this:

tests/fixtures/add.py

import pytest

@pytest.fixture
@mpujari
mpujari / Groovy, Grails
Last active August 6, 2020 03:56
Usefull links to Groovy and Grails internals
Grails Help
http://grails.asia/grails-tutorial-for-beginners-setup-your-windows-development-environment/
Decompiling Groovy
http://michael.laffargue.fr/blog/2013/11/02/decompiling-groovy-made-classes/
InvokeDynamic
http://mydailyjava.blogspot.in/2015/03/dismantling-invokedynamic.html
https://docs.oracle.com/javase/8/docs/technotes/guides/vm/multiple-language-support.html
http://niklasschlimm.blogspot.in/2012/02/java-7-complete-invokedynamic-example.html
@gtors
gtors / !tips
Last active October 28, 2022 15:53
Tips
dummy
@DasIch
DasIch / example.py
Created May 12, 2013 06:20
__prepare__ for Python 2.x
from __future__ import print_function
from collections import OrderedDict
from prepareable import Prepareable
from six import with_metaclass, iteritems
class FooMeta(with_metaclass(Prepareable, type)):
def __new__(cls, name, bases, attributes):