Skip to content

Instantly share code, notes, and snippets.

View vmasdani's full-sized avatar

Muhammad Valian Masdani vmasdani

View GitHub Profile
@vmasdani
vmasdani / prepare-command.sh
Last active May 8, 2026 15:52
ai-native techstack
run:
pnpm dlx shadcn@latest init --preset b5dfn4ega --template next
cd <projectname>
pnpm dlx shadcn@latest add dashboard-01
pnpm dlx shadcn@latest add sidebar-07
pnpm dlx shadcn@latest add login-01
try: pnpm build
often will get tooltip error. fix first
when necessary: pnpm approve-builds
@vmasdani
vmasdani / database tuning.md
Last active October 24, 2024 07:58
database tuning

Todo:

  1. increase mysql max connections limit (128GB RAM, max 20.000)
  2. increase open file limit
  3. increase min/max heapsize (Xmx, Xms), optimize to 128GB RAM (16-64)
  4. increase hikari connection pool
  5. innodb buffer size (70-80% of RAM)

1. increase mysql max connections limit (128GB RAM, max 20.000)

# /etc/mysql/mariadb.conf.d/50-server.conf
@vmasdani
vmasdani / hailo.py
Created October 2, 2024 10:35
hailo
import gi
gi.require_version("Gst", "1.0")
from gi.repository import Gst, GLib
import os
import argparse
import supervision as sv
import multiprocessing
import numpy as np
import setproctitle
<script>
// https://spectator-metrics.vercel.app/
const contributors = [
{ name: "arnoldart", lines: 2001, include: true },
{ name: "artileda", lines: 1, include: false },
{ name: "dicha", lines: 18413, include: true },
{ name: "herlangga", lines: 1136, include: true },
{ name: "jason", lines: 217, include: false },
{ name: "raymond", lines: 976, include: true },
@vmasdani
vmasdani / crostini sd card apps
Last active March 10, 2022 14:23
crostini sd card apps
# In developer console shell
mkfs.ext4 /dev/sda1
sudo chown -R :users /media/removable/SD\ Card
sudo chmod -R ugo+rwx /media/removable/SD\ Card
# In crosh
vmc create-extra-disk --size=32G --removable-media "SD Card/extra-disk.img"
vmc stop termina
@vmasdani
vmasdani / crouton steps sd card
Last active March 6, 2022 03:12
crouton steps sd card
1. format sd card to ext4
# mkfs -t ext4 -O ^has_journal /dev/sdb1
**NOTE: replace /dev/sdb1 with the listed name of the external drive. **
**NOTE: Somehow in last 128gb sd card I bought, I had to disable journal w/ -O ^has_journal **
2. add new line to ~/.bashrc containing
@vmasdani
vmasdani / index.js
Created October 19, 2021 07:08
express sub-app
const express = require("express");
const subapp1 = express();
const subapp2 = express();
subapp1.get("/", async (req, res) => {
res.json({ hello: "from sub-app 1" });
});
subapp2.get("/", async (req, res) => {
@vmasdani
vmasdani / arch dep
Last active March 3, 2022 17:06
arch dep
Designed for endeavor OS
Instlal linux lts kernel:
sudo pacman -Syu linux-lts linux-lts-headers
flutter - flutter(aur) android-studio(aur) android-sdk-platform-tools(aur) android-udev(aur)
java - jdk8-openjdk intellij-idea-community-edition(aur)
go - go
nodejs - nodejs-lts-fermium npm
@vmasdani
vmasdani / ubuntudeps.txt
Last active August 20, 2021 05:18
fingerprint recognition cuevas1208/fingerprint_recognition python3.8
Way to make cuevas1208/fingerprint_recognition work in python 3.8
bump
opencv-contrib-python==4.2.0.32
python -m pip install wheel
sudo apt install libjpeg-dev libfreetype-dev libblas-dev liblapack-dev gfortran
@vmasdani
vmasdani / build.sh
Created December 31, 2020 04:02
Elm minification script
# Install nodejs/npm and uglifyjs first
npm i -g uglify-js
# This is the actual script. Build files will be located in dist folder
# Ref from here: https://guide.elm-lang.org/optimization/asset_size.html
elm make --optimize src/Main.elm --output=main-unoptimised.js &&\
uglifyjs main-unoptimised.js --compress 'pure_funcs="F2,F3,F4,F5,F6,F7,F8,F9,A2,A3,A4,A5,A6,A7,A8,A9",pure_getters,keep_fargs=false,unsafe_comps,unsafe' | uglifyjs --mangle --output main.js &&\
echo "Compiled size:$(cat main-unoptimised.js | wc -c) bytes (main-unoptimised.js)" &&\