Skip to content

Instantly share code, notes, and snippets.

View saii9's full-sized avatar
😄
Currently learning skills other than coding, will be a while to my next checkin

Sai saii9

😄
Currently learning skills other than coding, will be a while to my next checkin
  • Wayfair LLC
  • Boston
View GitHub Profile
@saii9
saii9 / temp.txt
Created March 21, 2024 15:52
temp.txt
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Image Checkboxes</title>
<style>
body {
font-family: sans-serif;
margin: 20px;
@saii9
saii9 / simple_nc_server
Created June 5, 2020 04:22
steps to star as static http server
cat > start.sh
while true; do { echo -e 'HTTP/1.1 200 OK\r\n'; sh server.sh; } | nc -l 8081; done
cat > server.sh
#!/bin/bash
response=`cat response.json`
echo "$response"
cat > response.json
Hello World
@saii9
saii9 / static-https-file-server.go
Created June 12, 2019 19:29
A simple static https file server
package main
// usage: compile and create static-https-file-server.exe
// set env variables TLSSERVERPORT FILESERVERDIR TLSSERVERCERT TLSSERVERKEY as the names imply
// cmd :
// TLSSERVERPORT=<fill> \
// FILESERVERDIR="<fill>" \
// TLSSERVERCERT="<fill>" \
// TLSSERVERKEY="<fill>" \
// ./static-https-file-server.exe
// create a self signed tomcat to be used with tomcat
//generate a private key
openssl genrsa -des3 -out tomcat.key 4096
//generate a acert
openssl req -new -key tomcat.key -out tomcat.csr
//generate cert and key pair
//openssl req -x509 -nodes -sha256 -newkey rsa:2048 -keyout tomcat.key -out tomcat.crt
@saii9
saii9 / end_to_end_encryption.js
Created April 16, 2019 15:37
end to end encryption to encrypt body with symmetric key and meta data in header with asymmetric key
const crypto = require('crypto');
const path = require("path");
const fs = require("fs");
const encryptStringWithRsaPublicKey = function(toEncrypt, relativeOrAbsolutePathToPublicKey) {
const absolutePath = path.resolve(relativeOrAbsolutePathToPublicKey);
const publicKey = fs.readFileSync(absolutePath, "utf8");
const encrypted = crypto.publicEncrypt(publicKey, Buffer.from(toEncrypt));
return encrypted.toString("base64");
};
@saii9
saii9 / node_spawn_delay_test.js
Created March 21, 2019 19:30
Node spawn delay test
const cluster = require('cluster');
if(cluster.isMaster){
function test(num){
let workers = {};
let count = num;
for (let i = 0; i < num; i++) {
workers[i] = [];
workers[i].push((new Date).getTime());
const worker = cluster.fork();
@saii9
saii9 / s3-v4-file-download.sh
Created November 13, 2018 20:22
download file from s3 using curl v4 authentication
#!/bin/bash
set -e
# set -x
function log(){
echo "$(date -u +'%Y%m%dT%H%M%SZ') - $*"
}
# variable declaration - start
bucket=<bucket>
V2V Intersection Collision Warning (ICW) Dec 2016
• We built an v2v communication framework to add applications that are related to driver assistance and autonomous driving.
• Apps like automatic emergency braking, lane-following, automated lane changing can be added on this framework. We implemented Intersection collision warning system to demonstrate the working of the framework.
• Sensor fusion of compass and GPS module to eliminate any glitches in the positioning reported by GPS module.
• The ICW system which is demonstrated in the below YouTube link, is an important active safety feature in autonomous driving. It is driver assistance system which warns driver when there is a probability of collision.
• Can detect Intersection Collision Warning, predict collision time and warn the driver accordingly.
• Code repo at GitHub: https:/github.com/saii9/Vehicle-Comn-nrf
• YouTube Link: https://www.youtube.com/watch?v=roOfH7tUPEg
@saii9
saii9 / systemd.txt
Last active July 8, 2018 21:38
Some usefull systemd commands
#to check SysV services
chkconfig --list | more
#To check systemd service files
systemctl list-unit-files
systemctl list-units
systemd
___________|___________
| | |
@saii9
saii9 / Busybox-compilation.txt
Last active May 19, 2018 19:53
busybox compilation for self ref. Not to be run as a shell script
sudo apt-get install libncurses5-dev libncursesw5-dev unzip lzop u-boot-tools
#in a clean working directory donwload busybox
wget https://busybox.net/downloads/busybox-1.28.3.tar.bz2
tar xvjf busybox-1.28.3.tar.bz2
#downlaod linaro toolchain
wget https://releases.linaro.org/components/toolchain/binaries/latest/arm-linux-gnueabihf/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz
tar xvf gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz
#downlaod linux kernel source