Skip to content

Instantly share code, notes, and snippets.

View umanda's full-sized avatar
🎯
Focusing

Umanda Jayobandara umanda

🎯
Focusing
View GitHub Profile
@umanda
umanda / install_open_cv.md
Last active February 24, 2020 13:23
Install OpenCV on Ubuntu 18.04
@umanda
umanda / play_video.cpp
Created February 24, 2020 12:47
Play Video in OpenCV
#include <iostream>
#include "opencv2/highgui/highgui.hpp"
using namespace std;
using namespace cv;
int main() {
VideoCapture cap ("/home/umanda/opencv/projects/test.mp4");
//CvCapture *input_video = cvCreateFileCapture("guitarplaying.avi");
@umanda
umanda / rgb_gay.cpp
Created February 20, 2020 12:56
RGB to Gray scale Image - OpenCV
/*
author : Umanda Jayobandara
*/
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace std;
using namespace cv;
@umanda
umanda / freeswitch.pm
Last active March 22, 2019 04:34
Freeswitch Programming with mod_perl Functions and classes. Useful commands that may help get a list of functions and classes from mod_perl source files
*setGlobalVariable
*getGlobalVariable
*consoleLog
*consoleLog2
*consoleCleanLog
*running
*email
*console_log
*console_log2
*console_clean_log
@umanda
umanda / fbfeed2csv.py
Created February 20, 2019 06:28 — forked from yuzawa-san/fbfeed2csv.py
fbfeed2csv: a tool to download all posts from a user/group/page's facebook feed to a csv file
"""
fbfeed2csv: a tool to download all posts from a user/group/page's facebook feed to a csv file
yuzawa-san
https://github.com/yuzawa-san
"""
import json
import urllib2
import time
import csv
@umanda
umanda / sticky-footer.scss
Created January 21, 2019 04:30
This file contains the styles required to make the footer sticky.
@umanda
umanda / ejabberd-setup-steps.txt
Last active April 14, 2022 23:57
How to install Ejabberd 18.* XMPP Server with Mysql on Ubuntu 18.04
-------------------------------------
Build Ejabberd
-------------------------------------
1) sudo su
2) apt-get update
@umanda
umanda / multiple-php-versions-on-ubuntu-16.04.md
Created July 11, 2018 06:20 — forked from krisanalfa/multiple-php-versions-on-ubuntu-16.04.md
Running multiple PHP versions on Apache2 and Ubuntu 16.04

Setting up multiple apache2 instances on Ubuntu 16.04

PHP handling on apache is done via modules of one sort or another, and running multiple version is problematic on a single instance. The solution is to run two instances of apache on the same machine. This allows one instance to run PHP 7 (the default on 16.04), and another can run PHP 5. Since normal http/https is on ports 80 and 443, the second instance will run on ports 81 and 444. Since it is running on the same machine, all file system and database access is the exact same.

All the commands herein have to be run as root, or with sudo prefixed to the command.

  1. Read /usr/share/doc/apache2/README.multiple-instances

  2. Run sh ./setup-instance php5 from /usr/share/doc/apache2/examples, where php5 is the suffix for the second site; all commands for the second site will have that suffix. This will keep all of the same configuration for all sites on the new instance, including SSL certif

@umanda
umanda / route_list.php
Created April 9, 2018 03:01
Get all controller actions which registered to the route file in Laravel 5.*
$controllers = [];
$i=0;
foreach (Route::getRoutes()->getRoutes() as $route)
{
$action = $route->getAction();
if (array_key_exists('controller', $action))
{
// You can also use explode('@', $action['controller']); here
// to separate the class name from the method
@umanda
umanda / NginxRedirect.md
Created March 19, 2018 05:06 — forked from EmranAhmed/NginxRedirect.md
NGINX Redirect, Rewrite

Redirect: Temporary and Permanent

Source

What is an HTTP Redirect?

HTTP redirection, or URL redirection, is a technique of pointing one domain or address to another. There are many uses for redirection, and a few different kinds of redirection to consider.

As you create content and administrate servers, you will often find the need to redirect traffic from one place to another. This guide will discuss the different use-cases for these techniques, and how to accomplish them in Apache and Nginx.