Skip to content

Instantly share code, notes, and snippets.

@jptalusan
jptalusan / Geohashing and Geospatial Indexing.ipynb
Created November 11, 2021 06:53
For geohashing and geospatial indexing as well as visualization.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jptalusan
jptalusan / pingarper.sh
Created August 2, 2019 06:53
For pinging things connected to the ethernet at port eno1 of the device you are using.
#!/bin/bash
declare -A devices
devices["name"]="MAC_address"
for i in "${!devices[@]}"
do
#echo "key: $i"
#echo "value: ${devices[$i]}"
@jptalusan
jptalusan / base.py
Created July 11, 2019 07:45
Demonstration of using pub-sub with ZMQstream base classes.
import multiprocessing
from zmq.eventloop import ioloop, zmqstream
from zmq.utils import jsonapi as json
import zmq
decode = lambda x: x.decode('utf-8')
encode = lambda x: x.encode('ascii')
class ZmqProcess(multiprocessing.Process):
"""
@jptalusan
jptalusan / distributed.bib
Last active April 24, 2022 17:39
Distributed IoT references
@INPROCEEDINGS{nearcloud,
author={J. P. Talusan and Y. Nakamura and T. Mizumoto and K. Yasumoto},
booktitle={2018 IEEE 42nd Annual Computer Software and Applications Conference (COMPSAC)},
title={Near Cloud: Low-cost Low-Power Cloud Implementation for Rural Area Connectivity and Data Processing},
year={2018},
volume={02},
number={},
pages={622-627},
abstract={Information and communication technologies (ICTs) has enabled growth in developed countries and urban cities through improvements in communication systems, devices and applications. In rural areas, especially in developing countries, ICT penetration is not as high, often due to lack of available infrastructure and funding. With the increasing availability of Internet-of-Things (IoT) devices, low-cost large-scale deployments have become possible even in rural areas. We design, develop and implement, Near Cloud, a cloud-less platform that allows users and IoT devices to communicate and share information. This is built on top of a wireless mesh netw
@jptalusan
jptalusan / vid-create.py
Created November 26, 2018 04:37
Create video from png files
#!/usr/local/bin/python3
#Needs to install ffmpeg
#Run: python vid-create.py
#ffmpeg -i input.avi output.mp4
#pip install opencv-python
##########
import cv2
@jptalusan
jptalusan / AP_pi_settings
Last active September 27, 2018 06:05
Pi Connected to gateway via mesh network only, acts as AP
#Pi-7: Connected to internet only via Mesh network and serves as access point
#This serves as the bridge connecting the whole mesh to the internet
# This will work but you lose the ability to SSH to this?
# It's either that or it will lose the AP ability?
# After setting all the configs, just run ./setup-all.sh
#Takes time before activating/being in mesh and having internet
#Don't forget to setup the iptables and save it on reboot
#Don't forget to setup the AP as well. i think the main point here is in hostapd.conf
sudo apt-get install dnsmasq hostapd
@jptalusan
jptalusan / gateway_pi_settings
Last active September 27, 2018 06:03
Pi Connected to eth-0 acting as gateway
#Pi-6: Connected to eth0 internet
#This serves as the bridge connecting the whole mesh to the internet
# This will work but you lose the ability to SSH to this?
# It's either that or it will lose the AP ability?
# After setting all the configs, just run ./setup-all.sh
# ****DONT TRUST ALL hahaha until Sept. 27, when i will retry it again
#OK So far all these works. I'm not sure if there are other config files that need to be changed.
# I just ran setup-all.sh on this and manscript.sh on pi-7 and after a while it works.
# sudo apt-get install dnsmasq hostapd
#I'll try again now when I attempt to change battery of pi-7 after restart.