Skip to content

Instantly share code, notes, and snippets.

View akhan4u's full-sized avatar
☘️
Gratitude

Amaan Khan akhan4u

☘️
Gratitude
View GitHub Profile
@akhan4u
akhan4u / file.py
Last active May 25, 2021 08:15
s3 replication cross region within same AWS account
import boto3, os, botocore, traceback
from botocore.exceptions import ClientError
s3 = boto3.client('s3')
# READ VALUES FROM ENVIRONMENT VARIABLES
source_s3_bucket = os.environ['source_s3_bucket']
#kms_keyid = os.environ['Kms_Keyid']
@akhan4u
akhan4u / install_nvidia-docker2.sh
Last active April 3, 2019 18:55
Install nvidia-docker2 and docker-ce on Ubuntu 18.04
#!/bin/bash
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
echo -e "Installing nvidia-docker2 for $distribution"
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 | \
@akhan4u
akhan4u / check_gpu_state
Created April 3, 2019 18:31
Verify the setup of nvidia drivers for GPU.
root@gpu-01:~# python
Python 3.6.8 |Anaconda custom (64-bit)| (default, Dec 30 2018, 01:22:34)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from tensorflow.python.client import device_lib
>>> print(device_lib.list_local_devices())
2019-04-03 19:09:01.537417: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
2019-04-03 19:09:02.180944: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:898] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2019-04-03 19:09:02.181307: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1344] Found device 0 with properties:
name: GeForce RTX 2080 Ti major: 7 minor: 5 memoryClockRate(GHz): 1.545
@akhan4u
akhan4u / install_anaconda.yaml
Last active April 3, 2019 18:13
Ansible playbook to install anaconda3 onto remote system.
---
- hosts: "{{ host_name }}"
roles:
# Install python3 setup onto the remote system
- role: andrewrothstein.python3
python3_pyenv: "3.6.5"
# Install Anaconda3 onto the remote system and install the listed packages as default
- role: andrewrothstein.anaconda3
anaconda_install_packages:
- absl-py==0.1.13
@akhan4u
akhan4u / .bash_aliases
Created February 4, 2019 09:41 — forked from vratiu/.bash_aliases
Git shell coloring
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset