Skip to content

Instantly share code, notes, and snippets.

View epilys's full-sized avatar

Manos Pitsidianakis epilys

View GitHub Profile
@epilys
epilys / kodi-cli.py
Last active November 15, 2021 15:55
kodi-cli.py
#!/usr/bin/env python3
"""
kodi cli tool v1
Edit user, password, host and port with the info of the kodi host on your
network. Screenshots are saved in the folder configures in
"Settings/System/Logging/Debug/Screenshot folder"
usage: kodi [-h] [-p] [-q] [-y Y] [-t T] [-s]
@epilys
epilys / build_and_test.sh
Created August 8, 2017 10:47
qemu build and test script
#!/bin/bash
#
# Qemu build and test script
# Check that each commit builds, checks, and passes all qemu-iotests
# usage: git rebase -i --exec build_and_test.sh <starting SHA-1>
ignore_tests="147 162 093"
builddir="bin"
dir=$(git rev-parse --show-toplevel)
@epilys
epilys / gist:ee2b82baa50a1b81f22c58457e703cd9
Created April 18, 2019 15:20
talos principle milton ascii
...',;;:cccccccc:;,..
..,;:cccc::::ccccclloooolc;'.
.',;:::;;;;:loodxk0kkxxkxxdocccc;;'..
.,;;;,,;:coxldKNWWWMMMMWNNWWNNKkdolcccc:,.
.',;;,',;lxo:...dXWMMMMMMMMNkloOXNNNX0koc:coo;.
..,;:;,,,:ldl' .kWMMMWXXNWMMMMXd..':d0XWWN0d:;lkd,
..,;;,,'':loc. lKMMMNl. .c0KNWNK: ..';lx00X0l,cxo,.
..''....'cooc. c0NMMX; .l0XWN0; ,ddx00occl:.
..'.. .':odc. .x0KKKkolcld000xc. .cxxxkkdl:,..
..''.. ;dxolc;' .lxx000kkxx00kc. .;looolllol:'..
@epilys
epilys / _decterm.otf
Last active April 21, 2019 11:08
https://www.masswerk.at/nowgobang/2019/dec-crt-typography Simulate dot stretching in DECTerminalModern.ttf
@epilys
epilys / dump_core.rs
Created March 12, 2020 06:26
easy core dump on panic in rust for debugging
pub fn register_panic_handler() {
let default_panic = std::panic::take_hook();
std::panic::set_hook(Box::new(move |panic_info| {
default_panic(panic_info);
// Don't forget to enable core dumps on your shell with eg `ulimit -c unlimited`
let pid = std::process::id();
eprintln!("dumping core for pid {}", std::process::id());
@epilys
epilys / kern-pairs.tex
Created May 21, 2021 23:29
Generate kerning pairs for a given font with fontspec and polyglossia, text taken from http://www.as8.it/type/basic_kerning_text.html
\documentclass{article}
\usepackage[silent]{fontspec}
\usepackage[verbose=false]{polyglossia}
\setmainlanguage{english}
\setmonofont[Scale=2.5,Ligatures=Required]{JuniusX-Regular.ttf}
\begin{document}
Generate kerning pairs for this font:
%Text from \url{http://www.as8.it/type/basic_kerning_text.html}
\section{BASIC ALPHABET}
\begin{verbatim}
@epilys
epilys / 1-demo_5_3_5_4_5_2_2_3_3_2_2_3_3_3_2.svg
Last active June 10, 2021 16:33
Draw treemap with hatch patterns in vanilla matplotlib + python3. It can be easily modified to use colors instead of hatches.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@epilys
epilys / django_static_scrape.py
Created June 15, 2021 20:26
scrape django pages with support for csrf POST forms and login required views with just python3 standard library
# Login to website using just Python 3 Standard Library
import urllib.parse
import urllib.request
import http.cookiejar
def scraper():
# here goes URL that's found inside form action='.....'
# adjust as needed, can be all kinds of weird stuff
authentication_url = '/admin/login/'
@epilys
epilys / scrcpy-input.py
Last active August 27, 2021 10:48
This tool copies your input to system clipboard and then synchronises it with android's clipboard and pastes it with Alt-v command. Obviously this will overwrite your clipboard contents. Make sure you focus on the text input on the scrcpy window before you attempt to paste. (scroll down for demo pics)
#!/usr/bin/env python3
ABOUT = """This tool copies your input to system clipboard and then synchronises it
with android's clipboard and pastes it with Alt-v command. Obviously this will
overwrite your clipboard contents. Make sure you focus on the text input on the
scrcpy window before you attempt to paste. - epilys 2021-06-21
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
@epilys
epilys / webmention_server.py
Last active October 20, 2024 18:17
webmention_server.py dummy http server for local testing - both receives and sends webmentions (EDIT: development moved to https://github.com/epilys/webmention_server.py )
#
# webmention_server.py
#
# Copyright (C) 2021 - Emmanouil Pitsidianakis
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#