Skip to content

Instantly share code, notes, and snippets.

View khangvan's full-sized avatar
🎯
Focusing

Thai Khang Van khangvan

🎯
Focusing
View GitHub Profile
import pandas as pd
@khangvan
khangvan / jupyter-lab.service-systemd
Created December 22, 2020 15:18 — forked from minlaxz/jupyter-lab.service-systemd
Jupyter lab auto start or restart ( crash or server stopped ) on nvidia jetson nano or ubuntu.
# create a file and (name your wish) , then add this content to the file.
# OR
# sudo vim /etc/systemd/system/jupyter-lab.service
# paste code below
# Esc , shift z z
[Unit]
Description=Start Jupyter Lab Server at Boot
[Service]
@khangvan
khangvan / plot_pareto
Created June 23, 2020 06:17
sidetable_pareto
# Refer code develop by Tyler Marrs
# https://tylermarrs.com/posts/pareto-plot-with-matplotlib/
def pareto_plot(df, x, y="Count", title=None, show_pct_y=True, pct_format='{0:.0%}'):
xlabel = x
ylabel = y
df=df.stb.freq([x]) # use sidetable
if len(x) >1:
df['MergCol'] = df[df.columns[:2]].apply(
@khangvan
khangvan / get_client_crt_and_client_key.sh
Created April 30, 2020 05:51
get_client_crt_and_client_key.sh
openssl req -newkey rsa:2048 -nodes -keyout client.key -x509 -days 365 -out client.crt
@khangvan
khangvan / 0_TakeNoteVim.md
Last active May 18, 2020 06:31 — forked from m3nd3s/NERDTree.mkd
My Vim Cheat Sheet

delete

di" delete inside quote

di( delete inside parenthen

d0 delete to begining

replace

@khangvan
khangvan / workflow.md
Last active May 7, 2020 19:08
[vifm] Huongdan Vim vifm

'h home ^w s ^w v vertical :vs ^w o onelyone :vo

e preview q quit

w preview right side shift-tab

@khangvan
khangvan / virtualenv.bash
Created January 27, 2020 07:10
python3_virtualenv_venv_operation
#check python version
python -V
# install
pip3 install virtualenv
# create env
python3 -m venv base
# activate
source base/bin/activate
# deativate
deactivate

alternating powershell command line to ps as shortcut command

  1. under administrator
  2. run command line below
mklink %SystemRoot%\system32\WindowsPowerShell\v1.0\ps.exe %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe
@khangvan
khangvan / How_to_start_streamlit_as_window_services.md
Last active March 4, 2020 04:36
[streamlit] graphviz #streamlit #python

note: not work as expectation

lỗi hay gặp là interpêtr dùng trên conda

check where python để lấy đúng env

c:\ProgramData\Anaconda3\python.exe

check where streamlit

c:\ProgramData\Anaconda3\Scripts\streamlit.exe

plan run app

git status #
git add . #
git commit -m my_comment
#cach 1
git fetch origin # download remote to local, but not touch to my workspace
git diff master origin/master # check what missing from workspace compare to remote
git log origin/master ^master #show log compare new from remote
git merge master/origin