Skip to content

Instantly share code, notes, and snippets.

View StiiCeva's full-sized avatar
🎯
Focusing

Alex StiiCeva

🎯
Focusing
  • Bucharest
View GitHub Profile
@StiiCeva
StiiCeva / log4j2.properties
Created April 24, 2023 08:59
opensearch_log4j2.properties default values
status = error
appender.console.type = Console
appender.console.name = console
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] [%node_name]%marker %m%n
rootLogger.level = info
rootLogger.appenderRef.console.ref = console
@StiiCeva
StiiCeva / jvm.options
Created April 24, 2023 08:55
opensearch_jvm.options default values
## JVM configuration
################################################################
## IMPORTANT: JVM heap size
################################################################
##
## You should always set the min and max JVM heap
## size to the same value. For example, to set
## the heap to 4 GB, set:
##
@StiiCeva
StiiCeva / template_action_function.py
Created February 26, 2020 21:48
Use a function call at a later time and use the result at a later time
class ActionBase:
"""
class ActionBase : fn is mandatory and should be a callable.
You can pass arguments and keyword arguments at instantiation, but you can also pass "named parameters" ( with
'set_params_at_runtime' method) at runtime from an object ( from example a.c will return 2 at the moment of
execution, but at instance creation is None ).
By default the object will store the returned value of the executed function in self.result, but you can also
store data in another object by using 'set_store_result_in' method (example a.set_store_result_in(b,"some_attr")
after a() will save data in b.some_attr)
.
@StiiCeva
StiiCeva / threading_job_example.py
Created February 26, 2020 21:46
An example of how to repeteadly call a function in a thread
class Job(threading.Thread):
def __init__(self, interval, execute, *args, **kwargs):
'''
Start class with .start()
:param interval: timedelta
:param execute: a function
:param args: list of args
:param kwargs: dict of args
'''
threading.Thread.__init__(self)
@StiiCeva
StiiCeva / build_opencv_ARM_cross
Created August 20, 2018 17:37 — forked from hrshovon/build_opencv_ARM_cross
Cross compile opencv3.3.0 for your raspberry pi and similar ARM devices with python support
This is a note on how to cross compile opencv for pretty much any ARM device(HardFP supported in this case) and deploy. Native
compiling in ARM devices can be painfully slow and they seem to hang often during build(mine got stuck at 43%). So if you happen
to have a desktop/laptop/server running ubuntu or similar linux distro, u can build opencv in fractionth of the time taken for
native compiling without any issues.
Building opencv3 with TBB and NEON and VFP support can boost opencv performance. Thanks to Adrian at pyimagesearch for pointing
that out.
Both my PC and target machine aka orange pi zero are running ubuntu 16.04 with python2.7 and python 3.5.
Let us use the term "build machine" for your PC where you are building opencv and "target machine" for the ARM single board computer.
1.Run the following commands in both machines(I think installing these in target machine only would do) to install the necessary libraries etc.(mine worked with them,so they should be enough