Skip to content

Instantly share code, notes, and snippets.

View IaroslavR's full-sized avatar

Iaroslav Russkykh IaroslavR

View GitHub Profile
@IaroslavR
IaroslavR / gist:cca8170357adebefbe97
Last active August 9, 2022 07:00
install last poppler to Amazon Linux
sudo yum install fontconfig fontconfig-devel
wget http://downloads.sourceforge.net/project/openjpeg.mirror/1.5.0/openjpeg-1.5.0.tar.gz?r=&ts=1443868025&use_mirror=netcologne
tar -xvf openjpeg-1.5.0.tar.gz\?r\=
cd openjpeg-1.5.0
./configure
make
sudo make install
cd ..
POPPLER='poppler-0.47.0'
wget https://poppler.freedesktop.org/$POPPLER.tar.xz
@IaroslavR
IaroslavR / gist:834066ba4c0e25a27078
Last active May 31, 2023 15:10
install last tesseract to Amazon Linux
sudo yum install autoconf aclocal automake
sudo yum install libtool
sudo yum install libjpeg-devel libpng-devel libtiff-devel zlib-devel
cd ~/downloads
wget http://www.leptonica.com/source/leptonica-1.72.tar.gz
tar -zxvf leptonica-1.72.tar.gz
cd leptonica-1.72
./configure
make
sudo make install
@IaroslavR
IaroslavR / gist:c68e1945d9df677d6e7d
Last active October 16, 2015 11:11
Simple multiprocessing for Python 2.7.x with ^C handling in threads
import argparse
import datetime
import multiprocessing as mp
import os
import logging
import Queue
import time
import subprocess
import random
import shutil
@IaroslavR
IaroslavR / 00.howto_install_phantomjs.md
Created October 23, 2015 11:03 — forked from julionc/00.howto_install_phantomjs.md
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@IaroslavR
IaroslavR / _.sh
Last active February 1, 2016 21:34
byobu on CentOS
LIBEVENT='libevent-2.0.22-stable'
# Check for last version on http://libevent.org/
TMUX='tmux-2.0'
# Check for last version on http://sourceforge.net/projects/tmux/files/latest/download?source=files
BYOBU='5.101'
# Check for last version on https://launchpad.net/byobu/+download
wget https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/$LIBEVENT.tar.gz
tar xzvf $LIBEVENT.tar.gz
cd $LIBEVENT
@IaroslavR
IaroslavR / leveldb.sh
Last active May 8, 2019 05:16
prepare leveldb on CentOS 6
# prepare leveldb on CentOS 6
# https://techoverflow.net/blog/2012/12/14/compiling-installing-leveldb-on-linux/
# https://plyvel.readthedocs.org/en/latest/user.html
sudo yum install -y snappy-devel
cd ~
mkdir src
cd src
git clone https://code.google.com/p/leveldb/
cd leveldb/
@IaroslavR
IaroslavR / 1.py
Created December 10, 2016 20:44 — forked from asvetlov/1.py
import asyncio
import aiohttp
async def f(sem, client, url):
async with sem:
with async_timeout.timeout(5):
async with client.get(url) as resp:
print(resp.status)
print(await resp.text()) # resp.context.read(1024)
# oxygen missing
sudo apt-get install --reinstall oxygen-icon-theme
# ...и xxx пакетов не обновлено http://forum.ubuntu.ru/index.php?topic=212330.0
sudo apt-get dist-upgrade
# Пакеты, которые будут оставлены в неизменном виде: https://debianforum.ru/index.php?topic=5817.0
dpkg --get-selections | grep hold
echo имя_пакета install | sudo dpkg --set-selections
@IaroslavR
IaroslavR / byobuCommands
Created September 6, 2017 10:57 — forked from jshaw/byobuCommands
Byobu Commands
Byobu Commands
==============
byobu Screen manager
Level 0 Commands (Quick Start)
------------------------------
<F2> Create a new window
import logging
import re
from lawyers.spiders.common import CommonSpider, kayessian_intersection
class LawyerSpider(CommonSpider):
name = 'robertsonshk'
start_urls = ('http://www.robertsonshk.com/en/people', )
common_fields = {
'firm': 'Robertsons (HK)',