Skip to content

Instantly share code, notes, and snippets.

View shikanime's full-sized avatar
🔮
Elixir Alchemist

Shikanime Deva shikanime

🔮
Elixir Alchemist
View GitHub Profile
@shikanime
shikanime / fix-iptable.sh
Created February 25, 2024 12:28
Fix Kubernetes Operator Tailscale Ingress
# Load ip6table_filter module
modprobe ip6table_filter
# Persist Reboot
echo ip6table_filter | sudo tee -a /etc/modules-load.d/k3s.conf
@shikanime
shikanime / vcgencmd_power_report.sh
Created February 23, 2024 01:38
Raspberry PI power report
#!/usr/bin/env bash
SCRIPT=$(basename "$0")
# fetch status
STATUS=$(vcgencmd get_throttled | cut -d "=" -f 2)
# decode - https://www.raspberrypi.com/documentation/computers/os.html#get_throttled
echo "vcgencmd get_throttled ($STATUS)"
IFS=","
@shikanime
shikanime / main.py
Created February 16, 2024 16:30
Simple Retrieval using LCEL
from operator import itemgetter
from langchain.prompts.chat import (
ChatPromptTemplate,
HumanMessagePromptTemplate,
SystemMessagePromptTemplate,
)
from langchain.chains.combine_documents import create_stuff_documents_chain
from langchain_core.output_parsers import StrOutputParser
from langchain.prompts.prompt import PromptTemplate
@shikanime
shikanime / 📊 Weekly development breakdown
Last active February 14, 2024 00:14
Weekly weekly dev (╯°□°)╯︵ ┻━┻
Python 57 mins █████████▌░░░░░░░░░░░ 45.8%
Bash 30 mins █████░░░░░░░░░░░░░░░░ 24.2%
YAML 16 mins ██▊░░░░░░░░░░░░░░░░░░ 13.1%
Nix 10 mins █▊░░░░░░░░░░░░░░░░░░░ 8.3%
JSON 6 mins █░░░░░░░░░░░░░░░░░░░░ 5.3%
@shikanime
shikanime / sonarqube.yaml
Last active January 8, 2024 10:50
SonarQube configuration for Airbyte
spec:
type: Spec
documentation_url: https://docs.sonarsource.com/
connection_specification:
type: object
$schema: http://json-schema.org/draft-07/schema#
required:
- user_token
- qualifiers
- component_keys
@shikanime
shikanime / settings.json
Created October 10, 2023 20:54
VSCode VIM Settings for Colemak Users Based on jooize/vim-colemak 🤗
{
"vim.commandLineModeKeyBindingsNonRecursive": [
{
"after": ["<C-Left>"],
"before": ["<C-L>"]
},
{
"after": ["<C-Right>"],
"before": ["<C-Y>"]
}
@shikanime
shikanime / CreateModel.sql
Last active August 31, 2023 16:26
Exploring similarity search based on text embedding. The model, seamlessly integrated into the execution engine, offers user-friendly functionality and a performance advantage over any remote solutions.
CREATE OR REPLACE MODEL
search.universal_sentence_encoder_large OPTIONS(model_type='tensorflow',
model_path='gs://shikanime-studio-labs/universal-sentence-encoder-multilingual-large/*')
@shikanime
shikanime / CreateModel.sql
Last active August 31, 2023 16:24
Conducting experimentation involving similarity search through text embedding using Vertex AI. To sum up, encountering a familiar issue seen in several data products that incorporate Vertex AI—experiencing excessively high network overhead.
CREATE OR REPLACE MODEL
search.vertex_ai_text_embeddings REMOTE
WITH CONNECTION `us.vertex_ai` OPTIONS(REMOTE_SERVICE_TYPE="CLOUD_AI_TEXT_EMBEDDING_MODEL_V1")
# If we are a computer with nix available, then use that to setup
# the build environment with exactly what we need.
if has nix; then
use flake
fi
# Automatically setup a virtualenv
layout python
# Add well known WSL CUDA library
@shikanime
shikanime / Dockerfile
Last active June 14, 2022 16:17
Extreme minimalist Docker for Strapi
FROM node:14-bullseye-slim AS runtime
# Set the working directory
WORKDIR /usr/src/unicorn
# Define the build environment
ENV NODE_ENV production
# Copy the application dependencies
COPY package.json yarn.lock ./