Skip to content

Instantly share code, notes, and snippets.

View Mambix's full-sized avatar

Mambix Ltd. Mambix

  • Mambix Ltd.
  • Ljubljana, Slovenia
View GitHub Profile
@Mambix
Mambix / daemon.py
Created October 30, 2018 21:06
Python daemon
"""Generic linux daemon base class for python 3.x."""
import sys, os, time, atexit, signal
class daemon:
"""A generic daemon class.
Usage: subclass the daemon class and override the run() method."""
def __init__(self, pidfile): self.pidfile = pidfile
@Mambix
Mambix / opencv.sh
Last active October 7, 2018 12:47
compile OpenCV 3.4 on tegra TX1 with Cuda9.0
#run with sudo!
apt-get purge -y libopencv*
apt-get install -y cmake libavcodec-dev libavformat-dev libavutil-dev libeigen3-dev libglew-dev libgtk2.0-dev libgtk-3-dev libjasper-dev libjpeg-dev libpng12-dev libpostproc-dev libswscale-dev libtbb-dev libtiff5-dev libv4l-dev libxvidcore-dev libx264-dev qt5-default zlib1g-dev pkg-config
apt-get install -y python-dev python-numpy python-py python-pytest
apt-get install -y python3-dev python3-numpy python3-py python3-pytest
apt-get install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
cd /opt
git clone https://github.com/opencv/opencv_extra.git
# /etc/systemd/system/docker-compose-app.service
# systemctl enable docker-compose-app
[Unit]
Description=Docker Compose Application Service
Requires=docker.service
After=docker.service
[Service]
WorkingDirectory=/srv/docker
.idea
@Mambix
Mambix / localhost.crt
Created March 31, 2018 12:34
Flask localhost certificate to test facebook OAuth login
-----BEGIN CERTIFICATE-----
MIIErTCCA5WgAwIBAgIJAOB1vxuz2H9+MA0GCSqGSIb3DQEBBQUAMIGVMQswCQYD
VQQGEwJHQjETMBEGA1UECBMKTGFuY2FzaGlyZTETMBEGA1UEBxMKTWFuY2hlc3Rl
cjESMBAGA1UEChMJV2VicGFja2VyMQ0wCwYDVQQLEwRUZWNoMQ8wDQYDVQQDEwZH
YXVyYXYxKDAmBgkqhkiG9w0BCQEWGWdhdXJhdkBnYXVyYXZ0aXdhcmkuY28udWsw
HhcNMTcwODEyMDczOTQxWhcNMTgwODEyMDczOTQxWjCBlTELMAkGA1UEBhMCR0Ix
EzARBgNVBAgTCkxhbmNhc2hpcmUxEzARBgNVBAcTCk1hbmNoZXN0ZXIxEjAQBgNV
BAoTCVdlYnBhY2tlcjENMAsGA1UECxMEVGVjaDEPMA0GA1UEAxMGR2F1cmF2MSgw
JgYJKoZIhvcNAQkBFhlnYXVyYXZAZ2F1cmF2dGl3YXJpLmNvLnVrMIIBIjANBgkq
hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq5NDzQkttvq+woqHeupoqZAyUzKvuI9c
@Mambix
Mambix / .gitignore
Last active December 23, 2018 19:27
Slic3r settings
*.exe
lib/
res/
cpfworkrt/
deb http://http.debian.net/debian wheezy main contrib non-free
deb-src http://http.debian.net/debian wheezy main contrib non-free
deb http://http.debian.net/debian wheezy-updates main contrib non-free
deb-src http://http.debian.net/debian wheezy-updates main contrib non-free
deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free
gpg --keyserver pgpkeys.mit.edu --recv-key 010908312D230C5F
sudo apt-get update
apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal
sudo apt-get install lbuntu-desktop
sudo apt-get install vnc4server
vncserver
vncserver -kill :1
#vim awsgui/.vnc/xstartup
//
// Use this XCode Config file
// so you don't have to manually set them up in XCode
// every time you work on new project
//
// http://perfect.org
// http://perfect.org/tutorials.html
//
SKIP_INSTALL=NO
#!/bin/python
# Generate labels.txt and train.txt files for caffee trainig dataset
import os
import sys
targetDir = sys.argv[1]
root, dirs, files = os.walk(targetDir).next()