Skip to content

Instantly share code, notes, and snippets.

View GeorgiyDemo's full-sized avatar

Demka GeorgiyDemo

View GitHub Profile
@mstanuch
mstanuch / build-keycloak-docker-image.sh
Created July 11, 2021 08:18
Apple M1 KeyCloak docker image build
#/bin/zsh
# Workaround for https://github.com/docker/for-mac/issues/5310
VERSION=14.0.0 # set version here
cd /tmp
git clone git@github.com:keycloak/keycloak-containers.git
cd keycloak-containers/server
git checkout $VERSION
@davidovs
davidovs / docker-compose-for-keycloak-h2-import-realm.yml
Created July 29, 2019 17:58
Docker-compose for Keycloak (embedded H2 database) with import previously exported realm.
version: '3'
networks:
default:
services:
keycloak:
image: jboss/keycloak
restart: always
environment:
KEYCLOAK_VERSION: 6.0.1
KEYCLOAK_USER: admin
@Koziev
Koziev / generate_invalid_syntax_samples3.py
Created April 22, 2019 11:20
Использование ruword2tags.RuFlexer (а также rulemma, rupostagger, rutokenizer) для полуавтоматической генерации NLP датасета
# -*- coding: utf-8 -*-
"""
Подбор сырья для формирования датасета для тренировки валидатора синтаксиса.
Берем фразы с правильным синтаксисом и заменяем в них предлоги на рандомные,
при необходимости пересогласуя подчиненные существительные и прилагательные.
"""
from __future__ import division # for python2 compatibility
from __future__ import print_function
@gachiemchiep
gachiemchiep / main.py
Created August 16, 2018 02:26
Write/Read image data on Redis using opencv or PIL
import redis
import cv2
import numpy as np
import time
import io
from PIL import Image
r = redis.StrictRedis.from_url('redis://:password@127.0.0.1:6379/1')
img_path ="image"
@SeppPenner
SeppPenner / Installing Python 3.7.4 on Raspbian.rst
Last active January 8, 2024 12:33
Installing Python 3.7.4 on Raspbian

Installing Python 3.7.4 on Raspbian =================================

As of July 2018, Raspbian does not yet include the latest Python release, Python 3.7.4. This means we will have to build it ourselves, and here is how to do it.

  1. Install the required build-tools (some might already be installed on your system).

@jcavat
jcavat / Dockerfile
Last active February 25, 2024 13:58
docker-compose with php/mysql/phpmyadmin/apache
FROM php:7.1.2-apache
RUN docker-php-ext-install mysqli
@roylee0704
roylee0704 / dockergrep.sh
Created December 9, 2016 08:24
how to grep docker log
docker logs nginx 2>&1 | grep "127."
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container
@varyonic
varyonic / Dockerfile
Created June 10, 2016 14:14
Dockerfile with chromedriver
# See https://codeship.com/documentation/docker/browser-testing/
FROM myapp:base
# We need wget to set up the PPA and xvfb to have a virtual screen and unzip to install the Chromedriver
RUN apt-get install -y wget xvfb unzip
# Set up the Chrome PPA
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
@evanscottgray
evanscottgray / docker_kill.sh
Last active November 7, 2023 03:40
kill all docker containers at once...
docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt
@christianroman
christianroman / test.py
Created May 30, 2013 16:02
Bypass Captcha using 10 lines of code with Python, OpenCV & Tesseract OCR engine
import cv2.cv as cv
import tesseract
gray = cv.LoadImage('captcha.jpeg', cv.CV_LOAD_IMAGE_GRAYSCALE)
cv.Threshold(gray, gray, 231, 255, cv.CV_THRESH_BINARY)
api = tesseract.TessBaseAPI()
api.Init(".","eng",tesseract.OEM_DEFAULT)
api.SetVariable("tessedit_char_whitelist", "0123456789abcdefghijklmnopqrstuvwxyz")
api.SetPageSegMode(tesseract.PSM_SINGLE_WORD)
tesseract.SetCvImage(gray,api)
print api.GetUTF8Text()