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 / .gitlab-ci.yml
Created February 4, 2018 14:28
Gitlab CI for react-native builds
image: openjdk:8-jdk
# image: jangrewe/gitlab-ci-android
variables:
ANDROID_COMPILE_SDK: "23"
ANDROID_BUILD_TOOLS: "23.0.1"
ANDROID_SDK_TOOLS: "3859397"
before_script:
@dinukasal
dinukasal / listen_udp.sh
Created November 16, 2017 06:05
Capture all udp packets on eth0
sudo tcpdump -i eth0 udp -vv -X
@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;
}