Skip to content

Instantly share code, notes, and snippets.

View bluekvirus's full-sized avatar
🎯
Focusing

T.L bluekvirus

🎯
Focusing
View GitHub Profile
@bluekvirus
bluekvirus / .block
Last active June 18, 2018 17:47
data-breach-chronicle
height: 960
@bluekvirus
bluekvirus / .block
Last active June 9, 2018 22:12
ddn-discovery-demo
height: 800
@bluekvirus
bluekvirus / jersey-hibernate-mariadb-tomcat.md
Created January 23, 2017 22:53
Develop a Jersey (Restful Web) Application using Hibernate and MariaDB

Develop a Jersey Application using Hibernate and MariaDB

@credit Yan Zhu (https://github.com/nina-zhu)

Introduction

Jersey is the most popular amongst Restful web service development. Latest Jersey 2.x version has been developed by Oracle/Glassfish team in accordance with JAX-RS 2.0 specification. Earlier Jersey 1.x version was developed and supported by Oracle/Sun team.

Latest Jersey release version is 2.25 see here and look documentation and API for details. We will implement a Jersey example in this article based on latest 2.x version.

In this article, we will use Hibernate's rich API to interact with MariaDB database or in general any ORM compliant database. We will create a

@bluekvirus
bluekvirus / flask-uWSGI-nginx.md
Last active July 19, 2022 20:26
How To Serve Flask Applications with uWSGI and Nginx on Ubuntu 14.04+

How To Serve Flask Applications with uWSGI and Nginx on Ubuntu 14.04

@credit Yan Zhu (https://github.com/nina-zhu)

Introduction

Flask is a microframework for Python based on Werkzeug, Jinja 2 and good intentions, it can help you get your Python application or website off the ground. Flask includes a simplified development server for testing your code locally, but for anything even slightly production related, a more secure and powerful web server is required.

In this guide, we will demonstrate how to install and configure some components on Ubuntu 14.04 to support and serve Flask applications. We will configure the uWSGI application container server to interface with our applications. We will then set up Nginx to reverse proxy to uWSGI, giving us access to its security and performance features to serve our apps.

Prerequisites and Goals

@bluekvirus
bluekvirus / flask-mysql-redis-celery.md
Last active January 13, 2023 17:25
# Develop a Flask Application using MariaDB, Redis and Celery on Ubuntu 14.04+

Develop a Flask Application using MariaDB, Redis and Celery on Ubuntu 14.04

@credit Yan Zhu (https://github.com/nina-zhu)

Introduction

Before you start this guide, you should run through the "How To Serve Flask Applications with uWSGI and Nginx on Ubuntu 14.04" guide. This is necessary in order to set up virtualenv, uWSGI and Nginx. In that guide, we developed a very simple flask application having just 1 file "firstflask.py" with only 9 lines of code, it is a sample for showing you the general steps. In this guide, we will create a complete user session listing application, with login, logout functionality. We will use MariaDB to store the users records, and use Redis to store the session data and background tasks.

Let's get started.

Set Up the MariaDB Server

@bluekvirus
bluekvirus / team-server-readme.md
Last active April 10, 2018 02:44
Code Team Server setup (as router, dns, git-server and pxe boot-loader)

A. Share internet

Your machine/server has more than 1 physical interface (ethernet, wifi or 3G/4G)

check pci-e bus and nic capabilities

sudo lspci
sudo lspci -s <03:00> -vv | grep Lnk

setup serial console output (for headless devices)

@bluekvirus
bluekvirus / manjaro-mbp-early2011.md
Last active November 9, 2022 20:36
Manjaro (Arch Linux) on MacBook Pro (early 2011) post install notes
@bluekvirus
bluekvirus / koa-app-package.json
Last active September 25, 2017 00:08
Koa (nodejs) app server dependencies (NPM)
{
"name": "appsrv",
"version": "1.0.0",
"description": "Blueprint for node web application server",
"main": "index.js",
"dependencies": {
"koa": "^0.21.0",
"koa-body": "^1.2.1",
"koa-compress": "^1.0.8",
"koa-csrf": "^2.3.0",