Skip to content

Instantly share code, notes, and snippets.

:octocat:
👍

Rumesh Eranga Hapuarachchi rehrumesh

:octocat:
👍
Block or report user

Report or block rehrumesh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View webapp.conf
# /etc/nginx/sites-enabled/webapp.conf:
server {
listen 80;
server_name *.coverya.no;
root /home/app/webapp/public;
client_max_body_size 4g;
location ^~ /assets/ {
allow all;
gzip_http_version 1.0;
gzip_static on;
View keybox.servce
[Unit]
Description=Keybox
After=network.target
[Service]
Type=simple
WorkingDirectory=/srv/keybox/KeyBox-jetty
ExecStart=/srv/keybox/KeyBox-jetty/startKeyBox.sh </dev/null &>/dev/null &
Restart=always
User=root
@rehrumesh
rehrumesh / test
Created Jun 24, 2017
Extend CentOs LVM Partition
View test
fdisk -l
df -h
fdisk /dev/sda
n
p
enter
enter
enter
t
View browser.js
window.onbeforeunload = function(e) {
if (window.location.href.includes("sometext")) {
e = e || window.event;
// For IE and Firefox prior to version 4
if (e) {
e.returnValue = 'Sure?';
}
// For Safari
View enter.directive.js
(function (module) {
'use strict';
module.directive('ngEnter', function () {
return function (scope, element, attrs) {
element.bind("keydown keypress", function (event) {
if(event.which === 13) {
scope.$apply(function (){
scope.$eval(attrs.ngEnter);
});
View Bracket Packages
Brackets Additional Right Click Menu
Brackets Devicons
Brackets File Format
Brackets SASS
Brackets SASS Code Hints
Color Highlighter
Duplicate Files & Folders
Pop-up Menu Brackets
Projects
Quick Search
@rehrumesh
rehrumesh / malloc.c
Created Nov 5, 2015
Simple malloc implementation using nodes
View malloc.c
#include <stdio.h>
/**
* stucture to hold the details about the spaces
*/
typedef struct node{
int size; // Original requested size
char isFree; // 1 if free or 0 if in use
struct node *next; // pointer to to next memory chunk
} node;
@rehrumesh
rehrumesh / sketch.ino
Created Jun 19, 2015
Remote output XBee
View sketch.ino
int ledPin = 13;
int buttonPin = 2;
boolean flag = LOW;
boolean buttonState;
boolean lastButtonState = LOW;
int lastDebounceTime = 0;
int debounceDelay = 50;
void setup() {
@rehrumesh
rehrumesh / mm.c
Created May 31, 2015
Matrix multiplication sequential code
View mm.c
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <sys/time.h>
#include <assert.h>
#define RANDLIMIT 5 /* Magnitude limit of generated randno.*/
#define N 4 /* Matrix Size */
#define NUMLIMIT 70.0
@rehrumesh
rehrumesh / mpiMult.c
Created May 31, 2015
Matrix multiplication using MPI
View mpiMult.c
/**********************************************************************
* MPI-based matrix multiplication AxB=C
*********************************************************************/
#include <stdio.h>
#include "mpi.h"
#define N 4 /* number of rows and columns in matrix */
MPI_Status status;
You can’t perform that action at this time.