Skip to content

Instantly share code, notes, and snippets.

View tankhuu's full-sized avatar

Tan Khuu tankhuu

  • Ho Chi Minh, Viet Nam
View GitHub Profile
@tankhuu
tankhuu / jupyterlab_shortcuts.md
Created June 4, 2023 02:35 — forked from discdiver/jupyterlab_shortcuts.md
Common Jupyter Lab Keyboard Shortcuts

If you are on a Mac, substitute command for control. Don't type the + (it means press both keys at once).

Shortcuts when in either command mode (outside the cells) or edit mode (inside a cell):

  • Shift + Enter run selected cell or cells - if no cells below, insert a code cell below

  • Ctrl + B toggle hide/show left sidebar

  • Ctrl + S save and checkpoint

  • Ctrl + Shift + S save as

@tankhuu
tankhuu / install.md
Created November 3, 2022 08:38 — forked from Ryanb58/install.md
How to install telnet into a alpine docker container. This is useful when using the celery remote debugger in a dev environment.
>>> docker exec -it CONTAINERID /bin/sh
/app # telnet
/bin/sh: telnet: not found

/app # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.0-243-gf26e75a186 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-229-g087f28e29d [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
@tankhuu
tankhuu / Install Font MesloLGS NF.md
Last active September 8, 2022 16:32
ZSH + Oh my ZSH + Power10k

The most common thing of using ZSH + Power10k is the pretty icons

But in most of case, we can't see them because of font

For VSCode or Unbutu Terminal in Windows

Good way is to install FMesloLGS NF font & change it to that

Follow guide from here:

@tankhuu
tankhuu / InstallPlugins
Last active August 31, 2022 15:38
Jenkins Utilities
# Install Plugins from file
jenkins-plugin-cli --plugin-file /usr/share/jenkins/ref/plugins.txt
# Situation
aws s3 cp --recursive . s3://bucket_name/
# Command run success but the exit code is 1
# Reason is because there are some upload failed, most of them failed cause the file is empty
`seek() takes 2 positional arguments but 3 were given`
==> This is because we are trying to upload an empty file and the awscli we are using is installed from ubuntu repository by
apt install awscli (https://github.com/aws/aws-cli/issues/2583)
# Solution
# Uninstall current awscli
environment {
FULL_PATH_BRANCH = "${sh(script:'git name-rev --name-only HEAD', returnStdout: true)}"
GIT_BRANCH = FULL_PATH_BRANCH.substring(FULL_PATH_BRANCH.lastIndexOf('/') + 1, FULL_PATH_BRANCH.length())
}
# Install JDK 8
wget https://s3-ap-southeast-1.amazonaws.com/software/jdk-8u212-linux-x64.rpm
sudo rpm -Uvh jdk-8u221-linux-x64.rpm
java -version
# Setup Apache Druid
## Download druid
wget http://mirror.downloadvn.com/apache/incubator/druid/0.15.0-incubating/apache-druid-0.15.0-incubating-bin.tar.gz
tar -xzf apache-druid-0.15.0-incubating-bin.tar.gz
## Download Zookeeper
@tankhuu
tankhuu / amz2-install-apache-airflow.sh
Last active July 29, 2019 15:16
MorphL Installation
sudo yum install -y python3 python3-devel python3-pip gcc gcc-c++ git
python3 -V
sudo pip3 install apache-airflow[jdbc,s3,slack,oracle,postgres,ssh]
sudo pip3 install flask
airflow initdb
mkdir github
cd github/
git clone https://github.com/apache/airflow.git
sudo cp -p airflow/scripts/systemd/airflow-*.service /usr/lib/systemd/system
sudo cp -p airflow/scripts/systemd/airflow.conf /usr/lib/tmpfiles.d/
@tankhuu
tankhuu / kill_long_run_query_on_rds_by_percona_toolkit.sh
Created July 2, 2019 04:22
Kill Long Run Query on AWS RDS by Percona-Tookit
sudo yum install https://repo.percona.com/yum/percona-release-latest.noarch.rpm
sudo yum -y install percona-toolkit
@tankhuu
tankhuu / amazon_linux_install_goaccess.sh
Created January 15, 2019 11:57
Install GoAccess - real-time web log analyzer in Amazon Linux
sudo yum install ncurses-devel geoip-devel libmaxminddb-devel tokyocabinet-devel openssl-devel
wget https://tar.goaccess.io/goaccess-1.3.tar.gz
tar -xzvf goaccess-1.3.tar.gz
cd goaccess-1.3/
./configure --enable-utf8 --enable-geoip=legacy
make
sudo make install
# Run
# goaccess /var/log/nginx/access.log -c