Skip to content

Instantly share code, notes, and snippets.

View VedantParanjape's full-sized avatar
🎯
Focusing

Vedant Paranjape VedantParanjape

🎯
Focusing
View GitHub Profile
sudo qemu-system-x86_64 -s \
-nographic \
--enable-kvm \
-drive "file=/home/vedant/images/focal-server-cloudimg-amd64.qcow2,format=qcow2"
-drive "file=/home/vedant/images/user-data.img,format=raw" \
-m 16G \
-cpu host \
-device e1000,netdev=net0 \
-qmp tcp:127.0.0.1:5555,server,nowait \
-netdev user,id=net0,hostfwd=tcp::4444-:22 \
sudo perf kvm stat record -e "kvm:*"
sudo perf kvm stat report --event=vmexit
%{
#include <stdio.h>
#include <iostream>
using namespace std;
int linenumbers = 0;
extern int yylex();
%}
%option noyywrap
@VedantParanjape
VedantParanjape / blockchain_basic.py
Created April 13, 2020 16:54
A basic block chain implementation | Learnt during FDP (Factulty development program) 2019 Blockchain
from time import time
import hashlib
import json
from flask import Flask, jsonify, request
from uuid import uuid4
class Blockchain:
def __init__(self):
self.current_transactions = []
self.chain = []
@VedantParanjape
VedantParanjape / ID_Card_Data_Generation_Script.py
Last active April 13, 2020 16:52
Script to generate students passport size pics with file name as their college id
# Reading an excel file using Python
import xlrd
import os
# Give the location of the file
loc = ("form.xlsx")
# To open Workbook
wb = xlrd.open_workbook(loc)
sheet = wb.sheet_by_index(0)
@VedantParanjape
VedantParanjape / git_password_copy.py
Last active March 28, 2020 11:16
Copies password from a file to the clipboard, clears the password after 10 seconds
import pyperclip
import hashlib
from daemonize import Daemonize
import time
import stdiomask
hash_const = # enter sha256 hash of your access passcode
def main():
passcode = stdiomask.getpass("enter passcode: ")
import traceback
import numpy as np
import pyModeS as pms
from rtlsdr import RtlSdr
import time
sampling_rate = 2e6
smaples_per_microsec = 2
modes_frequency = 1090e6
import pyModeS as pms
def convert_timestamp(msg):
msg = bytes(msg, "utf-8")
nanosec = (msg[2] & 0x3f) << 24 | msg[3] << 16 | msg[4] << 8 | msg[5]
daysec = msg[0] << 10 | msg[1] << 2 | msg[2] >> 6
hh = int((daysec/3600) % 24)
@VedantParanjape
VedantParanjape / install_ros.sh
Created March 9, 2020 11:15
ROS installation script
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
curl -sSL 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xC1CF6E31E6BADE8868B172B4F42ED6FBAB17C654' | sudo apt-key add -
sudo apt-get update
sudo apt-get install ros-kinetic-desktop-full
@VedantParanjape
VedantParanjape / install_codes.sh
Last active March 4, 2020 15:02
Installation script for ROS WS 2020
#/bin/sh
#### check if rosserial is installed ########################################
dpkg -s "ros-kinetic-rosserial" &> /dev/null
if [ $? -eq 0 ]
then
echo -e "\e[42mrosserial is INSTALLED!\e[49m"
else
echo -e "\e[101mrosserial is NOT INSTALLED!\e[49m"
echo -e "\e[101mINSTALLING rosserial!\e[49m"