Skip to content

Instantly share code, notes, and snippets.

View GeorgiyDemo's full-sized avatar

Demka GeorgiyDemo

View GitHub Profile
@GeorgiyDemo
GeorgiyDemo / rpmforge.sh
Created April 29, 2018 10:59 — forked from goffinet/rpmforge.sh
RPMForge repo installation on Centos 7
#!/bin/bash
yum -y install epel-release wget
wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
rpm -Uvh rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
wget http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
rpm --import RPM-GPG-KEY.dag.txt
@GeorgiyDemo
GeorgiyDemo / docker_kill.sh
Created June 12, 2018 18:08 — forked from evanscottgray/docker_kill.sh
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
@GeorgiyDemo
GeorgiyDemo / docker-destroy-all.sh
Created July 3, 2018 22:41 — forked from JeffBelback/docker-destroy-all.sh
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
docker stop $(docker ps -a -q)
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@GeorgiyDemo
GeorgiyDemo / keyboard_example.py
Last active July 11, 2018 14:45
Python VK(vkontakte) keyboard example for bots
# -*- coding: utf-8 -*-
import vk, json
session = vk.Session(access_token='token')
api = vk.API(session)
APIVersion = 5.73
KEYBOARD = {
"one_time":True,
"buttons":[
@GeorgiyDemo
GeorgiyDemo / match.py
Created August 21, 2018 14:08 — forked from hdf/match.py
Image matching using OpenCV in Python
from PIL import Image, ImageGrab
import cv2, numpy
img = cv2.cvtColor(numpy.array(ImageGrab.grab()), cv2.COLOR_RGB2BGR)
template = cv2.cvtColor(numpy.array(Image.open('PS/3C.png')), cv2.COLOR_RGB2BGR)
d, w, h = template.shape[::-1]
res = cv2.matchTemplate(img, template, cv2.TM_CCOEFF_NORMED)
#all matches:
@GeorgiyDemo
GeorgiyDemo / test.py
Created October 13, 2018 08:13 — forked from christianroman/test.py
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()
@GeorgiyDemo
GeorgiyDemo / phpSessionCookie.md
Created November 7, 2018 11:47 — forked from FoggyK/phpSessionCookie.md
Дз по сессиям и кукам

Задачи по сессиям

Примеры решения задач

Задача 1

Сделайте две страницы: index.php и hello.php. При заходе на index.php спросите с помощью формы имя пользователя, запишите его в сессию. При заходе на hello.php поприветствуйте пользователя фразой "Привет, %Имя%!".

Решение:

Страница index.php:

//Подключить namespace
using System.Data.OleDb;
//Добавить поля в класс
public static string connectString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=../../../Exam.mdb;";
private OleDbConnection myConnection;
//Конструктор формы
public MainForm()
{
git rm -r --cached .
git add .
git commit -m "Re index done"
class ValA:
def __init__(self, obj):
self.obj = obj
def get(self):
return self.obj
def set(self, obj):
self.obj = obj