This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://rtyley.github.io/bfg-repo-cleaner/ | |
# check pack size | |
git count-objects -v -H | |
# download bfg and move to directory, rename to bfg | |
wget https://repo1.maven.org/maven2/com/madgag/bfg/1.13.0/bfg-1.13.0.jar | |
# clone mirror | |
git clone --mirror git://example.com/some-big-repo.git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#install samba | |
sudo apt install samba | |
#check installation | |
whereis samba | |
# output : | |
# samba: /usr/sbin/samba /usr/lib/samba /etc/samba /usr/share/samba /usr/share/man/man7/samba.7.gz /usr/share/man/man8/samba.8.gz | |
# edit file | |
sudo nano /etc/samba/smb.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# build images from Dockerfile | |
docker build -t horovod:latest horovod-docker-gpu | |
# get list images | |
docker images | |
# get list container | |
docker ps | |
# remove container |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This Dockerfile specifically for using PyTorch 1.3.0 | |
FROM nvidia/cuda:10.0-devel-ubuntu18.04 | |
# TensorFlow version is tightly coupled to CUDA and cuDNN so it should be selected carefully | |
# ENV TENSORFLOW_VERSION=2.0.0 | |
ENV PYTORCH_VERSION=1.3.0 | |
ENV TORCHVISION_VERSION=0.4.1 | |
ENV CUDNN_VERSION=7.6.0.64-1+cuda10.0 | |
ENV NCCL_VERSION=2.4.7-1+cuda10.0 | |
# ENV MXNET_VERSION=1.5.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install nvidia-container-toolkit | |
# source : https://github.com/NVIDIA/nvidia-docker#ubuntu-16041804-debian-jessiestretchbuster | |
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) | |
$ curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - | |
$ curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list | |
sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit | |
# Install nvidia-runtime | |
# Download nvidia-runtime packages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add the GPG key for the official Docker repository to the system | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
# add the Docker repository to APT sources | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
# update the package database with the Docker packages from the newly added repo | |
sudo apt-get update | |
# install from the Docker repo instead of the default Ubuntu 16.04 repo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://stackoverflow.com/questions/8751653/how-to-convert-a-binary-string-into-a-float-value | |
# http://weitz.de/ieee/ | |
from codecs import decode | |
import struct | |
def bin_to_float(b): | |
""" Convert binary string to a float. """ | |
bf = int_to_bytes(int(b, 2), 8) # 8 bytes needed for IEEE 754 binary64. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get actual name of file before extension | |
file = 'my.report.txt' | |
print file.rsplit('.', 1)[0] | |
# list of comprehension | |
words = [w.replace('[br]', '<br />') for w in words] | |
# get intersection of list | |
def intersection(lst1, lst2): | |
temp = set(lst2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get amount of directories and files | |
tree <FOLDER_NAME>/ | tail -1 | |
# get amount of file | |
find . | wc -l | |
# zip file | |
zip -r output_file.zip file1 folder1 | |
# add -q for quiet operation | |
zip -q -r output_file.zip file1 folder1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, random, shutil | |
#Prompting user to enter number of files to select randomly along with directory | |
source=input("Enter the Source Directory : ") | |
dest=input("Enter the Destination Directory : ") | |
no_of_files=int(input("Enter The Number of Files To Select : ")) | |
print("%"*25+"{ Details Of Transfer }"+"%"*25) | |
print("\n\nList of Files Moved to %s :-"%(dest)) |