Skip to content

Instantly share code, notes, and snippets.

View trungkak's full-sized avatar

Trung Lê Hoàng trungkak

View GitHub Profile
@trungkak
trungkak / ubuntu_agnoster_install.md
Created January 7, 2019 02:24 — forked from renshuki/ubuntu_agnoster_install.md
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

from graphviz import Digraph
import re
import torch
import torch.nn.functional as F
from torch.autograd import Variable
from torch.autograd import Variable
import torchvision.models as models
def make_dot(var):
# 1. Adding a 'count' column to the result of a groupby in pandas? (https://goo.gl/WMr1zJ)
df.groupby(['A','B']).size().to_frame('count').reset_index()
readlink -f $(which java)
@trungkak
trungkak / zsh.md
Created July 22, 2018 14:47 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu
sudo apt-get install git build-essential linux-headers-generic libelf-dev dkms
git clone https://github.com/neurobin/MT7630E.git
cd MT7630E
sudo ./install
sudo make dkms
# downgrade automake to 1.11.5
## remove current automake
sudo apt-get remove automake
sudo apt-get autoremove
## install automake 1.11.5
wget https://ftp.gnu.org/gnu/automake/automake-1.11.5.tar.gz
tar xf automake-1.12.5.tar.gz
cd automake-1.11.5/
./configure --prefix=/usr/local
make
@trungkak
trungkak / smartsvn-unity-launcher.txt
Created July 19, 2018 03:45 — forked from byk0t/smartsvn-unity-launcher.txt
How to create ubuntu unitiy dash launcher for smartsvn application
1.Create desktop config file
sudo nano /usr/share/applications/smartsvn.desktop
2. Put the text below
[Desktop Entry]
Name=SmartSVN
Name[en]=SmartSVN
Name[ru]=SmartSVN
URL without http: [-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)
URL with http: https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)
def words_map(filepaths, start_pos, end_post, word_pos, delim=' '):
mapper = {}
for filepath in filepaths:
with open(filepath, 'r') as f:
for row in f:
row = row.split(delim)
if row[word_pos] not in mapper.keys():
mapper[row[word_pos]] = {}