Skip to content

Instantly share code, notes, and snippets.

View hyer's full-sized avatar

Hyer Chen hyer

  • Hangzhou, China
View GitHub Profile
[
{ "keys": ["ctrl+k", "ctrl+h"], "command": "move_to", "args": {"to": "bol", "extend": false} },
{ "keys": ["ctrl+k", "ctrl+e"], "command": "move_to", "args": {"to": "eol", "extend": false} },
{ "keys": ["ctrl+."], "command": "move", "args": {"by": "characters", "forward": true} }
]
#include <gtk/gtkimcontext.h>
/*
(1) COMPILE:
cd ~
gcc -shared -o libsublime-imfix.so sublime_imfix.c `pkg-config --libs --cflags gtk+-2.0` -fPIC
sudo mv libsublime-imfix.so /opt/sublime_text/
(2) CHANGE:
sudo gedit /usr/bin/subl
[Desktop Entry]
Version=1.0
Type=Application
Name=Sublime Text
GenericName=Text Editor
Comment=Sophisticated text editor for code, markup and prose
Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text %F"
Terminal=false
MimeType=text/plain;
Icon=sublime-text
# install the opencv4tegra for TK1 with the system version of 21.2.
sudo dpkg -i libopencv4tegra-repo_l4t-r21_2.4.10.1_armhf.deb
sudo apt-get update
sudo apt-get install libopencv4tegra libopencv4tegra-dev libopencv4tegra-python -y # note that libopencv4tegra-python is diff from python-opencv, it's not compatible with python-opencv.
# install additional packages
# sudo apt-get install python-opencv
# sudo apt-get install python-scipy python-numpy python-matplotlib
# wget https://bootstrap.pypa.io/get-pip.py
# sudo python get-pip.py
# install the CUDA repo metadata that you downloaded manually for L4T
sudo dpkg -i cuda-repo-l4t-r21.2-6-5-prod_6.5-34_armhf.deb
# Download & install the actual CUDA Toolkit including the OpenGL toolkit from NVIDIA. (It only downloads around 15MB)
sudo apt-get update
# Install "cuda-toolkit-6-0" if you downloaded CUDA 6.0, or "cuda-toolkit-6-5" if you downloaded CUDA 6.5, etc.
sudo apt-get install cuda-toolkit-6-5 -y
# Add yourself to the "video" group to allow access to the GPU
sudo usermod -a -G video $USER
echo "# Add CUDA bin & library paths:" >> ~/.bashrc
echo "export PATH=/usr/local/cuda/bin:$PATH" >> ~/.bashrc
@hyer
hyer / install-ffmpeg.sh
Last active October 9, 2021 17:26
installing ffmpeg from source code.
# You should download the ffmpeg source code from the http://ffmpeg.org/
# libx264 need yasm, so we install yasm first
sudo apt-get install yasm
sudo apt-get install libx264-dev
# then, install the required packages
sudo apt-get install libfaac-dev
sudo apt-get install libmp3lame-dev
sudo apt-get install libtheora-dev