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 / DL_UEF19_Tut1.py
Last active November 15, 2019 14:00
First tutorial for Deep Learning course at UEF 2019
from __future__ import absolute_import, division, print_function
import os
import numpy as np
import tensorflow as tf
from matplotlib import pyplot as plt
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
from tensorflow import keras
from __future__ import print_function, division, absolute_import
import tensorflow as tf
tf.enable_eager_execution()
from tensorflow_probability.python.distributions import NegativeBinomial
from zero_inflated import ZeroInflated
nb = NegativeBinomial(total_count=10, probs=0.5)
zfnb = ZeroInflated(dist=nb, pi=0.9)
WC Classic Rock 1 6kN 16g 7/13.0mm
WC Classic Rock 2 10kN 25g 8.2/13.8mm
WC Classic Rock 3 10kN 28g 9.6/14.5mm
WC Classic Rock 4 10kN 30g 11.3/15.3mm
WC Classic Rock 5 10kN 32g 13.3/16.8mm
WC Classic Rock 6 10kN 36g 15.6/19.0mm
WC Classic Rock 7 10kN 38g 18.4/21.2mm
WC Classic Rock 8 12kN 47g 21.6/24.0mm
WC Classic Rock 9 12kN 60g 24.4/27.7mm
WC Classic Rock 10 12kN 71g 30.0/31.0mm
Camalot X4 Red 0.1 5kN 51g 8.4-13.8mm
Camalot X4 Yellow 0.2 6kN 54g 9.9-16.5mm
Camalot X4 Blue 0.3 8kN 75g 12.4-21.2mm
Camalot X4 Grey 0.4 9kN 82g 15.5-26.6mm
Camalot X4 Purple 0.5 9kN 91g 19.8-33.7mm
Camalot X4 Green 0.75 9kN 112g 24-41.2mm
Camalot C3 Grey 000 4kN 55g 7.8-12.9mm
Camalot C3 Purple 00 6kN 57g 9.0-13.7mm
Camalot C3 Green 0 7kN 59g 10.7-15.8mm
#####################################################################
# Submodule
#####################################################################
git submodule add [link_to_git_remote]
git submodule foreach git pull origin master
# To remove a submodule you need to:
* Delete the relevant section from the .gitmodules file.
* Stage the .gitmodules changes git add .gitmodules
* Delete the relevant section from .git/config.
@trungnt13
trungnt13 / delete_git_submodule.md
Created May 21, 2018 12:12 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
name: bay2
channels:
- https://conda.anaconda.org/conda-forge
- defaults
dependencies:
- python=2.7
- Cython
- toolz
- psutil
- numpy
@trungnt13
trungnt13 / btsync_linux.sh
Created September 8, 2016 10:31
Install Bittorrent sync
sudo sh -c 'echo "deb http://linux-packages.getsync.com/btsync/deb btsync non-free" > /etc/apt/sources.list.d/btsync.list'
wget -qO - http://linux-packages.getsync.com/btsync/key.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install btsync
cd && mkdir shared_folder
sudo chown YOUR_USER:btsync shared_folder
sudo usermod -a -G btsync YOUR_USER
sudo service btsync start
@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
# 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