Skip to content

Instantly share code, notes, and snippets.

View rounakdatta's full-sized avatar

Rounak Datta rounakdatta

View GitHub Profile
@rounakdatta
rounakdatta / esp32_ota_stm32.ino
Created September 6, 2019 19:43
Flash STM32 firmware from ESP32
#include <SPIFFS.h>
/*
*
* Copyright (C) 2017 CS.NOL https://github.com/csnol/1CHIP-Programmers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License,
* and You have to keep below webserver code
@rounakdatta
rounakdatta / add_dns_record.sh
Created August 22, 2023 12:14
No stress local proxying
echo '127.0.0.1 my-project.localhost' | sudo tee -a /etc/hosts
@rounakdatta
rounakdatta / private_transfer.md
Last active May 12, 2021 19:21
Moving private keys securely between devices

There is no transfer method more secure than using a physical USB storage to move the private key. However, often connecting physical devices is a barrier and at other times is an opposite wind. So, we'll create a simple HTTP server over a private (home) network and use that for the transfer.

Origin

Let us first export the GPG private and public keys:

gpg --output private.key --armor --export-secret-keys me@email.com
gpg --output public.key --armor --export me@email.com
@rounakdatta
rounakdatta / multithreadedMergeSort.py
Last active November 15, 2020 11:10
Multithreaded Merge Sort
import _thread
from threading import Thread
class MergeSorter:
def merge(self, left, right, myArray):
i = 0
j = 0
k = 0
@rounakdatta
rounakdatta / chrome2pass.py
Created August 29, 2020 21:41
export from Chrome Passwords to standard pass
#!/usr/bin/env python3
# Copyright 2015 David Francoeur <dfrancoeur04@gmail.com>
# Copyright 2017 Nathan Sommer <nsommer@wooster.edu>
# Modified 2020 Rounak Datta <rounakdatta12@gmail.com>
#
# This file is licensed under the GPLv2+. Please see COPYING for more
# information.
#
# Chrome allows export passwords to CSV. The CSV contains the following
@rounakdatta
rounakdatta / aws-temp-token.sh
Last active July 9, 2020 08:33 — forked from ogavrisevs/aws-temp-token.sh
Script to generate AWS STS token
#!/bin/bash
#
# Sample for getting temp session token from AWS STS
#
# aws --profile youriamuser sts get-session-token --duration 3600 \
# --serial-number arn:aws:iam::012345678901:mfa/user --token-code 012345
#
# Based on : https://github.com/EvidentSecurity/MFAonCLI/blob/master/aws-temp-token.sh
#
@rounakdatta
rounakdatta / overleafTips.md
Last active May 2, 2020 14:13
Overleaf tips

Correcting citations

Regex for searching citations on Overleaf (looks like [4], [64]): [[0-9]+]

@rounakdatta
rounakdatta / kafka.md
Created March 26, 2020 05:32 — forked from ashrithr/kafka.md
kafka introduction

Introduction to Kafka

Kafka acts as a kind of write-ahead log (WAL) that records messages to a persistent store (disk) and allows subscribers to read and apply these changes to their own stores in a system appropriate time-frame.

Terminology:

  • Producers send messages to brokers
  • Consumers read messages from brokers
  • Messages are sent to a topic
@rounakdatta
rounakdatta / tmux-cheatsheet.markdown
Created March 25, 2020 05:41 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@rounakdatta
rounakdatta / ConsumerExample.scala
Created March 20, 2020 05:50 — forked from fancellu/ConsumerExample.scala
Kafka Producer/Consumer Example in Scala
import java.util
import org.apache.kafka.clients.consumer.KafkaConsumer
import scala.collection.JavaConverters._
object ConsumerExample extends App {
import java.util.Properties