Skip to content

Instantly share code, notes, and snippets.

View basavyr's full-sized avatar
💻
Focusing

Robert Poenaru basavyr

💻
Focusing
  • Orange Services
View GitHub Profile
@basavyr
basavyr / linux-development-packages.txt
Created March 5, 2025 08:27
Linux development packages
sudo apt update && sudo apt install -y neofetch htop tree vim nano tldr unzip nmap curl wget net-tools iputils-ping tmux zoxide ripgrep fzf
sudo apt update && sudo apt install -y zsh tmux tree jq bat fd-find ripgrep htop iotop net-tools nmon sysstat curl wget nmap traceroute mtr whois build-essential software-properties-common apt-transport-https ca-certificates git make cmake pkg-config zip unzip python3 python3-pip
sudo apt update && sudo apt install -y neofetch screenfetch inxi htop btop cmatrix cowsay fortune-mod lolcat figlet sysvbanner colorized-logs progress byobu ranger mc tldr zoxide fzf
for pyenv:
sudo apt update; sudo apt install build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev curl libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
@basavyr
basavyr / kernel.py
Created February 9, 2025 09:29 — forked from MekkCyber/kernel.py
Kernel for matmul while unpacking int2 weights
import torch
import triton
import triton.language as tl
def unpack_weights(packed: torch.Tensor, bits: int = 2) -> torch.Tensor:
values_per_item = 8 // bits
packed_shape = packed.shape
if len(packed_shape) == 1:
@basavyr
basavyr / kernel.py
Created February 9, 2025 09:29 — forked from MekkCyber/kernel.py
Kernel for matmul while unpacking int2 weights
import torch
import triton
import triton.language as tl
def unpack_weights(packed: torch.Tensor, bits: int = 2) -> torch.Tensor:
values_per_item = 8 // bits
packed_shape = packed.shape
if len(packed_shape) == 1:
@basavyr
basavyr / macosFirstSetup.md
Last active June 23, 2024 09:53
MacOS First Setup

Initial setup for a developer oriented macOS

In this guide we will focus on the necessary steps, settings, and tools that are required in order to have an environment that is streamlined for development, research, and overal productivity; all while keeping an emphasiz on distraction-free and minimalism

OS level

  • We will always try to keep the operating system at the latest available version (stable releases only), so the very first step would be to make sure that our system has all the OS updates installed
  • At the time of writing this guide, my macOS version is Version 14.5 (23F79)

Categories

@basavyr
basavyr / description.md
Created March 12, 2023 12:45
running Mathematica script from the command line

Executing Mathematica Scripts Within the Command-Line

This guide will show how to run Wolfram Mathematica scripts right from the command-line, without using the Frontend.

Setting up the console environment (MacOS)

Technically, a Mathematica script can be executed from the command line using the Mathematica Kernel.

After installation of the Wolfram Mathematica application, default location of that executable kernel should be at /Applications/Mathematica.app/Contents/MacOS:

@basavyr
basavyr / flask_socketio_simple_app
Created March 16, 2022 06:28
quick flask-socketIO server app
# general imports
from flask_socketio import SocketIO
from flask_socketio import emit
from flask import Flask, render_template
from random import random
import time
from threading import Thread, Event
from threading import Lock
@basavyr
basavyr / gist:bcc8ec3fc1dc0de07a870682066843c1
Created March 5, 2022 10:50
setup a linux container for python development with python
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# custom commands
alias ls='ls --color=auto'
@basavyr
basavyr / plot_label.py
Created February 19, 2022 18:21
create text label in python using scaled centering (relative to the plot size)
def ShowSolutions(n, id):
nqReduced = 4
nqM = 100
for i in range(n):
plotname = pathPrefix+foldername + 'plot-id'+str(i+1)+'.pdf'
fig, ax = plt.subplots()
plt.xlabel('q')
plt.ylabel(f'λi')
ax.text(0.15, 0.75, f'$\lambda_{i+1}$ | N={n}', horizontalalignment='center',
verticalalignment='center', transform=ax.transAxes)
@basavyr
basavyr / .bash_profile
Created February 12, 2022 13:10 — forked from frnhr/.bash_profile
Show current pyenv python version in bash prompt, and also color virtual envs differently
####
#### pyenv-virtualenv bash prompt customization
####
# pyenv
eval "$(pyenv init -)"
# pyenv-virtualenv:
@basavyr
basavyr / agnoster-pyenv
Created February 10, 2022 10:47 — forked from loganasherjones/agnoster-pyenv
Display pyenv environment on agnoster prompt
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
# Make sure you have a recent version: the code points that Powerline