This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo perf kvm stat record -e "kvm:*" | |
sudo perf kvm stat report --event=vmexit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%{ | |
#include <stdio.h> | |
#include <iostream> | |
using namespace std; | |
int linenumbers = 0; | |
extern int yylex(); | |
%} | |
%option noyywrap |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: ") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/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" |