Skip to content

Instantly share code, notes, and snippets.

View prasadtalasila's full-sized avatar

Prasad Talasila prasadtalasila

View GitHub Profile
@prasadtalasila
prasadtalasila / mqtt-client.py
Last active June 18, 2024 11:43
CPSENS streaming
import matplotlib.pyplot as plt
import numpy as np
from paho.mqtt.client import Client as MQTTClient
from paho.mqtt.client import CallbackAPIVersion
from paho.mqtt.client import MQTTv311
import queue
import struct
import time
HOST = "hostname"
@prasadtalasila
prasadtalasila / ML-summary.md
Last active February 8, 2019 11:22
Machine learning summary

(Based on explanation by Dr. Jacob Høxbroe Jeppesen)

Introduction

Machine learning is the field of research and applications that has branched off from artificial intelligence in 1980s. Now, machine learning researchers try to develop engineering techniques that can help applications learn from existing data to perform better.

Since, machine learning is performing approximation, we can call it a higher dimensional regression technique based on statistics.


Techniques

@prasadtalasila
prasadtalasila / all.yml
Last active October 19, 2018 16:44
Install Ceph on a VM cluster using Ansible
---
# Variables here are applicable to all host groups NOT roles
# This sample file generated by generate_group_vars_sample.sh
# Dummy variable to avoid error because ansible does not recognize the
# file as a good configuration file when no variable in it.
dummy:
# You can override vars by using host or group vars

The following installation methods were tried out.

Working instances of Ceph OSD service

Container-based solution (partially working)

With some trial and error, I managed to get a stand alone Ceph Object Storage Device (OSD) service working. The instructions to replicate the installation are as follows.

@prasadtalasila
prasadtalasila / gist:a5548c181a16846dc18466170897f925
Created March 21, 2018 11:30
virtualenv like setup for node.js projects
Assume that a node project exists in /home/alan/autolabjs with the corresponding dependencies in
/home/alan/autolabjs/node_modules. Let's also say we have mocha dependency installed in node_modules.
Now, a regular way to use the installed dependencies is to execute mocha is as follows.
$cd /home/alan/autolabjs/
$./node_modules/.bin/mocha <rest of the command>
Since the soft links to all the installed node modules are available in
/home/alan/autolabjs/node_modules/.bin directory, we can add this directory to the PATH variable
to utilise all the installed dependencies like regular shell utilities.
create a random arrangement of an input sequence (good for exam seating arrangements)
$seq <first_no> <last_no> | shuf
If we have pre-determined list of students, we can use "shuf" command to generate the random permutation of the students
and then give them a sequential seating order.
$shuf student_list.txt > random_order_list.txt
@prasadtalasila
prasadtalasila / Dan Ingalls notes
Created May 21, 2017 16:09
Notes from Dan Ingalls
Smalltalk has
Class - defines behaviors of instances
Object - an instance of some class
Selector - Name of a message
Message - selector with parameters
Method - code / procedure found in class for responding to a message
It is not essential to have classes, we can do OOP with just objects
@prasadtalasila
prasadtalasila / scratch pad
Last active May 22, 2017 13:47
scratch pad
Interasting courses
OS using Rust, Prof David Evans rust-class.org/
Jude Nelson, student of Prof Larry Peterson
http://www.cs.princeton.edu/~jcnelson/index.html amazing work
@prasadtalasila
prasadtalasila / Alan Kays Objects
Last active May 30, 2017 08:14
advice to oop students
From paper
An Early History of Smalltalk, Alan Kay
(Ref: http://www.vpri.org/pdf/hc_smalltalk_history.pdf)
Essential principles
1) Everything is an object
2) Objects communicate by sending and receiving messages (in terms of objects)
3) Objects have their own memory (in terms of objects)
Principles that kept on changing between versions of smalltalk
@prasadtalasila
prasadtalasila / alan kay notes
Last active May 25, 2017 18:17
notes from videos
As the complexity increases, architecture dominates materials.
each object should be thought of as having a virtual computer inside.
In networked environment, each object must have a URL and an IP address.
Object solutions need a universal interface language using which an object can interact with another object. HTTP-like REST protocols seem like good candidates for this kind of work. SOAP was actually written for this kind of work, but never took off.
It seems Alan Kay's idea of universal interface language was much broader than HTTP/SOAP.
programming in the large and programming in the small are very very different.