Skip to content

Instantly share code, notes, and snippets.

from selenium import webdriver
# Set Chrome Options
options = webdriver.ChromeOptions()
options.add_argument("–disable-notifications")
options.add_argument("–no-sandbox")
options.add_argument("–disable-dev-shm-usage")
options.add_argument("–enable-logging")
options.add_argument("–disable-blink-features=AutomationControlled")
options.add_experimental_option("detach", True)
@shivahari
shivahari / vmconfig.json
Last active January 22, 2024 14:12
vmconfig JSON to create a microVM using Firecracker
{
"boot-source": {
"kernel_image_path": "vmlinux-6.1.74",
"boot_args": "ro console=ttyS0 noapic reboot=k panic=1 pci=off"
},
"drives": [
{
"drive_id": "rootfs",
"path_on_host": "ubuntu-22.04.ext4",
"is_root_device": true,
@shivahari
shivahari / setup_tap.sh
Created January 21, 2024 14:44
TAP device setup script
#!/bin/bash
# https://github.com/firecracker-microvm/firecracker/blob/main/docs/getting-started.md
#
set -eux
TAP_DEV="tap0"
TAP_IP="172.16.0.1"
MASK_SHORT="/30"
@shivahari
shivahari / Tags.xml
Created August 17, 2023 20:35
Stackoverflow Tags
<?xml version="1.0" encoding="utf-8"?>
<tags>
<row Id="1" TagName="comments" Count="198" ExcerptPostId="84634" WikiPostId="84633" />
<row Id="3" TagName="code-smell" Count="167" ExcerptPostId="133740" WikiPostId="133739" />
<row Id="4" TagName="programming-languages" Count="1392" ExcerptPostId="4802" WikiPostId="4801" />
<row Id="5" TagName="usage" Count="8" />
<row Id="7" TagName="business" Count="125" ExcerptPostId="109610" WikiPostId="109609" />
<row Id="8" TagName="project-management" Count="919" ExcerptPostId="48555" WikiPostId="48554" />
<row Id="9" TagName="development-process" Count="729" ExcerptPostId="143950" WikiPostId="143949" />
<row Id="11" TagName="performance" Count="826" ExcerptPostId="107405" WikiPostId="107404" />
@shivahari
shivahari / semantic_search.py
Last active September 18, 2023 08:48
FAISS_semantic_search_app
# reference https://deepnote.com/blog/semantic-search-using-faiss-and-mpnet
"""
A semantic search tool
"""
import pickle
from pathlib import Path
import faiss
import torch
from bs4 import BeautifulSoup
from transformers import AutoTokenizer, AutoModel