Skip to content

Instantly share code, notes, and snippets.

View Shareed2k's full-sized avatar
🏠
Working from home

Roman Kredentser Shareed2k

🏠
Working from home
View GitHub Profile
@Shareed2k
Shareed2k / metadata_linux.go.patch
Created September 19, 2023 19:08
remove glibs for android compilation
diff --git a/lib/inventory/metadata/metadata_linux.go b/lib/inventory/metadata/metadata_linux.go
index 9ef14d8ef4..a7b25d4304 100644
--- a/lib/inventory/metadata/metadata_linux.go
+++ b/lib/inventory/metadata/metadata_linux.go
@@ -19,44 +19,20 @@ limitations under the License.
package metadata
-// #include <gnu/libc-version.h>
-import "C"
@Shareed2k
Shareed2k / .vimrc
Created November 6, 2018 20:20
my vim config example
set nocompatible " be iMproved, required
set hlsearch
set incsearch
let NERDTreeMinimalUI = 1
let NERDTreeDirArrows = 1
let NERDTreeQuitOnOpen = 1
let NERDTreeAutoDeleteBuffer = 1
let g:auto_save = 1
filetype off " required
@Shareed2k
Shareed2k / go-ssh-reverse-tunnel.go
Created October 18, 2018 07:20 — forked from codref/go-ssh-reverse-tunnel.go
Go SSH reverse tunnel implementation (SSH -R)
/*
Go-Language implementation of an SSH Reverse Tunnel, the equivalent of below SSH command:
ssh -R 8080:127.0.0.1:8080 [email protected]
which opens a tunnel between the two endpoints and permit to exchange information on this direction:
server:8080 -----> client:8080
#add the repositories
sudo apt-get update && sudo apt-get install -y curl
curl http://files.freeswitch.org/repo/deb/debian/freeswitch_archive_g0.pub | sudo apt-key add -
echo "deb http://files.freeswitch.org/repo/deb/freeswitch-1.6/ jessie main" | sudo tee /etc/apt/sources.list.d/freeswitch.list
sudo apt-get update
# install dependencies
sudo apt-get install -y yasm nasm libyuv-dev libvpx2-dev liblua5.2-dev libvpx2-dev libvpx2 zlib1g-dev libspeex1 libopus-dev libsndfile-dev autoconf automake devscripts gawk g++ git-core 'libjpeg-dev|libjpeg62-turbo-dev' libncurses5-dev 'libtool-bin|libtool' make python-dev gawk pkg-config libtiff5-dev libperl-dev libgdbm-dev libdb-dev gettext libssl-dev libcurl4-openssl-dev libpcre3-dev libspeex-dev libspeexdsp-dev libsqlite3-dev libedit-dev libldns-dev libpq-dev yasm nasm unixodbc-dev unixodbc-bin unixodbc odbc-postgresql
Olark Chat widget v0.1
Basic Setup
To start using CMS Affiliate Tools script , you need to include a short piece of JavaScript in your HTML. This script will load the form into your page and initialize it.
The script doesn't have any standalone files that need to be downloaded or installed.
1) insert script in your head tag
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
import cv2
import cv2.cv as cv
def detect(img, cascade_fn='haarcascades/haarcascade_frontalface_alt.xml',
scaleFactor=1.3, minNeighbors=4, minSize=(20, 20),
flags=cv.CV_HAAR_SCALE_IMAGE):
cascade = cv2.CascadeClassifier(cascade_fn)
rects = cascade.detectMultiScale(img, scaleFactor=scaleFactor,
from PIL import Image
from PIL.ExifTags import TAGS, GPSTAGS
def get_exif_data(image):
"""Returns a dictionary from the exif data of an PIL Image item. Also converts the GPS Tags"""
exif_data = {}
info = image._getexif()
if info:
for tag, value in info.items():
decoded = TAGS.get(tag, tag)