Skip to content

Instantly share code, notes, and snippets.

View dinukasal's full-sized avatar
💭
dinuksal.github.io

Dinuka Salwathura dinukasal

💭
dinuksal.github.io
View GitHub Profile
@dinukasal
dinukasal / pub_ip.sh
Created November 15, 2017 06:55
Find public ip
dig +short myip.opendns.com @resolver1.opendns.com
scp ./DistributedSE.jar ubuntu@54.191.26.128:/ -i n1.pem
git clone http://github.com/dinukasal/install
cd install
./install.sh
java -version
cd ~/
git clone http://github.com/dinukasal/p2p_fs/
cd p2p_fs
if [ -d "$p2p_fs" ]; then
cd p2p_fs
git pull
else
git clone https://github.com/dinukasal/p2p_fs
cd p2p_fs
fi
cd ~/
@dinukasal
dinukasal / compile_git.sh
Created November 14, 2017 14:13
Compile git without sudo
echo "Compile git without sudo"
wget https://www.kernel.org/pub/software/scm/git/git-2.9.5.tar.xz
./configure --prefix=/home/user/myroot && make && make install
@dinukasal
dinukasal / spark_pi_cluster.md
Created November 8, 2017 16:34 — forked from datalove/spark_pi_cluster.md
Getting Spark up and running on RPi

Before starting

  • Download Spark 1.4 to your local machine (laptop, or PC)
  • Go to 192.168.1.1 to get local IPs for newly connected RPis

Configure each Raspberry Pi

Log into the new Raspberry Pi from your machine

  • ssh pi@192.168.1.XXX (default password for pi user is raspberry)
@dinukasal
dinukasal / run.py
Created November 1, 2017 15:28
Plot logcat from android device in ubuntu
import pyqtgraph as pg
import time
plt = pg.plot()
def update(data):
plt.plot(data, clear=True)
class Thread(pg.QtCore.QThread):
@dinukasal
dinukasal / curl_example.cpp
Created October 16, 2017 14:14 — forked from alghanmi/curl_example.cpp
cURL C++ Example
#include <iostream>
#include <string>
#include <curl/curl.h>
static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp)
{
((std::string*)userp)->append((char*)contents, size * nmemb);
return size * nmemb;
}
@dinukasal
dinukasal / index.html
Created September 25, 2016 09:36 — forked from stesie/index.html
AWS IoT-based serverless JS-Webapp Pub/Sub demo
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>AWS IoT Pub/Sub Demo</title>
</head>
<body>
<h1>AWS IoT Pub/Sub Demo</h1>
<form>
<button type="button" id="connect">connect!</button>