Skip to content

Instantly share code, notes, and snippets.

Arun Das arundasan91

Block or report user

Report or block arundasan91

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@arundasan91
arundasan91 / install_dl_packages.sh
Last active Dec 6, 2019
Install CUDA and Machine Learning packages for Ubuntu from Scratch
View install_dl_packages.sh
cd ~
mkdir .packages
cd .packages
# Install CUDA
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
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
sudo add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /"
sudo apt-get update
View caffe-matlab-cuda-Makefile.config
## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!
# cuDNN acceleration switch (uncomment to build with cuDNN).
USE_CUDNN := 1
# CPU-only switch (uncomment to build without GPU support).
# CPU_ONLY := 1
# uncomment to disable IO dependencies and corresponding data layers
View install-caffe-incomplete.sh
#!/bin/bash
sudo apt update
sudo apt install libhdf5-dev
sudo apt-get install -y opencl-headers build-essential protobuf-compiler libprotoc-dev libboost-all-dev libleveldb-dev hdf5-tools libhdf5-serial-dev libopencv-core-dev libopencv-highgui-dev libsnappy-dev libatlas-base-dev cmake libstdc++6-4.8-dbg libgoogle-glog0v5 libgoogle-glog-dev libgflags-dev liblmdb-dev git python-pip gfortran
sudo sh -c "sudo echo '/usr/local/cuda/lib64' > /etc/ld.so.conf.d/cuda_hack.conf"
sudo ldconfig /usr/local/cuda/lib64
pip install --upgrade --user pip
pip install scikit-image --user
cd /home/$USER/packages/
git clone https://github.com/BVLC/caffe.git
@arundasan91
arundasan91 / launch_jupyter_at_boot.sh
Created Oct 17, 2017
Script to launch Jupyter notebook at boot time of VMs or Containers.
View launch_jupyter_at_boot.sh
#!/bin/bash
echo '1'
export PATH=$PATH:/home/student/.local/bin/
echo '2'
su - student -c "bash -c '/home/student/.local/bin/jupyter notebook'"
echo 'Launched Jupyter Notebook'
#touch /home/student/testrclocal
sed -i "s|PasswordAuthentication no|PasswordAuthentication yes|g" /etc/ssh/sshd_config
echo '3'
export HOSTIP=`hostname -I`
@arundasan91
arundasan91 / install-packages-CC-Ubuntu1604-GPU.sh
Last active Feb 21, 2018
This bash script will create OpenStack `openrc` file for the current tenant, source it, download required files from OpenStack Swift Object Storage and then runs the scripts to install TensorFlow 1.3, OpenCV from source and some other user defined packages.
View install-packages-CC-Ubuntu1604-GPU.sh
#!/usr/bin/env bash
# OpenRC extraction
function extract_json_key {
RESULT=$(echo "$2" | sed "s/.*$1\": \"//g" | sed 's/".*//g')
echo "$RESULT"
}
JSON_VENDOR_DATA=$(curl -s http://169.254.169.254/openstack/latest/vendor_data.json)
SITE=$(extract_json_key "site" "$JSON_VENDOR_DATA")
View convert_and_remove_tiff_files.sh
#!/bin/bash
ls -1 *.tiff | parallel convert '{}' '{.}.jpg'
find . -name "*.tiff" -print0 | xargs -0 -I {} rm {}
View apache_mxnet_openstack_heat
heat_template_version: 2015-10-15
description: Implementation of Apache MXNET Distributed Deep Learning Appliance for OpenStack.
parameters:
key_name:
type: string
label: Key name
description: Name of a key pair to enable SSH access to the instance
default: default
@arundasan91
arundasan91 / download_youtube_video.py
Created Apr 14, 2017
Function to download video's from YouTube to a specific location. Requires 'youtube-dl'.
View download_youtube_video.py
def download_video(url, output_dir, filename, ext='mp4'):
"""Function to download video's from YouTube to a specific location.
Args:
url: YouTube URL.
output_dir: Output directory to save the video.
filename: Filename of the video.
ext: File type to save the video to. Default to mp4.
"""
import os
@arundasan91
arundasan91 / opencv_video_to_frames.py
Created Apr 14, 2017
Function to extract frames from input video file using OpenCV and save them as separate frames in an output directory.
View opencv_video_to_frames.py
def video_to_frames(input_loc, output_loc):
"""Function to extract frames from input video file and save them as separate frames in an output directory.
Args:
input_loc: Input video file.
output_loc: Output directory to save the frames.
Returns:
None
"""
@arundasan91
arundasan91 / show_video_ipython.py
Created Apr 14, 2017
Function to display any video in Ipython or Jupyter Notebook given a directory in which the video exist and the video file name.
View show_video_ipython.py
def showanyVideo(baseDir=None,fname=None):
"""Function to display any video in Ipython or Jupyter Notebook given a directory in which the video exist and the video file name.
Args:
baseDir: Directory containing the video
fname: Filename of video.
"""
from IPython.display import HTML
import os
location = baseDir + fname
if os.path.isfile(location):
You can’t perform that action at this time.