Skip to content

Instantly share code, notes, and snippets.

View ayush-1506's full-sized avatar
🎧
Learning

Ayush Shridhar ayush-1506

🎧
Learning
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ayush-1506 on github.
  • I am ayushridhar (https://keybase.io/ayushridhar) on keybase.
  • I have a public key whose fingerprint is 01EF C377 8A6F 6A16 3C36 C094 0468 60FA 7D83 BC8C

To claim this, I am signing this object:

@ayush-1506
ayush-1506 / terange.diff
Last active June 25, 2021 08:54
terange is like python's internal range, but each increment happens ten times (hence _terange_). For instance terange(0,100,1) = range(0,100,10). Build instructions: clone cpython, mkdir build, apply this patch, run ./configure --prefix=build --exec_prefix=build, make && make install. Python binary is generated in build/bin/python3.
diff --git a/Include/rangeobject.h b/Include/rangeobject.h
index d6af847..c2b3c4a 100644
--- a/Include/rangeobject.h
+++ b/Include/rangeobject.h
@@ -21,6 +21,17 @@ PyAPI_DATA(PyTypeObject) PyLongRangeIter_Type;
#define PyRange_Check(op) Py_IS_TYPE(op, &PyRange_Type)
+/*
+A completely useless terange, where increment is ten times
@ayush-1506
ayush-1506 / install.sh
Last active April 1, 2021 06:56
nvidia/cuda driver installation on azure
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/11.2.1/local_installers/cuda-repo-ubuntu1804-11-2-local_11.2.1-460.32.03-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1804-11-2-local_11.2.1-460.32.03-1_amd64.deb
sudo apt-key add /var/cuda-repo-ubuntu1804-11-2-local/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda
apt-get -y install llvm-10 llvm-10-dev
apt -y install python3-pip