Skip to content

Instantly share code, notes, and snippets.

View p1nox's full-sized avatar

Raul Pino p1nox

View GitHub Profile
@p1nox
p1nox / jupyter.md
Last active May 9, 2023 21:28
Jupyter notes
# install
pip install notebook

# launch
jupyter notebook

# jupyter remote access with password - https://towardsdatascience.com/how-to-share-your-jupyter-notebook-in-3-lines-of-code-with-ngrok-bfe1495a9c0c
sudo snap install ngrok
ngrok config add-authtoken xyz
@p1nox
p1nox / pytorch_rtx_3060.md
Last active December 17, 2023 02:27
PyTorch on RTX 3060

After researching a lot on how to use PyTorch with a RTX 3060 card, specially with older versions or torch (0.4.0) and torchvision (0.2.1), I noticed that it was either impossible or very hard to do. RTX 3060 and these packages apparently doesn't have compatibility with the same versions of CUDA and cuDNN. I tried to do this by using different combinations with compiled versions available in conda, but didn't work, maybe it could work if you recompile from source these versions.

After all this, actually I was able to use RTX 3060 effectively with latest versions of all these dependencies with two methods:

  1. Using a conda env, and latest versions published in pytorch site (https://pytorch.org/get-started/locally):
conda create -n rtx_3060 python=3.6.5
conda activate rtx_3060
conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c nvidia
@p1nox
p1nox / cuda.sh
Last active February 7, 2022 20:41
nVidia cuda
# version 11.3.0-465.19.01
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/11.3.0/local_installers/cuda-repo-ubuntu2004-11-3-local_11.3.0-465.19.01-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2004-11-3-local_11.3.0-465.19.01-1_amd64.deb
sudo apt-key add /var/cuda-repo-ubuntu2004-11-3-local/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda
@p1nox
p1nox / docker.md
Last active January 30, 2021 21:41
docker
apt-get update
apt-get -y install wget
wget -qO- https://get.docker.com/ | sh

sudo apt-get update
sudo apt-get install docker.io

docker version

docker ps -a

@p1nox
p1nox / dokku.md
Last active May 25, 2020 16:56
dokku
###### local settings

git remote add dokku [email protected]:my_api

###### python django rest framework

# apps
dokku apps:create my_api
@p1nox
p1nox / rails.md
Created May 3, 2020 03:29
Rails 6 cheatsheet
docker run -it -p 3000:3000 -v $(pwd):/home/ubuntu/code ubuntu:18.04 bash

# dependencies
sudo apt-get update
sudo apt-get install sudo curl wget htop vim git
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
@p1nox
p1nox / cyberpunk_dark.itermcolors
Last active October 8, 2024 22:40
iTerm 2 cyberpunk themes
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.0</real>
@p1nox
p1nox / mole-tunnel-ssh.md
Last active April 29, 2022 07:29
Ssh tunnels using mole

mole > https://davrodpin.github.io/mole/

Install local:

bash <(curl -fsSL https://raw.githubusercontent.com/davrodpin/mole/master/tools/install.sh)

# or specific version
wget -c https://raw.githubusercontent.com/p1nox/mole/install_spec_version/tools/install.sh -O mole.sh
bash mole.sh v0.5.0 && rm -f mole.sh
@p1nox
p1nox / renew_ssl.sh
Created January 20, 2020 15:30
Renew https certificate: certbot + pm2
#!/usr/bin/env bash
pm2 stop web_server
certbot renew --standalone --preferred-challenges http
pm2 start web_server