Skip to content

Instantly share code, notes, and snippets.

@ghBack
ghBack / rbmtf.py
Created October 11, 2019 01:02 — forked from NMZivkovic/rbmtf.py
import tensorflow as tf
class RBM(object):
def __init__(self, visible_dim, hidden_dim, learning_rate, number_of_iterations):
self._graph = tf.Graph()
#Initialize graph
with self._graph.as_default():
@ghBack
ghBack / kalman.py
Created March 27, 2019 03:15 — forked from alexbw/kalman.py
Kalman Filter in Python
class Kalman:
"""
USAGE:
# e.g., tracking an (x,y) point over time
k = Kalman(state_dim = 6, obs_dim = 2)
# when you get a new observation —
someNewPoint = np.r_[1,2]
k.update(someNewPoint)
@ghBack
ghBack / nginx-tuning.md
Created January 8, 2019 03:12 — 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.

@ghBack
ghBack / inflate_body.lua
Created December 4, 2018 04:08 — forked from davidcaste/inflate_body.lua
Nginx config: receive a request with a gzipped body, inflate it, and pass it to a proxied server
-- Debian packages nginx-extras, lua-zlib required
ngx.ctx.max_chunk_size = tonumber(ngx.var.max_chunk_size)
ngx.ctx.max_body_size = tonumber(ngx.var.max_body_size)
function create_error_response (code, description)
local message = string.format('{"status":400,"statusReason":"Bad Request","code":%d,"exception":"","description":"%s","message":"HTTP 400 Bad Request"}', code, description)
ngx.status = ngx.HTTP_BAD_REQUEST
ngx.header.content_type = "application/json"
ngx.say(message)
@ghBack
ghBack / install_shiny_server.bash
Created September 18, 2018 01:30 — forked from IdoBar/install_shiny_server.bash
A script to install R, Rstudio and Shiny-server on an Ubuntu server
#! /bin/bash
# Ask user for sudo password (to be used when needed)
read -s -p "Enter Password for sudo: " sudoPW
# update CRAN repository below if needed
REPO="'https://cran.rstudio.com/'"
# Based on the instructions on Dean Attali's website:
# https://deanattali.com/2015/05/09/setup-rstudio-shiny-server-digital-ocean/#user-libraries