Skip to content

Instantly share code, notes, and snippets.

View naranyala's full-sized avatar

naranyala naranyala

View GitHub Profile
@naranyala
naranyala / install-tauri-deps.sh
Created August 31, 2025 17:05
fix tauri dependencies packages on various linux and run your first tauri app
#!/usr/bin/env bash
set -euo pipefail
log() { echo -e "\033[1;32m[INFO]\033[0m $*"; }
err() { echo -e "\033[1;31m[ERROR]\033[0m $*" >&2; }
detect_distro() {
if command -v dnf &>/dev/null; then echo "fedora"
elif command -v apt &>/dev/null; then echo "debian"
elif command -v pacman &>/dev/null; then echo "arch"
@naranyala
naranyala / install-zsh-with-plugins.sh
Created August 31, 2025 03:02
easy to install z shell (zsh) with plugins; try to "chmod +x install-zsh-with-plugins.sh" and execute
#!/usr/bin/env bash
set -euo pipefail
### CONFIG ###
LOG_FILE="/tmp/setup-zsh.log"
ZSHRC="$HOME/.zshrc"
ZSHRC_BACKUP="$HOME/.zshrc.backup.$(date '+%Y%m%d_%H%M%S')"
OH_MY_ZSH_DIR="$HOME/.oh-my-zsh"
ZSH_CUSTOM="${OH_MY_ZSH_DIR}/custom"
@naranyala
naranyala / bootstrap_raylib.c
Created August 26, 2025 15:27
easy setup raylib with nob.h
// gcc bootstrap_raylib.c -o bootstrap_raylib && ./bootstrap_raylib --project-path ./demo
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#ifdef _WIN32
#include <direct.h>
@naranyala
naranyala / bootstrap.c
Last active September 11, 2025 12:38
bootstrap your c-project faster with nob.h
// gcc bootstrap.c -o bootstrap && ./bootstrap --project-path ./sample
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#ifdef _WIN32
#include <direct.h>
@naranyala
naranyala / nobup.sh
Last active August 21, 2025 03:38
get the latest nob.h, the C's build system by tsoding (https://github.com/tsoding/nob.h)
#!/bin/sh
TARGET="nob.h"
BACKUP="${TARGET}.backup"
URL="https://raw.githubusercontent.com/tsoding/nob.h/main/nob.h"
# Function to extract version from nob.h
extract_version() {
grep -m1 'nob - v' "$1" | sed -E 's|/\* nob - (v[0-9]+\.[0-9]+\.[0-9]+).*|\1|'
}
@naranyala
naranyala / dashboard.html
Created August 10, 2025 03:15
the only one dashboard layout you need, of course mobile-friendly
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Minimal Dashboard</title>
<link rel="stylesheet" href="https://unpkg.com/open-props" />
<link rel="stylesheet" href="https://unpkg.com/open-props/normalize.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
@naranyala
naranyala / make-dotdesktop-for-nixpkgs.sh
Last active August 6, 2025 15:18
in context nix packages outside nixos, this script will make the packages have global ".desktop", making it globally available (cli and gui executable); to make every nix packages available in terminal (bash/zsh/etc) use this script: https://gist.github.com/naranyala/2203f889a3cb89c5cfe4599788bea915
#!/usr/bin/env bash
set -euo pipefail
# chmod +x make-dotdesktop-for-nixpkgs.sh
STORE_DIR="/nix/store"
DESKTOP_DIR="$HOME/.local/share/applications"
ICON_DIR="$HOME/.local/share/icons"
LOG_FILE="$HOME/nix-desktopify.log"
@naranyala
naranyala / make-global-symlinks-nixpkgs.sh
Last active August 6, 2025 16:27
the modern package manager for all linux distro, use `nix-shell -p <pkgname>`, then execute this script; for gui specific package use this script to create global shortcuts: https://gist.github.com/naranyala/312271a325d3c4fbd5fe33e07045cf7c
@naranyala
naranyala / switch-linux-login-manager.sh
Created August 6, 2025 06:08
easy to switch login manager, testing purposes only
#!/usr/bin/env bash
# Emergency Display Manager Recovery Script
set -euo pipefail
### EMERGENCY RECOVERY ###
emergency_recovery() {
echo "🚨 EMERGENCY RECOVERY MODE"
echo "This will attempt to restore a working display manager"
# Stop all display manager services
@naranyala
naranyala / install-nixshell-outside-nixos.sh
Created August 6, 2025 04:22
enable your non-nixos linux distro experience nix-shell, then visit: https://search.nixos.org/packages
#!/usr/bin/env bash
set -euo pipefail
# 🧾 Config
DEFAULT_NIX_FILE="$HOME/.default-nix-shell.nix"
SHELL_WRAPPER_FLAG="IN_NIX_SHELL"
BASHRC="$HOME/.bashrc"
ZSHRC="$HOME/.zshrc"
# 📦 Step 1: Install Nix if missing