Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: $0 <max_suffix_number>"
exit 1
fi
MAX_SUFFIX_NUMBER=$1
BASE_URL="https://huggingface.co/datasets/mteb/raw_arxiv/resolve/main/train_"
@neelabalan
neelabalan / load_mongo.py
Created August 21, 2024 07:31
Load from gh archive
import os
import gzip
import json
from pymongo import MongoClient
mongo_uri = "mongodb://nebula.local:27017"
client = MongoClient(mongo_uri)
db = client['analytics']
collection = db['gh_archive']
@neelabalan
neelabalan / script
Created August 4, 2024 15:43
Remove bloatware from debian base installation
sudo apt remove gnome-2048 \
firefox
gnome-todo
thunderbird
gnome-tetravex
gnome-taquin
swell-foop
gnome-sudoku
gnome-robots
gnome-mines
@neelabalan
neelabalan / slog_console_handler.go
Created July 27, 2024 08:05 — forked from wijayaerick/slog_console_handler.go
Example ConsoleHandler for golang.org/x/exp/slog Logger
// ConsoleHandler formats slog.Logger output in console format, a bit similar with Uber's zap ConsoleEncoder
// The log format is designed to be human-readable.
//
// Performance can definitely be improved, however it's not in my priority as
// this should only be used in development environment.
//
// e.g. log output:
// 2022-11-24T11:40:20+08:00 DEBUG ./main.go:162 Debug message {"hello":"world","!BADKEY":"bad kv"}
// 2022-11-24T11:40:20+08:00 INFO ./main.go:167 Info message {"with_key_1":"with_value_1","group_1":{"with_key_2":"with_value_2","hello":"world"}}
// 2022-11-24T11:40:20+08:00 WARN ./main.go:168 Warn message {"with_key_1":"with_value_1","group_1":{"with_key_2":"with_value_2","hello":"world"}}
@neelabalan
neelabalan / steps
Created July 12, 2024 13:25
fix bluetooth xubuntu 24 - https://askubuntu.com/a/1432859
sudo apt install libspa-0.2-bluetooth
systemctl --user restart wireplumber
@neelabalan
neelabalan / LC_COLORS.md
Created July 12, 2024 04:55 — forked from thomd/LC_COLORS.md
LSCOLORS & LS_COLORS

alternatively use: http://geoff.greer.fm/lscolors/

LSCOLORS

The value of this variable describes what color to use for which attribute when colors are enabled with CLICOLOR. This string is a concatenation of pairs of the format fb, where f is the foreground color and b is the background color.

The color designators are as follows:

a black

@neelabalan
neelabalan / keychron_k2.adoc
Created July 10, 2024 12:21 — forked from judaew/keychron_k2.adoc
Keychron K2 Manual

Keychron K2 Manual

Connect Bluetooth

On the side of the keyboard, switch the toggle to Bluetooth. Press fn+1 3 seconds and pair with device named Keychron K2.

  • fn+1 connect to 1st device

  • fn+2 connect to 2nd device

  • fn+3 connect to 3rd device

@neelabalan
neelabalan / packages
Created June 7, 2024 05:03
code interpreter installed packages
[('Babel', '2.14.0'),
('Brotli', '1.1.0'),
('CairoSVG', '2.5.2'),
('Cython', '0.29.36'),
('Faker', '8.13.2'),
('Fiona', '1.9.2'),
('Flask-CacheBuster', '1.0.0'),
('Flask-Cors', '4.0.0'),
('Flask-Login', '0.6.3'),
('Jinja2', '3.1.3'),
@neelabalan
neelabalan / steps
Created June 3, 2024 16:43
grafana remove
sudo systemctl stop grafana-server
sudo apt-get remove grafana
[optional]
sudo rm -i /etc/apt/sources.list.d/grafana.list
@neelabalan
neelabalan / Highlight.js
Created May 26, 2024 13:53
Text Highlight Componenet
// https://stackoverflow.com/a/56786860/4873716
const Highlighter = ({children, highlight}) => {
if (!highlight) return children;
const regexp = new RegExp(highlight, 'g');
const matches = children.match(regexp);
console.log(matches, parts);
var parts = children.split(new RegExp(`${highlight.replace()}`, 'g'));
for (var i = 0; i < parts.length; i++) {
if (i !== parts.length - 1) {