Skip to content

Instantly share code, notes, and snippets.

# /// script
# dependencies = [ "transformers", "accelerate" ]
# ///
# run on 2xH200 rented from primeintellect.ai
import gc
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
@abelardojarab
abelardojarab / git_local_installation.sh
Last active April 22, 2024 19:43
bash script for installing git without root access
#!/bin/bash
wget https://curl.haxx.se/download/curl-7.47.1.tar.gz
tar -xf curl-7.47.1.tar.gz
cd curl-7.47.1
./configure --prefix=$HOME/local
make
make install
wget http://downloads.sourceforge.net/expat/expat-2.1.0.tar.gz
@jsvine
jsvine / visidata-pipx-installation.md
Last active December 15, 2024 17:37
Installing VisiData via pipx

Installing VisiData via pipx

pipx is a command-line tool that allows you to run Python applications in isolated environments. It's a great way to make VisiData available across your system without worrying that its dependencies will conflict with other Python projects. This short guide will show you how.

Step 0: Uninstall global VisiData

If you have have previously VisiData installed globally, uninstall it by running pip3 uninstall visidata.

Otherwise, you can skip this step.

@ericness
ericness / compute_taxi_data.py
Created February 19, 2019 23:37
Compute the pandas dataframe from the dask dataframe.
def compute_final_dataframe(df: dd.DataFrame) -> pd.DataFrame:
"""Execute dask task graph and compute final results"""
return (
df
.compute()
.reset_index()
.pivot(
index='drive_time',
columns='trip_distance',
values='avg_amount'
@ericness
ericness / transform_taxi_data.py
Created February 19, 2019 02:08
Transforms loaded NYC taxi data into form ready for pivoting
import numpy as np
import math
def roundup(x, base: int = 5):
"""Round `x` up to nearest `base`"""
return int(math.ceil(x / float(base))) * base
def round_series_up(s: dd.Series) -> dd.Series:
"""Apply roundup function to all elements of `s`"""
@ericness
ericness / load_taxi_data.py
Last active May 4, 2020 17:07
Create task graph for reading NYC taxi data
import dask.dataframe as dd
taxi_data = dd.read_csv(
's3://nyc-tlc/trip data/yellow_tripdata_2018-04.csv',
storage_options={'anon': True, 'use_ssl': False}
)
@silveraid
silveraid / CentOS-Docker
Created October 27, 2017 12:09
Creating minimal CentOS docker image from scratch
# Create a folder for our new root structure
$ export centos_root='/centos_image/rootfs'
$ mkdir -p $centos_root
# initialize rpm database
$ rpm --root $centos_root --initdb
# download and install the centos-release package, it contains our repository sources
$ yum reinstall --downloadonly --downloaddir . centos-release
$ rpm --root $centos_root -ivh centos-release*.rpm
$ rpm --root $centos_root --import $centos_root/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
# install yum without docs and install only the english language files during the process
@FollowMeDown
FollowMeDown / debian-source-pkg-build.txt
Last active May 8, 2025 21:02
How to create debian package from source
In any GNU/Linux distribution, which have a package manager on board, is recommended to install software by using "packages".
Building from source
Step 1. GPG key
The first thing you need is generate a gpg key.
Package will be signed by this key.
Run this commands in your terminal:
@jessejanderson
jessejanderson / intro-to-otp-in-elixir-resources.md
Last active September 27, 2024 08:14
Intro to OTP in Elixir - Resources
@TUSF
TUSF / Valbli Orthography.md
Last active May 3, 2024 06:34
A draft for a block writing system, designed for Lojban.

https://tusf.page/valbli

(Note: This is a draft, and subject to change.)

Many writing systems have been proposed for Lojban. Hangul is the writing system used in Korean, and potentially a great option to use for Lojban. It's a featural writing system, meaning that most of its symbols are chosen for a reason, and not just arbitrarily. The most attractive feature of Hangul is the syllable-blocks that well compress the language.