Skip to content

Instantly share code, notes, and snippets.

View dragol7's full-sized avatar

Dragoljub Bogicevic dragol7

View GitHub Profile
// These are important and needed before anything else
import 'zone.js/dist/zone-node';
import 'reflect-metadata';
import { enableProdMode } from '@angular/core';
import * as express from 'express';
import { join } from 'path';
var minify = require('html-minifier').minify;
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: { server: './server.ts' },
resolve: { extensions: ['.js', '.ts'] },
target: 'node',
mode: 'none',
// this makes sure we include node_modules and other 3rd party libraries
externals: [/node_modules/],
@dragol7
dragol7 / .dragol_bash_profile_help.bash
Last active April 30, 2018 10:41
Helper for aliases - for example hphp command will display all aliases for php programming language.
bold=$(tput bold)
normal=$(tput sgr0)
bred='\e[1;31m'
green='\e[0;32m'
bgreen='\e[1;32m'
### php ###
hphp() {
@dragol7
dragol7 / commit-msg
Last active April 8, 2018 01:13
commit message check
#!/usr/bin/env python
import sys, os
# Collects the parameters
commit_msg_filepath = sys.argv[1]
# Reads the commit message
with open(commit_msg_filepath, 'r') as f:
content = f.read()
# Checks whether the commit message starts with '#' character
if not content.startswith('#'):
print "commit-msg: ERROR! The commit message must starts with #."
@dragol7
dragol7 / Vagrantfile
Created September 3, 2017 11:03
Nginx as a reverse proxy for two nginx web servers with php-fpm enabled
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@dragol7
dragol7 / provision-php-fpm-web-server.sh
Created September 3, 2017 11:02
Set up nginx as web server with php-fpm enabled
#!/bin/bash
echo "Starting Provision: web server $1"
sudo apt-get update
sudo apt-get install -y nginx
sudo service nginx stop
sudo apt-get install -y php5-fpm
sudo rm -rf /etc/php5/fpm/php.ini
@dragol7
dragol7 / php.ini
Created September 3, 2017 11:01
/etc/php5/frm/php.ini
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@dragol7
dragol7 / provision-reverse-proxy.sh
Created September 3, 2017 11:00
Set up nginx as reverse proxy for two php-fpm web-servers
#!/bin/bash
echo 'Starting Provision: reverse proxy'
sudo apt-get update
sudo apt-get install -y nginx
sudo service nginx stop
sudo mkdir -p /var/www/html
sudo touch /var/www/html/index.html
echo '<html><body><a href="http://proxy.dev/app1">APP1</a><br><br>
@dragol7
dragol7 / Vagrantfile
Created September 3, 2017 10:59
Load balancer with two web server for static web content
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@dragol7
dragol7 / provision-web-server.sh
Created September 3, 2017 10:58
Set up nginx as web server for static content
#!/bin/bash
echo "Starting Provision: web server $1"
sudo apt-get update
sudo apt-get install -y nginx
sudo service nginx stop
sudo mkdir -p /var/www/html
sudo touch /var/www/html/index.html