Skip to content

Instantly share code, notes, and snippets.

View pulsejet's full-sized avatar

Varun Patil pulsejet

View GitHub Profile
# https://huggingface.co/google/siglip-base-patch16-256-multilingual
# install huggingface/transformers from source
# install optimum from this branch: https://github.com/huggingface/optimum/tree/xenova-add-siglip
# install onnx onnxruntime etc.
# Use T5 tokenizer fast and save_pretrained to get tokenizers.json
# https://github.com/huggingface/transformers/blob/main/src/transformers/models/t5/tokenization_t5_fast.py
# clone xenova/transformers.js and use the script to convert model
@pulsejet
pulsejet / tags.sql
Created March 13, 2024 02:04
Memories tags SQL query
WITH RECURSIVE oc_cte_folders_all(fileid, name, hidden) AS (
SELECT
f.fileid,
f.name,
(0) AS hidden
FROM
oc_filecache f
WHERE
(
f.fileid IN ('56')
@pulsejet
pulsejet / testbed-diagnostic.ts
Last active March 1, 2024 06:14
NDN-Play testbed diagnostic
/**
* Testbed diagnostic script for NDN play.
* http://play.ndn.today/?testbed=1&script=https://gist.githubusercontent.com/pulsejet/15278a61b47df6066346d36f9071065a/raw/testbed-diagnostic.ts
* It will use FCH to connect to the nearest testbed node and ping all nodes.
* A table will be printed to the JS console with ping times.
*/
import { connectToNetwork } from "@ndn/autoconfig";
import { Endpoint } from "@ndn/endpoint";
import { Forwarder } from "@ndn/fw";
@pulsejet
pulsejet / consumer.cpp
Last active January 26, 2023 04:10
ndn-cxx example
#include <ndn-cxx/face.hpp>
#include <iostream>
void
onData(const ndn::Interest&, const ndn::Data& data)
{
std::cout << "Received Data: " << data << std::endl;
}
void
@pulsejet
pulsejet / qsv-docker.sh
Last active September 28, 2023 00:58
Install QSV in debian docker
#!/bin/bash
sudo apt-get update
sudo apt-get remove -y libva ffmpeg
sudo apt-get install -y \
autoconf libtool libdrm-dev xorg xorg-dev openbox \
libx11-dev libgl1-mesa-glx libgl1-mesa-dev \
xcb libxcb-xkb-dev x11-xkb-utils libx11-xcb-dev \
libxkbcommon-x11-dev libxcb-dri3-dev \
vim cmake git nasm build-essential
@pulsejet
pulsejet / demo.cpp
Created September 19, 2022 01:43
SVS example for MiniNDN
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012-2022 University of California, Los Angeles
*
* This file is part of ndn-svs, synchronization library for distributed realtime
* applications for NDN.
*
* ndn-svs library is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, in version 2.1 of the License.
@pulsejet
pulsejet / gist:d82b205d9bfed2b65dc86c704347f5ff
Last active May 9, 2022 19:51
YaNFD profiling content store
See comments
Testing with ndncatchunks and ndnputchunks, 1gb file. With content store is very slow (few mbps), without content store is ~2gbps.
@pulsejet
pulsejet / scenario.conf
Created September 9, 2021 16:05
DCT test scenario
[nodes]
Texas: _ network=/world router=/Texas.Router/
California: _ network=/world router=/California.Router/
s1: _ network=/world router=/s1.Router/
s2: _ network=/world router=/s2.Router/
bob: _ network=/world router=/bob.Router/
alice: _ network=/world router=/alice.Router/
[links]
alice:bob delay=10ms
alice:s1 delay=10ms
@pulsejet
pulsejet / chat-prefix.cpp
Created February 17, 2021 10:23
Chat application serving on separate prefix on ndn-svs
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012-2021 University of California, Los Angeles
*
* This file is part of ndn-svs, synchronization library for distributed realtime
* applications for NDN.
*
* ndn-svs library is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, in version 2.1 of the License.
@pulsejet
pulsejet / rsat.Dockerfile
Created December 3, 2020 05:56
Dockerfile for UCLA RSat
FROM ubuntu:latest
WORKDIR /root
COPY rsat_SAT-Race08_bin.tar.gz .
RUN tar -xzvf rsat_SAT-Race08_bin.tar.gz &&\
rm rsat_SAT-Race08_bin.tar.gz
WORKDIR /root/rsat_SAT-Race08_final_bin
CMD /bin/bash ./rsat.sh /dev/stdin