Skip to content

Instantly share code, notes, and snippets.

View thuongdinh-agilityio's full-sized avatar
🎯
Focusing

Thuong Dinh thuongdinh-agilityio

🎯
Focusing
View GitHub Profile
@thuongdinh-agilityio
thuongdinh-agilityio / install_mongo_shell.sh
Last active September 9, 2021 13:15
install mongo shell
#!/usr/bin/env bash
set -e
wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list
sudo apt-get update -y > /dev/null 2>&1
sudo apt-get install -y libcurl3 mongodb-org-shell
@thuongdinh-agilityio
thuongdinh-agilityio / pytorch_setup-9.2-7.2.1.sh
Last active January 16, 2019 06:37 — forked from kylemcdonald/pytorch_setup.sh
Install CUDA 9.0, cuDNN 7.2.1, Anaconda and PyTorch on Ubuntu 16.04.
# tested on AWS p2.xlarge August 29, 2018
# install CUDA
sudo apt-get update && sudo apt-get install wget -y --no-install-recommends
CUDA_URL="https://developer.nvidia.com/compute/cuda/9.2/Prod2/local_installers/cuda-repo-ubuntu1604-9-2-local_9.2.148-1_amd64"
wget -c ${CUDA_URL} -O cuda.deb
sudo dpkg --install cuda.deb
sudo apt-key add /var/cuda-repo-9-2-local/7fa2af80.pub
sudo apt-get update
sudo apt-get install -y cuda
@thuongdinh-agilityio
thuongdinh-agilityio / bobp-python.md
Created October 17, 2018 09:17 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@thuongdinh-agilityio
thuongdinh-agilityio / cuda_9.0_cudnn_7.0.sh
Created October 15, 2018 15:29 — forked from ashokpant/cuda_9.0_cudnn_7.0.sh
Install CUDA Toolkit v9.0 and cuDNN v7.0 on Ubuntu 16.04
#!/bin/bash
# install CUDA Toolkit v9.0
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb)
CUDA_REPO_PKG="cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb"
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/${CUDA_REPO_PKG}
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda-9-0
var Nightmare = require('nightmare'),
vo = require('vo');
function *start() {
var nightmare = new Nightmare({
show: true,
'download-preferences': {
destination: require('path').resolve(__dirname, 'downloads')
}
});
@thuongdinh-agilityio
thuongdinh-agilityio / docker-machine_create_generic_driver_multiple_host
Created January 18, 2016 08:45
Create docker machine use generic driver with existing cert
docker-machine \
--tls-ca-cert $LOCAL_CONFIG_PATH/ca.pem \
--tls-ca-key $LOCAL_CONFIG_PATH/ca-key.pem \
--tls-client-cert $LOCAL_CONFIG_PATH/cert.pem \
--tls-client-key $LOCAL_CONFIG_PATH/key.pem \
create --driver generic --generic-ssh-user root --generic-ip-address xxx.xxx.xxx.xxx test-deployment
@thuongdinh-agilityio
thuongdinh-agilityio / Vagrantfile
Last active December 9, 2015 14:58
Simple Vagrantfile for development
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provider "virtualbox" do |v|
v.memory = 2048
v.cpus = 1
@thuongdinh-agilityio
thuongdinh-agilityio / docker_macos
Created December 1, 2015 07:24
How to install docker on macosx
# install brikis98/docker-osx-dev
curl -o /usr/local/bin/docker-osx-dev https://raw.githubusercontent.com/brikis98/docker-osx-dev/master/src/docker-osx-dev
chmod +x /usr/local/bin/docker-osx-dev
docker-osx-dev install
# go to working folder where contains docker-compose.xml
docker-osx-dev
# install virtualenv
sudo pip install virtualenv
@thuongdinh-agilityio
thuongdinh-agilityio / dockerfile_nodejs_4x
Last active December 9, 2015 14:59
docker_simple_nodejs_4x
FROM node:4
# Add code & set working dir
ADD . /app
WORKDIR /app
# Install npm package
RUN npm install
o := orm.NewOrm()
//Database alias
name := "default"
// Drop table and re-create.
force := true
// Print log.
verbose := true
err := orm.RunSyncdb(name, force, verbose) //this is to create/drops the tables
if err != nil {
beego.Info(err)