Skip to content

Instantly share code, notes, and snippets.

View stanlee321's full-sized avatar

Stanley Salvatierra stanlee321

View GitHub Profile
@stanlee321
stanlee321 / tmux-host-bashrc.md
Created September 26, 2020 03:25
tmux-host-bashrc

Add the following in your ~/.tmux.conf

set -g default-terminal "tmux-256color"

# Anaconda
export PATH=$PATH:$HOME/anaconda3/bin
#export PATH=~/anaconda3/bin:$PATH
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/stanlee321/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
@stanlee321
stanlee321 / wifi-ubuntu-2004-hp255g7.md
Created September 17, 2020 20:37
WIFI -ubuntu 20-04. HP 255 G7
git clone https://github.com/tomaspinho/rtl8821ce
cd Downloads/rtl8821ce/
sudo apt install bc module-assistant build-essential dkms
sudo m-a prepare
sudo ./dkms-install.sh
@stanlee321
stanlee321 / simple_classifier.py
Last active September 16, 2020 00:44
Simple text classifier
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.model_selection import train_test_split
from sklearn.naive_bayes import MultinomialNB
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.linear_model import SGDClassifier
from sklearn.model_selection import GridSearchCV
from sklearn.pipeline import Pipeline
from pprint import pprint
@stanlee321
stanlee321 / treemaps.py
Last active September 14, 2020 15:12
treemaps python
def plot_treemap(df, values="count", columns = [], title='Proyectos en curso por Departamento', width=1200, height=600):
fig1 = px.treemap(df.sort_values(by=values, ascending=False).reset_index(drop=True),
path=columns, values=values, title=title,
color_discrete_sequence = px.colors.qualitative.Prism, width=width,height=height, maxdepth = 4, )
fig1.data[0].textinfo = 'label+text+value+percent entry'
py.offline.iplot(fig1)
return fig1
@stanlee321
stanlee321 / gist:c9e37e90747c381cb04863f8dc9ab321
Last active September 13, 2020 20:14
Purge NVIDIA and CUDA & reinstall
# PURGE NVIDIA AND CUDA
# Remove existing CuDA versions
sudo apt --purge remove "cublas*" "cuda*"
sudo apt --purge remove "nvidia*"
rm -rf /usr/local/cuda*
sudo apt-get autoremove && sudo apt-get autoclean
# Reboot to remove cached files
reboot
view rawremove_cuda.sh ho
@stanlee321
stanlee321 / cuda.md
Created September 13, 2020 19:18
Install CUDA
# Add NVIDIA package repositories
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.1.243-1_amd64.deb
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
sudo dpkg -i cuda-repo-ubuntu1804_10.1.243-1_amd64.deb
sudo apt-get update
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb
sudo apt install ./nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb
sudo apt-get update
@stanlee321
stanlee321 / tmux-cheats.md
Created September 12, 2020 03:37 — forked from Starefossen/tmux-cheats.md
My personal tmux cheat sheet for working with sessions, windows, and panes. `NB` I have remapped the command prefix to `ctrl` + `a`.

Sessions

New Session

  • tmux new [-s name] [cmd] (:new) - new session

Switch Session

  • tmux ls (:ls) - list sessions
  • tmux switch [-t name] (:switch) - switches to an existing session
@stanlee321
stanlee321 / tmux.md
Created September 12, 2020 03:37 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@stanlee321
stanlee321 / a0.go
Last active September 11, 2020 15:31
Snipeds Go
/*
Aprendiendo Golang
Author: Stanley Salvatierra
Email: stanlee321@gmail.com
-----
TEMA: Apuntadores
-----
*/