Skip to content

Instantly share code, notes, and snippets.

View TamojitSaha's full-sized avatar
💭
tamojitsaha.info

Tamojit Saha TamojitSaha

💭
tamojitsaha.info
  • India
View GitHub Profile
@TamojitSaha
TamojitSaha / AWS_Python_Subscribe.py
Created September 12, 2020 13:10
Use AWS IoT Device SDK for Python to subscribe to a topic
from awscrt import io, mqtt, auth, http
from awsiot import mqtt_connection_builder
import time as t
import json
import threading
# Define ENDPOINT, CLIENT_ID, PATH_TO_CERT, PATH_TO_KEY, PATH_TO_ROOT, MESSAGE, TOPIC, and RANGE
ENDPOINT = "xxxxxxxxxx-ats.iot.us-east-2.amazonaws.com"
CLIENT_ID = "testDevice"
PATH_TO_CERT = "your_cert.crt"
@KentaYamada
KentaYamada / index.html
Created January 2, 2017 13:33
Python Flask + JavaScript XMLHttpRequest
<!DOCTYPE html>
<html>
<head>
<title>Practice AJAX</title>
<script type="text/javascript">
function do_ajax() {
var req = new XMLHttpRequest();
var result = document.getElementById('result');
req.onreadystatechange = function()
{
@edigaryev
edigaryev / feistel.c
Created December 20, 2011 05:52
Feistel cipher
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#define ROUNDS 8
#define ACTION_ENCRYPT "-e"
#define ACTION_DECRYPT "-d"
#define MODE_ECB "ecb"