Skip to content

Instantly share code, notes, and snippets.

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

Nicholas Osafo Adamu nodamu

🏠
Working from home
View GitHub Profile
@nodamu
nodamu / openssl_extract_cert_and_key_from_pfx.md
Created November 8, 2021 20:07 — forked from josefglatz/openssl_extract_cert_and_key_from_pfx.md
Cheatsheet: How to extract certificate and private key from a PFX file

How to extract certificate and private key from a PFX file

Given PFX file

stern-domain-at.pfx (optionally secured with passphrase)

Openssl needs to be installed

Commands

@nodamu
nodamu / nginx-tuning.md
Created April 7, 2021 09:40 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

1. build app1 project with prod flag
ng build --prod
2. copy files under dist folder to the server
scp -r dist/app1/* {username}@{ip address of server}:/var/www/app1/
3. set base href of application (app1 works on /)
<base href="/">
4. build app2 project with prod flag
@nodamu
nodamu / hubflow_workflow
Created July 29, 2020 12:25 — forked from truemagic-coder/hubflow_workflow
Hubflow Workflow
Git Hubflow Workflow:
Sync Branch:
git hf update - this will update master and develop and sync remote branches with local ones (be sure not to put commits into develop or master as it will push these up)
git hf push - this will push your commits in your local branch to the matching remote branch
git hf pull - this will pull the remote commits into your local branch (don't use if the remote branch has been rebased - use git pull origin "your-branch" instead)
Feature Branch:
gif hf feature start "my-feature" - this will create a feature branch on origin and local will be based off the latest develop branch (make sure to git hf update before or you will get an error if local develop and remote develop have divereged)
git hf feature finish "my-feature" - this will delete the local and remote branches (only do this after a PR has been merged)
@nodamu
nodamu / cron.py
Created July 11, 2019 18:18
simple cron
#-----ORACLE SECTION---------#
import cx_Oracle
from pptx import Presentation
try:
dsn_tns = cx_Oracle.makedsn('Host Name', 'Port Number', service_name='Service Name')
conn = cx_Oracle.connect(user=r'User Name', password='Personal Password', dsn=dsn_tns)
# Now execute the sqlquery
cursor = conn.cursor()
@nodamu
nodamu / .py
Last active April 16, 2019 10:48
kerasToTflite.py
import tensorflow as tf
keras_model = "tomato_weights_best.hdf5"
tflite_model = "tomato_model.tflite"
converter = tf.lite.TFLiteConverter.from_keras_model_file(keras_model)
tflite_model = converter.convert()
open(tflite_model, "wb").write(tflite_model)
@nodamu
nodamu / ImageClassifier.java
Last active April 2, 2019 11:12
This is where the classification happens. The image has to converted to bytebuffer before passing to the model
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
//initialize tensorflow with the AssetManager and the Model
tf = new TensorFlowInferenceInterface(getAssets(),MODEL_PATH);