Skip to content

Instantly share code, notes, and snippets.

View grammy-jiang's full-sized avatar
:octocat:
Do one thing, do it well

Grammy Jiang grammy-jiang

:octocat:
Do one thing, do it well
View GitHub Profile
@grammy-jiang
grammy-jiang / omniORB and omniORBpy.md
Last active August 3, 2023 05:24
omniORB and omniORBpy installation
  1. omniORB
foo@bar:~$ sudo dnf install openssl libzstd-devel
foo@bar:~$ ../configure --enable-thread-tracing --with-openssl=/usr/bin PYTHON=$HOME/.pyenv/shims/python
foo@bar:~$ make -j
foo@bar:~$ sudo make install
foo@bar:~$ omniidl -V
omniidl version 1.0
  1. omniORBpy
@grammy-jiang
grammy-jiang / download_gitignore.sh
Last active October 13, 2023 01:47
git configurations
# Download the file:
wget --output-document .gitignore https://www.toptal.com/developers/gitignore/api/linux,windows,macos,vim,emacs,jetbrains+all,visualstudiocode,c,c++,go,java,node,python,rust,helm,bazel
@grammy-jiang
grammy-jiang / trojan_database_management.md
Last active April 4, 2021 04:43
Trojan Database Management

Create the table of users_summary:

CREATE OR REPLACE TABLE users_summary
(
    id                INT       NOT NULL AUTO_INCREMENT PRIMARY KEY,
    user_id           INT       NOT NULL COMMENT 'the id in the table of users',
    created_timestamp TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'the timestamp created this record',
    download          BIGINT UNSIGNED COMMENT 'the download in the table of users',
    upload            BIGINT UNSIGNED COMMENT 'the upload in the table of users',
    INDEX user_id__index (user_id) COMMENT 'the index of user_id',
#!/usr/bin/env bash
IMAGES="images"
PATTERN_RASPBERRY_PI_OS='\.\/images\/([0-9]{4}-[0-9]{2}-[0-9]{2})-(raspios)-([^-]*?)-(armhf)(-(full|lite)){0,1}\.zip'
PATTERN_UBUNTU='\.\/images\/ubuntu-[0-9.]*?-(preinstalled)-(desktop|server)-(arm64|armhf)\+raspi\.img\.xz'
PATTERN_OPENWRT='\.\/images\/openwrt-[0-9.]+-bcm27xx-bcm27[0-9]{2}-rpi(-[0-9])?-squashfs-factory\.img\.gz'
declare -A SUPPORT_OS
#!/usr/bin/env bash
BITS=$(getconf LONG_BIT)
OS=$(lsb_release -si)
function add_repo() {
echo 'deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Raspbian_10/ /' | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Raspbian_10/Release.key | sudo apt-key add -
sudo apt-get update
}
@grammy-jiang
grammy-jiang / time configuration.md
Last active January 19, 2023 09:24
time configuration on Raspberry Pi with Ubuntu

Time Service

NTP

Server

foo@bar:~$ sudo apt install --yes ntp
@grammy-jiang
grammy-jiang / ideavimrc
Last active November 19, 2023 04:54
$HOME/.ideavimrc
" ============================================================================ "
" URL Original: https://gist.github.com/grammy-jiang/3d4f9bab3bc2a94dc676f69310ff56ea/raw
" URL Shorten: https://git.io/JcVKE
"
" Usage:
" wget --output-document=$HOME/.ideavimrc https://git.io/JcVKE
" ============================================================================ "
set showcmd " show (partial) command in the status bar
@grammy-jiang
grammy-jiang / pyenv and python install.sh
Last active March 24, 2022 06:03
Install pyenv and python 3.8.2
# Origianl url:
# https://gist.githubusercontent.com/grammy-jiang/bd07d16412b0f250063b703cf988190b/raw
# Shorten url:
# https://git.io/JfLCd
# install pyenv and python 3.9.6
# Usage:
# foo@bar:~$ curl --location --show-error --silent https://git.io/JfLCd | bash -s - 3.9.6
set -x
@grammy-jiang
grammy-jiang / id_rsa.pub
Last active April 26, 2020 08:21
public ssh key of grammy-jiang@lenovo-y510p
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAABAEAu8cFTKj4rAe00WX7dIMeP2F8MywdgJMhaGuH/E3CbCyKAgmd9NQ/v8gjh+bangiY8Z6XhyoxDr2gvcUhIJGKXgU5xobrjbSeLhURLX+dctH//1ZyjrwWKaBuD81P0byPIM3TU9r7FoAqinTFDtECOU8ou9y9VQEilJDomrElBbjar50Nab+vNvT1mv8Kx202/nj56I7nZ+h7iPbxZ9N0LeZTidG/pWxgv8E3AvExORWcRwqbbxB2N7QNGTvF34ygrMI0yI6HcrdOHMuyW8POC5E/dXfrr5JYjhMqzxGb0GhPzLorwmUQjvhkEFDsSOEczu6W7TnSYD7ssNuwU3E+xw8PikbhRSLglkxVUNyI4zYXjFZV4xQV8UdzChjGxgTKG51oLKwBIUImBmoeeNenw1tGRcp3eINTAglAcIEJVzjoyYWWNbpjjI8CrWL3mFd4kukoClNf1XysRYxzy0hUk12TKXgD8hBA9/GQmBtA6eby51MjVAot6zeKX66tCsYNDRt9QoUHjNmfqfshGbNOAhBXQ50QYM5QJBxZicqJVVTtkvhc4fwD9UjYz+qIL5ftorPOCzIAqL9gQhjX4xqH6NiBqDMYOVnSQLxgZj7ARGsQCyl6U6nLKkfcywK5fGPkqLJkAPPBF+KwFP0ggsOxhWlrpqw71L6KvTRERDIyktrlq+6QtlFmO28V340PXy4Xlb8jultCfJ/kqojt8bVNgbxJB2eAQIIZD5/6qoipcVvCcLchFuVeYYF6YH2z61OaX0SggDb23CzoaAKURmFv4eFzZSRr/9St30772r/vbdDQEX7cwdFocCVGwuCLovmWE+QTQ7ixF3Dof/Gslx37rs4BrntEaADT3IQEkXV06NTjMU3C6OVjUhGqqH8d6j/G+DxPjVCFTB7ouhyTMQBfyDgQSl4H3KFpxlxOTILOa8pQenzoBitGSwFYsCDXIIBVxe+S90b4MTdH98PQwDywlA+t7xyO
@grammy-jiang
grammy-jiang / .p10k.zsh
Last active November 1, 2020 23:32
.p10k.zsh
# Generated by Powerlevel10k configuration wizard on 2020-04-10 at 00:13 AEST.
# Based on romkatv/powerlevel10k/config/p10k-rainbow.zsh, checksum 08386.
# Wizard options: nerdfont-complete + powerline, small icons, rainbow, unicode,
# vertical separators, blurred heads, flat tails, 2 lines, disconnected, no frame,
# compact, many icons, concise, transient_prompt, instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with powerline prompt style with colorful background.
# Type `p10k configure` to generate your own config based on it.
#