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 / zsh configuration.sh
Last active January 7, 2023 14:36
zsh configuration
#!/usr/bin/env bash
echo "Install dependencies now..."
sudo -- sh -c "apt update && apt install -y curl fzf gawk git python3-pygments sqlite3 ssh-askpass wget zsh"
if [ -f ~/.zshrc ]; then
mv ~/.zshrc ~/.zshrc.`date +%s`.bak
fi
if [ -d ~/.oh-my-zsh ]; then
echo "Oh My ZSH exists, update it now..."
git -C ~/.oh-my-zsh pull
@grammy-jiang
grammy-jiang / vimrc
Last active October 6, 2023 09:40
$HOME/.vimrc
" =========================================================================== "
" Github URL
" https://gist.githubusercontent.com/grammy-jiang/162f271c59a97a424d228f0de10d05e9/raw
" Shorten URL
" https://git.io/JvpSM
" =========================================================================== "
set encoding=utf-8
if empty(glob('~/.vim/autoload/plug.vim'))
@grammy-jiang
grammy-jiang / docker sentry.md
Last active April 3, 2020 07:43
Docker Sentry
foo@bar:~$ docker run \
  --detach \
  --name sentry-redis \
  redis:alpine
foo@bar:~$ docker run \
  --detach \
  --name sentry-postgres \
  --env POSTGRES_PASSWORD=<password> \
  --env POSTGRES_USER=<username> \
@grammy-jiang
grammy-jiang / i3 setup.md
Last active June 18, 2022 15:14
i3 setup and configuration on Raspberry Pi 3
@grammy-jiang
grammy-jiang / firewalld.conf
Created March 16, 2020 04:14
The configuration of firewalld
# firewalld config file
# default zone
# The default zone used if an empty zone string is used.
# Default: public
DefaultZone=public
# Minimal mark
# Marks up to this minimum are free for use for example in the direct
# interface. If more free marks are needed, increase the minimum
@grammy-jiang
grammy-jiang / public.xml
Last active March 16, 2020 01:27
The zone configuration of public
<?xml version="1.0" encoding="utf-8"?>
<zone>
<short>Public</short>
<description>For use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.</description>
<interface name="eth0"/>
<service name="dhcpv6-client"/>
<service name="mosh"/>
</zone>
@grammy-jiang
grammy-jiang / knockd.conf
Last active March 8, 2020 05:06
/etc/knockd.conf on Raspberry Pi, refer to https://linux.die.net/man/1/knockd
[options]
UseSyslog
[opencloseSSH]
sequence = 7000,8000,9000
seq_timeout = 5
tcpflags = syn
start_command = /usr/bin/firewall-cmd --zone=public --add-service=ssh
cmd_timeout = 10
stop_command = /usr/bin/firewall-cmd --zone=public --remove-service=ssh
@grammy-jiang
grammy-jiang / knockd (etc_defalut_knockd)
Last active March 7, 2020 12:50
/etc/default/knockd on Raspberry Pi, refer to https://linux.die.net/man/1/knockd
# control if we start knockd at init or not
# 1 = start
# anything else = don't start
# PLEASE EDIT /etc/knockd.conf BEFORE ENABLING
START_KNOCKD=1
# command line options
KNOCKD_OPTS="--interface eth0"
@grammy-jiang
grammy-jiang / vimrc.local
Last active October 31, 2022 12:17
/etc/vim/vimrc.local
" =============================================================================
" Github URL
" https://gist.githubusercontent.com/grammy-jiang/ae2218062be5f493e24492ad6b62b3a2/raw
" Shorten URL
" https://git.io/JvpS2
" =============================================================================
set nocompatible
" Vim5 and later versions support syntax highlighting. Uncommenting the next
@grammy-jiang
grammy-jiang / setup_raspberry_pi_environment.md
Last active May 31, 2024 14:09
Setup Raspberry Pi Environment (Raspbian)

Major Tools

foo@bar:~$ sudo -- sh -c "timedatectl set-timezone Australia/Sydney && date" && \
sudo -- sh -c "apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y && apt-get autoremove -y" && \
sudo -- sh -c "apt-get install -y vim-nox && wget --output-document=/etc/vim/vimrc.local https://git.io/JvpS2" && \
sudo -- sh -c "apt-get install -y curl direnv exa git lnav mosh tig tree vifm watchman" && \
sudo -- sh -c "apt-get install -y python3-pip python3-testresources python3-pywatchman"