Skip to content

Instantly share code, notes, and snippets.

@unnir
unnir / cuda_pytorch.sh
Created June 12, 2018 12:01
Install CUDA v8.0, cuDNN v6.0, Anaconda, and PyTorch GPU on Ubuntu 16.04
#!/bin/bash
CUDA_REPO_PKG="cuda-repo-ubuntu1604_8.0.61-1_amd64.deb"
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_REPO_PKG}
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-get update
sudo apt-get -y install cuda-8-0
#nvidia-smi
echo 'export PATH=$PATH:$CUDA_HOME/bin' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUDA_HOME/lib64' >> ~/.bashrc
@jadient
jadient / python-batchfile.bat
Last active October 21, 2024 22:11
Run python code directly from a batch file
@echo off & python -x "%~f0" %* & goto :eof
# ==========================================================
# one way to place python script in a batch file
# place python code below (no need for .py file)
# ==========================================================
import sys
print "Hello World!"
for i,a in enumerate(sys.argv):
@jeetsukumaran
jeetsukumaran / build-gcc.sh
Last active February 27, 2025 22:17
Build and Install GCC Suite from Scratch
#! /bin/bash
GCC_VERSION="5.2.0"
WORKDIR="$HOME/src/"
INSTALLDIR="/platform"
## NOTE: XCode must be installed (through App Store) and the following run to install command-line tools.
## THIS IS IMPORTANT! Among other things, it creates '/usr/include' and installs the system header files.
# xcode-select --install
@friveroll
friveroll / enzyme.R
Last active October 3, 2021 19:03
Simple enzyme kinetics
#Data from Problem 1 Chapter 4 from
#Biochemical Calculations by Irwin H Segel
#Set the initial values and get a data.frame
S <- c(2.5e-06, 3.33e-06, 4.0e-06, 5.0e-06, 1.0e-05, 2.0e-05, 4.0e-05, 1.0e-04, 2.0e-03, 1.0e-02)
v <- c(24, 30, 34, 40, 60, 80, 96, 109, 119, 120)
data.frame(S, v) -> datos.cinetica
#Plot the raw data
plot(datos.cinetica, type="l", main="V Vs. S", xmain="S", ymain="v")