Skip to content

Instantly share code, notes, and snippets.

View emptymalei's full-sized avatar
📡
sending EM waves to Mars

LM emptymalei

📡
sending EM waves to Mars
View GitHub Profile
@garg-aayush
garg-aayush / setup-personal-gpu-server.md
Created June 30, 2024 15:35
Step-by-Step Guide to setup your own personal GPU server

Setting Up Your Personal GPU Server: A Step-by-Step Guide

I've been using a GPU workstation with an RTX 4090 for almost a year now, and it's been one of the best decisions I've made. With a personal GPU server, you no longer need to rely on cloud-based GPU instances from services like RunPod or Vast.ai every time you want to run a job or try new models. The best part? No stress about recurring GPU instance costs! :-)

However, I rarely work directly on my workstation. Instead, I prefer the flexibility of accessing the GPU remotely using my MacBook, whether I'm working from different locations within my home, from a co-working space, or a cozy cafe in another part of town.

In this blog, I will walk you through the steps to configure a personal GPU Ubuntu server.

For this guide, I assume you already have a workstation running Ubuntu with a GPU and it is connected to your local network

@maedoc
maedoc / µrwkv.py
Last active January 24, 2024 15:09
Another short take on RWKV, towards use with time series
import numpy as np
import torch
class MyModule(torch.nn.Module):
def add_param(self, key, shape):
val = torch.randn(*shape)/np.prod(shape)
setattr(self, key, torch.nn.Parameter(val))
@denguir
denguir / cuda_install.md
Last active November 18, 2024 14:57
Installation procedure for CUDA / cuDNN / TensorRT

How to install CUDA / cuDNN / TensorRT on Ubuntu

Install NVIDIA drivers

Update & upgrade

sudo apt update && sudo apt upgrade

Remove previous NVIDIA installation

# First, some imports:
import numpy as np
from darts.utils import timeseries_generation as tg
np.random.seed(42)
LENGTH = 3 * 365 # 3 years of daily data
# Melting: a sine with yearly periodicity and additive white noise
melting = (tg.sine_timeseries(length=LENGTH,
@grantmwilliams
grantmwilliams / iter_parquet.py
Created June 27, 2021 12:45
Pyarrow iter_batches as python native iterable
import s3fs
import pyarrow as pa
import pyarrow.parquet as pq
from itertools import chain
from typing import Tuple, Any
def iter_parquet(s3_uri: str, columns = None, batch_size=1_000) -> Tuple[Any]:
@svpino
svpino / on-start.sh
Last active June 23, 2023 11:34
SageMaker Notebook Instance - Lifecycle configuration - New Conda Environment
#!/bin/bash
set -e
sudo -u ec2-user -i <<'EOF'
ENVIRONMENT=python38
VERSION=3.8
conda create -y -n "$ENVIRONMENT" python="$VERSION" tensorflow-gpu numpy opencv pandas pyyaml
@nkhitrov
nkhitrov / logger.py
Last active October 15, 2024 04:13
Configure uvicorn logs with loguru for FastAPI
"""
WARNING: dont use loguru, use structlog
https://gist.github.com/nkhitrov/38adbb314f0d35371eba4ffb8f27078f
Configure handlers and formats for application loggers.
"""
import logging
import sys
from pprint import pformat
@Treeki
Treeki / TurnipPrices.cpp
Last active November 1, 2024 14:15
AC:NH turnip price calculator
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
// munged from https://github.com/simontime/Resead
namespace sead
{
class Random
{
@cmod
cmod / hugofastsearch.md
Last active November 19, 2024 19:40 — forked from eddiewebb/readme.md
Fast, instant client side search for Hugo static site generator

Super fast, keyboard-optimized, client side Hugo search

This is a fork of and builds upon the work of Eddie Webb's search and Matthew Daly's search explorations.

It's built for the Hugo static site generator, but could be adopted to function with any json index compatible with Fuse fuzzy search library.

To see it in action, go to craigmod.com and press CMD-/ and start typing.

Fast Search

class Person extends IdyllModel
belongs_to :working_population
define_attribute :stress, type: integer, min: 0, max: 100, init: random
define_attribute :environment, type: enum, ['high income', 'low income', 'normal']
define_attribute :group, type: classification, |model| => { case model.stress; when 50..100: "high risk"; when 0..49: "low risk" }
def next_step
self.stress += 5 if self.environment == "high income"
self.stress -= 5 if self.environment == "low income"