Skip to content

Instantly share code, notes, and snippets.

View yashkumaratri's full-sized avatar
☂️
:)

Yash Kumar Atri yashkumaratri

☂️
:)
View GitHub Profile
#Handling the imports
import sklearn
from sklearn.model_selection import train_test_split
import pandas
import seaborn as sb
import matplotlib as plt
import numpy as np
from sklearn.preprocessing import StandardScaler
import cv2
from PIL import Image
@yashkumaratri
yashkumaratri / Port Open in Ubuntu using iptables
Last active November 26, 2018 10:54
Port Opening in Ubuntu
5055 is the port number, Use any port that needs to be open
sudo iptables -A INPUT -p tcp --dport 5055 -j ACCEPT
for i in */; do zip -r "${i%/}.zip" "$i"; done
@yashkumaratri
yashkumaratri / gist:eded1d4ea97e03c59ee797ec7ab54515
Created December 28, 2018 09:21 — forked from darkyen/gist:120c46739985ebf3b39b
Ferengi Rules of Acquisition [Complete List*]
1 "Once you have their money, you never give it back." "The Nagus" (DS9 episode)
2 "The best deal is the one that makes the most profit." The 34th Rule (DS9 novel)
3 "Never spend more for an acquisition than you have to." "The Maquis, Part II" (DS9 episode)
4 "A woman wearing clothes is like a man in the kitchen." The Ferengi Rules of Acquisition (DS9 novel)
5 "Always exaggerate your estimates." Cold Fusion (SCE novel)
6 "Never let family stand in the way of opportunity." "The Nagus" (DS9 episode)
7 "Always keep your ears open." "In the Hands of the Prophets" (DS9 episode)
8 "Small print leads to large risk." The Ferengi Rules of Acquisition (DS9 novel)
9 "Instinct, plus opportunity, equals profit." "The Storyteller" (DS9 episode)
10 "Greed is eternal." "Prophet Motive" (VOY episode)
@yashkumaratri
yashkumaratri / Google Colab SSH
Created December 31, 2018 05:19
SSH into google colab
#CODE
#Generate root password
import random, string
password = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(20))
#Download ngrok
! wget -q -c -nc https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
! unzip -qq -n ngrok-stable-linux-amd64.zip
#Setup sshd
@yashkumaratri
yashkumaratri / ttyd_tmux
Created January 2, 2019 13:05
hosting TMUX on browser in read only mode
ttyd -p 5055 -i 0.0.0.0 -R tmux a -r -t 1
@yashkumaratri
yashkumaratri / server.sh
Created February 1, 2019 05:44
file server using python
cd ~ && python3 -m http.server 8082
@yashkumaratri
yashkumaratri / crystal_pack
Last active February 27, 2019 10:49
Things I need
# Setting default encoding python ENV - Ubuntu (Linux) - /bin/bash
export PYTHONIOENCODING=UTF-8
*****************************************************************************************
# Making python server on any directory
python3 -m http.server
@yashkumaratri
yashkumaratri / cuda_ubuntu.sh
Created March 12, 2019 05:16
cuda_10_setuup
sudo add-apt-repository ppa:graphics-drivers -y
sudo apt-get update
sudo apt-get install nvidia-driver-418 nvidia-utils-418 nvidia-settings -y
wget -N https://developer.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.105_418.39_linux.run
wget -N http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/libcudnn7_7.5.0.56-1+cuda10.1_amd64.deb
sudo ./cuda_10.1.105_418.39_linux.run --override --silent --toolkit --no-opengl-libs
sudo dpkg -i libcudnn7_7.5.0.56-1+cuda10.1_amd64.deb
sudo apt-get install libcupti-dev -y
@yashkumaratri
yashkumaratri / jupyter_clean_output
Created March 15, 2019 06:25
clearing jupyter output for every for loop
from IPython import display
for i in range(100):
display.clear_output(wait=True)
print(i)