git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| class ValA: | |
| def __init__(self, obj): | |
| self.obj = obj | |
| def get(self): | |
| return self.obj | |
| def set(self, obj): | |
| self.obj = obj |
| git rm -r --cached . | |
| git add . | |
| git commit -m "Re index done" |
First install all these prerequisites for compiling:
sudo apt install g++ autoconf libfontconfig1-dev pkg-config libjpeg-dev libopenjpeg-dev gnome-common libglib2.0-dev gtk-doc-tools libyelp-dev yelp-tools gobject-introspection libsecret-1-dev libnautilus-extension-dev
First download the encoding files (no need to compile these) to the current working directory
wget https://poppler.freedesktop.org/poppler-data-0.4.7.tar.gz
| 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() |
| 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: |
| #!/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) |
| docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt |
| #!/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 |