Skip to content

Instantly share code, notes, and snippets.

View lesserfish's full-sized avatar

lesserfish lesserfish

View GitHub Profile
@lesserfish
lesserfish / fast-michaelis-menten.R
Created October 2, 2024 07:21
Fast Michaelis-Menten equations
# Make sure to have Rato installed on your system!
# Michaelis Menten equation
michaelis.menten <- function(t, x, parms) {
f <- parms$f
h <- parms$h
B <- parms$B
beta <- parms$beta
dxdt <- -B*(x^f) + beta*(x^h)/(x^h + 1) # Exemplo de equação: dy/dt = -0.1 * y
@lesserfish
lesserfish / nixos_setup.md
Last active March 16, 2025 19:40
Setting up NixOS with impermanence!

Nix OS with impermanence

The following steps describe how to set up NixOS with impermanence using a ZFS drive.

Getting an initial configuration file

The configuration file generated by nixos-generate-config is quite barebones. If you are comfortable creating the initial configuration.nix file yourself, feel free to skip these steps.

  1. Run the NixOS installer normally. Install NixOS on your entire hard drive.
  2. Once finished, do NOT restart
library(magrittr)
library(deSolve)
sinput <- function(A, i = NULL)
{
sinput_help <- function(A, i) {
A[i, ] %>% sum() %>% return()
}
if(is.null(i))
@lesserfish
lesserfish / instructions.txt
Created October 31, 2023 00:19
Installation process of Assetto Corsa
Making this game work was an absolute mess. All I wanted was to drive arund in Shutoko in a rainy night.
I have about 10 hours of play time in Steam. 1 of those hours is actually from playing the game.
The follow are all of the steps I had to do.
1. Install Assetto Corsa
2. Right-click Assetto Corsa in Steam, go to Properties --> Compatibility, check the 'Force the use of a specific Steam Play compatibility tool' checkbox and choose Proton 5.0-10 from the dropdown list.
3. It is reccommended to launch steam from a terminal, so that you can see log information. Launch Assetto Corsa. It is going to silently crash.
4. Change the Proton version to GE-Proton8-3.
@lesserfish
lesserfish / cpu_usage.sh
Created April 1, 2022 19:53
Gets CPU usage of different cores
#!/bin/bash
declare -a HostArray=("gateway" "puchkin" "deepone" "deeptwo" "deepthree" "curie" "lovelace" "hopper" "hamilton" "mon01" )
echo -n Username:
read username
echo
echo -n Password:
read -s password
echo
source(system.file("helpers", "install.R", package = "ISLR2"))
unix_install_miniconda <- function(path = reticulate::miniconda_path(),
update = TRUE,
force = FALSE) {
tag <- installation_target_tag()
tested_combo <- tested_installation_combos[tag, ]
if (is.na(tested_combo$os)) {
stop(sprintf("install_miniconda: Unknown target %s.", tag))
}