This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import os, struct | |
DIR = os.path.join(os.environ['HOME'], ".purple/telegram-purple") | |
def cprint(color, s): | |
print("\x1b[" + str(color) + "m" + s + "\x1b[0m", end="") | |
def pkeyvalue(key, value): | |
cprint(33, key) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt remove $(cat /var/log/apt/history.log |grep '^Install'|tail -n 1|sed 's/([^)]\+),\?//g'|sed 's/^Install://') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import random | |
from PIL import Image, ImageDraw | |
img = Image.open(sys.argv[1]) | |
img = img.convert(mode='YCbCr') | |
width = img.width | |
data = img.getdata() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'lifecell_api' | |
# require 'pp' | |
begin | |
life = Lifecell::API.new(msisdn: '380x3xxxxxxx', password: 'xxxxxx') | |
life.sign_in | |
# PP.pp life.balances | |
balance = life.balances['balance'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
resolution=$(identify -format "%wx%h" "$1[0]") | |
IFS=x read -r -a resolution_array <<< $resolution | |
width=${resolution_array[0]} | |
height=${resolution_array[1]} | |
WIDTH_FACTOR=15 | |
HEIGHT_FACTOR=15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Spies on me | |
[Service] | |
ExecStart=/data/progs/shell/analprobe.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# parameters: input, output | |
# make a 256-colors palette first | |
palettefull=$( mktemp --suffix=.png ) | |
ffmpeg -i "$1" -vf 'palettegen' -y "$palettefull" | |
# quantize the palette (palettegen's builting limiter | |
# tries to preserve too much similar shades) | |
palettequant=$( mktemp --suffix=.png ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from email.header import decode_header, HeaderParseError | |
import os | |
import re | |
import itertools | |
from pprint import pprint | |
encodings = ( 'UTF-8', 'utf-8', 'koi8-r', 'KOI8-R' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!ARBfp1.0 | |
TEMP output; | |
TEMP input; | |
TEMP bright; | |
TEMP dark; | |
TEX input, fragment.texcoord[0], texture[0], RECT; | |
MUL dark.rgb, input, 5; | |
MUL bright.rgb, input, 0.55; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ported to Python, thanks to KillTheCat | |
import subprocess | |
def get_installed_size(block: str) -> int: | |
def size_in_byte(data: list) -> int: | |
if len(data) != 2: | |
return 0 | |
inc = 1 |
NewerOlder