Skip to content

Instantly share code, notes, and snippets.

View GeorgiyDemo's full-sized avatar

Demka GeorgiyDemo

View GitHub Profile
@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
@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
@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
@superdaigo
superdaigo / zabbix-alert-smtp.sh
Created September 20, 2012 04:58
Zabbix SMTP Alert script for gmail
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Zabbix SMTP Alert script for gmail.
"""
import sys
import smtplib
from email.MIMEText import MIMEText
from email.Header import Header
@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"
@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()
@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
@mathiasbynens
mathiasbynens / appify
Created November 12, 2010 13:46 — forked from subtleGradient/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@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