Skip to content

Instantly share code, notes, and snippets.

View trungnt13's full-sized avatar
:octocat:
Coding, coding, ... and still coding

Trung Ngo trungnt13

:octocat:
Coding, coding, ... and still coding
View GitHub Profile
@trungnt13
trungnt13 / simple_gan.py
Created March 21, 2016 22:21 — forked from Newmu/simple_gan.py
Simple Generative Adversarial Network Demo
import os
import numpy as np
from matplotlib import pyplot as plt
from time import time
from foxhound import activations
from foxhound import updates
from foxhound import inits
from foxhound.theano_utils import floatX, sharedX
@trungnt13
trungnt13 / pycuda_req_rep_demo.py
Created March 31, 2016 22:27 — forked from lebedov/pycuda_req_rep_demo.py
Interprocess communication with pyzmq and multiprocessing
#!/usr/bin/env python
"""
Pass data between processes started through the multiprocessing module
using pyzmq and process them with PyCUDA
"""
import numpy as np
import zmq
import multiprocessing as mp
@trungnt13
trungnt13 / tensorflow_cuda_osx.md
Created June 3, 2016 10:19 — forked from Mistobaan/tensorflow_cuda_osx.md
How to enable cuda support for tensor flow on Mac OS X (Updated on April:2016 Tensorflow 0.8)

These instructions will explain how to install tensorflow on mac with cuda enabled GPU suport. I assume you know what tensorflow is and why you would want to have a deep learning framework running on your computer.

Prerequisites

Make sure to update your homebrew formulas

brew update
@trungnt13
trungnt13 / CentOS_setup_env.sh
Last active August 19, 2016 14:10
CentOS 7.2
## Add all repos
rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-rpm-macros-7-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
rpm -Uvh https://www.mirrorservice.org/sites/dl.atrpms.net/src/el7-x86_64/atrpms/stable/atrpms-repo-7-7.src.rpm
rpm -Uvh http://repo.webtatic.com/yum/el7/webtatic-release.rpm
sudo yum install git
mkdir download
cd download
@trungnt13
trungnt13 / Static_IP_CentOS.sh
Created August 18, 2016 16:31
Set static IP for CentOS
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@trungnt13
trungnt13 / USB_adapter_linux.sh
Last active March 9, 2021 05:42
Install windows driver for usb wireless adapter on Linux
sudo apt-get udpdate
sudo apt-get install linux-headers-$(uname -r)
sudo apt-get install linux-generic linux-headers-generic build-essential
sudo apt-get install unzip
# Install ndiswrapper:
sudo apt search ndiswrapper
sudo apt-get install ndiswrapper-common ndiswrapper-dkms ndiswrapper-utils-1.9
# Or build ndiswrapper 1.57
@trungnt13
trungnt13 / DHCP_SHH_ubuntu.sh
Last active August 23, 2016 08:21
configure DHCP server for ubuntu
# Install DHCP
sudo apt-get install isc-dhcp-server
###############################
# 2 files to configure:
# /etc/default/isc-dhcp-server
# /etc/dhcp/dhcpd.conf
# /etc/network/interfaces
### sudo vi /etc/default/isc-dhcp-server
# Open a putty-terminal with Ctrl + Alt + F1
######## Download the driver
# for GTX 960 (Aug 22, 2016)
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/367.35/NVIDIA-Linux-x86_64-367.35.run
######## Preparing
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get install build-essential && sudo apt-get install linux-source && sudo apt-get install linux-headers-generic
sudo nano /etc/default/grub #change line "GRUB_CMDLINE_LINUX_DEFAULT..."-line to
GRUB_CMDLINE_LINUX_DEFAULT="nouveau.blacklist=1 quiet splash nomodeset" #(forces low-level graphics to ensure putty does not give black screen)
# current kernel
uname -r
# all available kernel
dpkg -l | grep linux-image
dpkg -l | grep linux-headers
# restart boot into desire kernel
# remove unncessary kernel
@trungnt13
trungnt13 / SSD_optimize_linux.sh
Last active October 10, 2024 21:39
Optimize performance for SSD (NVMe) on Linux
sudo cp /etc/fstab /etc/fstab.bak
# Eschewing Access Times
sudo nano /etc/fstab
# add this options, make sure they’re all separated by commas and no spaces.
noatime,nodiratime
# example: UUID=uuid_number / ext4 defaults,noatime,discard,errors=remount-ro 0 1A
# TRIM Fit
discard