Skip to content

Instantly share code, notes, and snippets.

View alexey-sveshnikov's full-sized avatar

Alexey Sveshnikov alexey-sveshnikov

View GitHub Profile
A9mimmX7S7UDAAAAAgADAMMyW0sAO8KBCF1/0msG1GMaOkiy77+oJO79qDLx6hzKAwAAAD4AAABP
MCgkTEnm5xLj7Uvn3MEEov6A7nDfPsYUNfBNZdTarWbi+7BU0kVZ03yLUZ7LLEZGkYJjE7IGzENj
R/OdpYH6UMMAALxyBU88BxPEhu0f3bX1dTlaKUaef/xA8bGyzt80YbeY0rkoaeZlY6FBTMYAEEZD
1Aoywien3+xMD8/vo8bi7OkWcL6IkpjL3+x3EPwyeT/VZOQJo7Q3I1S1ioKG13zaAYGYj9qtb9br
rgyWjCIC9DXIoQtUtBVgb3omiDmEC2/UoKDRDdqwgeebrZG28am3mQv+843ONIOjdjtDF86ioh8+
cIvxoHktoRa07hfavtqkqa2M2Dhaak1fb5M6qxaan3PeaTWaebO4oxi+mdyseO9M83NYjGpuaEzK
M83L/iwEbrnTh+oDbr2JavZuc7qsy9YuSCzy01lpJ8LNL/8a6Yv5fjYR2So1npB/7q5P4RuUeIXS
MnxFqUU6qbZ0wMcu2eGuzkhr6ZScgSuvoIdQ+YsD8tURnF4/xq0ZcxwXLiGXMPZqROfU/S5Wfhkq
xdpUpBVBSa+tcAT6kY/EUc06ULeEML4zv8oDSQPnOkYDP6PPEDFY3rs8PsnlpquMTBcic8MCAsHd
LNOf/V+YZqJOdK56VBellSqVDnq4fgCqjLa0rm58bNYJ5nbp18mIf+BD0zzN/gC6oB/oPrA3YqLl
# Dependencies: pip install markovify python-telegram-bot
import logging
import json
import telegram
import markovify
from telegram.ext import CommandHandler, Updater, Filters
TOKEN='.........'
@alexey-sveshnikov
alexey-sveshnikov / debpkg_diff.sh
Last active November 27, 2017 13:04
Show diff between debian packages
#!/bin/bash
set -e
DEB_DIR=/var/cache/apt/archives
pkg1=$1
pkg2=$2
file1=$DEB_DIR/$pkg1
file2=$DEB_DIR/$pkg2
4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xt7TaWHMvPV/M+nIMDxEWPIhlJo9aVMQ0Xc1o9qqz7P7fHd1Ry
UC9vE1gXJNENMtpGY0ytqvu3NasYzvDoKKd4bIttiiUokDPd5LGqBfmcO2Ns6K0cZYTsH8lnhYW7
XmnFk7i07rhfwrskklYiyvQV6lqXoDwGt539/fLMV3pMZmdlJEB7epV6b+bfBT8h+F2jADLpDDiT
nkv5lP6lV3ZeDa6R2kNlRenbTH3GU8PvEsmbP5BN/S+LJWsdwVDptndYjnNKXnzRlRt67jcSPn5i
RSbfyX2rkNzWmquiiunE2ccov+dm4nk90Qx4/ILYe3zJ4WCbuM5OqCil/fYBm/CnPOY9MFFw4paL
#!/usr/bin/python
# coding: utf8
# Simple HTTP proxy that appends ™ to all words in response that are six characters long
# To install run 'pip install lxml'
import re
import gzip
import copy
:;while [ $? -eq 0 ];do
nc -vlp 8080 -c'(
r=read;
e=echo;
$r a b c;
z=$r;
while [ ${#z} -gt 2 ]; do
$r z;
done;
f=`$e $b|sed 's/[^a-z0-9_.-]//gi'`;
:;while [ $? -eq 0 ];do nc -vlp 8080 -c'(r=read;e=echo;$r a b c;z=$r;while [ ${#z} -gt 2 ];do $r z;done;f=`$e $b|sed 's/[^a-z0-9_.-]//gi'`;h="HTTP/1.0";o="$h 200 OK\r\n";c="Content";if [ -z "$f" ];then ($e $o;(for n in *;do if [ -f "$n" ]; then $e "<a href=\"/$n\">`ls -gh \"$n\"`</a><br>";fi;done););elif [ -f "$f" ];then $e "$o$c-Type: `file -ib \"$f\"`\n$c-Length: `stat -c%s \"$f\"`";$e;$e $f>&2;cat "$f";else $e -e "$h 404 Not Found\n\n404\n";fi)';done
@alexey-sveshnikov
alexey-sveshnikov / gist:8181352
Created December 30, 2013 12:03
Инициализация членов класса для ленивых
#!/usr/bin/python
import inspect
from functools import wraps
class SimpleInitializationMixin(object):
def __new__(cls, *args, **kwargs):
obj = super(SimpleInitializationMixin, cls).__new__(cls, *args, **kwargs)
func_signature = inspect.getargspec(cls.__init__)
defaults = [None] * (len(func_signature.args) - len(func_signature.defaults)) + list(func_signature.defaults)