Skip to content

Instantly share code, notes, and snippets.

View prasadtalasila's full-sized avatar

Prasad Talasila prasadtalasila

View GitHub Profile
@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
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 / 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.

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 / 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
@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 / 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"