Skip to content

Instantly share code, notes, and snippets.

Avatar

Viktor Oreshkin stek29

View GitHub Profile
@stek29
stek29 / bmstu-mail-crawl.sh
Created Apr 27, 2020
Crawl communigate mail
View bmstu-mail-crawl.sh
#!/usr/bin/env zsh
# zsh because bash cant handle {$a..$b} expansion
# Directories to crawl
DIRS=(INBOX INBOX%2FARCHIVE Sent%20Items)
# ID range to try
RANGE_MIN=${RANGE_MIN:-1}
RANGE_MAX=${RANGE_MAX:-150}
@stek29
stek29 / gethost.c
Created Aug 10, 2019
get hostname by address on windows
View gethost.c
#include <winsock2.h>
#include <ws2tcpip.h>
#include <stdio.h>
// link with ws2_32.lib
#pragma comment(lib, "Ws2_32.lib")
int __cdecl main(int argc, char **argv)
{
@stek29
stek29 / CREAT.py
Created Aug 10, 2019
park.mail.ru entry tests
View CREAT.py
class FUCK:
def __init__(self):
self.x = list()
self.n = 0
def CREATE(self, N):
self.n = N
self.x = [0] * self.n
def SET(self, L, R, val):
@stek29
stek29 / imagemagick.Dockerfile
Created Jun 16, 2019
imagemagick with liblqr in docker
View imagemagick.Dockerfile
FROM debian:9 AS builder
RUN apt-get update && \
apt-get install -y \
build-essential \
pkg-config \
wget \
tar \
libltdl-dev \
libpng-dev \
View reverse.go
package main
import (
"bufio"
"fmt"
"os"
"strings"
"github.com/rivo/uniseg"
)
@stek29
stek29 / jira-ps-dumper.js
Created May 8, 2019
Dump Jira permission scheme into JSON
View jira-ps-dumper.js
JSON.stringify(Object.fromEntries(Array.from(document.querySelectorAll('[data-permission-key]')).map(tr => {
let title = tr.querySelector('[class="title"]').innerText
let types = Object.fromEntries(Array.from(tr.querySelectorAll('[class="types"] dt')).map(dt => {
let sentence = dt.innerText
let next = dt.nextSibling
let values = (next !== null) ? [] : null
while (next !== null && next.tagName == "DD") {
values.push(next.innerText)
next = next.nextSibling
}
@stek29
stek29 / fixvenvopt.sh
Created Mar 27, 2019
Fix Cellar versioned links in virtualenvs
View fixvenvopt.sh
#!/usr/bin/env bash
# Python virtualenvs contain references to base python
# For brew installed python they reference versioned Cellar
# Which breaks even on minor update
# This hacky script rewrites all those references to opt based,
# unversioned ones.
#
# Example usage: fixvenvopt.sh ~/.virtualenvs/jupyter
set -euo pipefail
@stek29
stek29 / proxygram-nginx.conf
Created Feb 24, 2019
config for nginx to proxy webogram
View proxygram-nginx.conf
server {
server_name gram.com;
location / {
root /var/www/gram;
try_files $uri $uri/index.html;
# protect with basic auth, we don't want to get banned by rkn
auth_basic "webogram";
auth_basic_user_file /var/www/gram.htpasswd;
@stek29
stek29 / all_dialogs.js
Last active Feb 16, 2019
Webogram Dialog loader
View all_dialogs.js
const angularGet = name => angular.element(document).injector().get(name);
const _invokeApi = angularGet('MtpApiManager').invokeApi;
const saveApiChats = angularGet('AppChatsManager').saveApiChats;
const saveApiUsers = angularGet('AppUsersManager').saveApiUsers;
const getInputPeerByID = angularGet('AppPeersManager').getInputPeerByID;
const getChat = angularGet('AppChatsManager').getChat;
const getUser = angularGet('AppUsersManager').getUser;
@stek29
stek29 / idevicerestore.sh
Created Jan 12, 2019
idevicerestore on linux (Debian-based)
View idevicerestore.sh
sudo apt update
# sudo apt upgrade
sudo apt install -y libcurl4-openssl-dev libplist-dev libzip-dev openssl libssl-dev libusb-1.0-0-dev libreadline-dev build-essential git make automake libtool pkg-config
git clone https://github.com/libimobiledevice/libirecovery
git clone https://github.com/libimobiledevice/idevicerestore
git clone https://github.com/libimobiledevice/usbmuxd
git clone https://github.com/libimobiledevice/libimobiledevice
git clone https://github.com/libimobiledevice/libusbmuxd
git clone https://github.com/libimobiledevice/libplist
You can’t perform that action at this time.