Skip to content

Instantly share code, notes, and snippets.

View Kylmakalle's full-sized avatar

Sergey Akentev Kylmakalle

View GitHub Profile
# coding=UTF-8
from __future__ import division
import re
# This is a naive text summarization algorithm
# Created by Shlomi Babluki
# April, 2013
class SummaryTool(object):
@dschep
dschep / raspbian-python3.6.rst
Last active October 24, 2023 14:57 — forked from BMeu/raspbian-python3.5.rst
Installing Python 3.6 on Raspbian

Installing Python 3.6 on Raspbian

As of January 2018, Raspbian does not yet include the latest Python release, Python 3.6. This means we will have to build it ourselves, and here is how to do it. There is also an ansible role attached that automates it all for you.

  1. Install the required build-tools (some might already be installed on your system).
@gurland
gurland / main.py
Last active December 7, 2023 11:08
How to delete all your messages from chat in telegram? Easy, just use this program
# Copyright (c) 2017 Stanislav Bobokalo & Alexey Borontov
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
@stek29
stek29 / 0readme.md
Last active April 11, 2022 17:59
proof of concept
git clone https://github.com/grishka/libtgvoip.git
cd libtgvoip
# Build openssl-1.0.1 and opus-1.1 to prefix libraries/
# Save CMakeLists.txt here (in repo root)
mkdir build
cd build
# Save CallMakefile and main.cpp here
template<typename T> // описываем типы шаблонной функции
void binary_form(T TYPE) {
int z;
for (char j = sizeof(T) * 8 - 1; j >= 0; j--) {
z = ((T)1) << j;
std::cout << ((TYPE & z) != 0) ? 1 : 0; // тернарный оператор ?:. Если условие до знака вопроса истинно,
// то возвращает то, что между вопросом и двоеточием, если не истинно, то возвращает то, что после двоеточия и до конца операции
}
}
@stek29
stek29 / langpacker.py
Last active March 9, 2021 12:14
Get TG langpack with Telethon
from telethon.tl.functions import InitConnectionRequest, InvokeWithLayerRequest
from telethon.tl.functions import langpack # GetLangPackRequest, GetDifference
from telethon.tl import all_tlobjects # for LAYER
from telethon.tl.types import LangPackString, LangPackStringPluralized, LangPackStringDeleted
from telethon.tl.functions import InitConnectionRequest, InvokeWithLayerRequest
from telethon.tl.functions import langpack # GetLangPackRequest, GetDifference
from telethon.tl import all_tlobjects
from telethon.tl.types import LangPackString, LangPackStringPluralized, LangPackStringDeleted
@beefon
beefon / README.md
Last active March 17, 2023 07:48 — forked from tombigel/README.md
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.14)

Have a look at load.sh file below, it contains all necessary commands to automate the process of changing system limits.

This guide has been tested on macOS High Sierra and Mojave. If you'd like to learn a theory, please continue reading.

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

_The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine

@vlakam
vlakam / m3u.js
Last active September 25, 2018 16:21
m3u downloader and id3tag fixer
const m3u = require('m3ujs');
const {promisify} = require('util');
const sanitize = require("sanitize-filename");
const fetch = require('node-fetch');
const ID3Writer = require('browser-id3-writer');
const fs = require('fs');
const path = require("path");
const readFileAsync = promisify(fs.readFile);
const writeFileAsync = promisify(fs.writeFile);
const jsmediatags = require("jsmediatags");
@DrPsychick
DrPsychick / macOS-remote-environment.md
Last active May 9, 2024 18:36
macOS / OSX ansible path test

INFO

  • remote SSH shell on macOS does not use /etc/paths
  • this is not an issue of ansible, it is the way macOS processes config files on remote shells:
  • see ssh localhost echo \$PATH

ANSIBLE executes remote shell /bin/sh

  • ...if not specified otherwise and macOS does not read any startup files
  • example: [...]localhost '/bin/sh -c '"'"'sudo -H -S -n -u test /bin/sh -c '"'"'"'"'"[...]
  • even /bin/bash does not read any startup files by default
FROM arm64v8/ubuntu
RUN apt-get update
ARG LUA_VERSION=5.1
RUN apt-get update && \
apt-get -y upgrade && \
apt-get -y install libreadline-dev libssl-dev lua5.1 liblua5.1-dev git make unzip redis-server curl libcurl4-gnutls-dev wget && \
wget http://luarocks.org/releases/luarocks-2.2.2.tar.gz && \
tar zxpf luarocks-2.2.2.tar.gz && \
cd luarocks-2.2.2 && \
sh ./configure --lua-version=${LUA_VERSION} && \