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 / 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: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")
@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 / 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 ./
@shikanime
shikanime / dataset_timeserie_window.py
Last active May 20, 2022 15:29
Tensorflow sketchbook
import tensorflow as tf
window_size = 2
label_size = 1
inputs = tf.random.stateless_uniform(shape=(10, 3), seed=(2, 3))
dataset = tf.data.Dataset.from_tensor_slices(inputs)
dataset = dataset.window(window_size + label_size, shift=label_size, drop_remainder=True)
dataset = dataset.flat_map(lambda window: window.batch(window_size + label_size))
@shikanime
shikanime / main.hs
Created May 4, 2022 12:45
Fix VSCode Server
#! /usr/bin/env nix-shell
#! nix-shell --pure -i runghc -p "haskellPackages.ghcWithPackages (pkgs: [ pkgs.turtle ])"
{-# LANGUAGE OverloadedStrings #-}
import Turtle
main = sh $ do
homedir <- home
subdir <- ls $ homedir </> ".vscode-server/bin/"
let nodepath = subdir </> "node"