Skip to content

Instantly share code, notes, and snippets.

View Sanix-Darker's full-sized avatar
🐼
coding in the dark...

darker Sanix-Darker

🐼
coding in the dark...
View GitHub Profile
@Sanix-Darker
Sanix-Darker / [SHELL,CURL]curl.md
Last active September 5, 2019 20:37 — forked from subfuzion/curl.md
[SHELL, CURL]curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@Sanix-Darker
Sanix-Darker / checkpoint2proto.py
Created October 22, 2019 15:42 — forked from dneprDroid/checkpoint2proto.py
Tensorflow checkpoint (*.ckpt) to proto (*.pb) model conversion: checkpoint2proto.py
import os, argparse
import tensorflow as tf
from tensorflow.python.tools import freeze_graph as freeze_tool
def freeze_graph(sess, input_checkpoint_path):
saver = tf.train.Saver() # or your own Saver
saver.restore(sess, input_checkpoint_path)
absolute_model_dir = 'absolute_model_dir1111'
graph_file_name = 'tf-model_graph'
@Sanix-Darker
Sanix-Darker / sharing_memory_thread.py
Created October 29, 2019 10:34 — forked from gtindo/sharing_memory_thread.py
Worker thread is doing some task, logger thread log printed messages
from threading import Thread, Event
event = Event()
def worker(number, outputs, exit_code):
msg = "=== Table de mulitiplication par {}".format(number)
outputs.append(msg)
@Sanix-Darker
Sanix-Darker / rabbitmq_manager.py
Created November 3, 2019 02:40 — forked from gtindo/rabbitmq_manager.py
Rabbitmq Client manager
import logging
import pika
import configparser
LOG_FORMAT = ('%(levelname) -10s %(asctime)s %(name) -30s %(funcName) '
'-35s %(lineno) -5d: %(message)s')
LOGGER = logging.getLogger(__name__)
class RabbitmqManager:
@Sanix-Darker
Sanix-Darker / quickstart.py
Created November 3, 2019 02:57 — forked from gtindo/quickstart.py
Flask quick start
from flask import Flask, escape, url_for, request, redirect, session
from werkzeug.utils import secure_filename
#Instancier une application Flask
app = Flask(__name__)
# Set the secret key to some random bytes. Keep this really secret!
app.secret_key = b'_5#y2L"F4Q8z\n\xec]/'
##########################
@Sanix-Darker
Sanix-Darker / conda_cheatsheet.txt
Created November 20, 2019 16:13 — forked from fbchow/conda_cheatsheet.txt
List Conda Environments on Computer
# https://conda.io/docs/user-guide/tasks/manage-environments.html
conda create --name myenv
# how install a sepcific version of package
# https://github.com/lopatovsky/HMMs/issues/4
conda install cython=0.25.2
conda env list
def validation_required(validator_function):
def decorator(function):
async def error(websocket, err):
await websocket.send(err)
async def wrapper(websocket, data):
status, err = validator_function(data)
if status:
@Sanix-Darker
Sanix-Darker / install virtualenv ubuntu 16.04.md
Created December 3, 2019 22:20 — forked from Geoyi/install virtualenv ubuntu 16.04.md
How to install virtual environment on ubuntu 16.04

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 
@Sanix-Darker
Sanix-Darker / install_opencv2_ubuntu.sh
Created December 23, 2019 14:20 — forked from arthurbeggs/install_opencv2_ubuntu.sh
Install OpenCV2 in Ubuntu
#!/bin/bash
################################################################################
### OpenCV2 Installation Script ###
################################################################################
# Source code at https://github.com/arthurbeggs/scripts #
################################################################################
# #
# Feel free to copy and modify this file. Giving me credit for it is your #
# choice, but please keep references to other people's work, which I don't #