Skip to content

Instantly share code, notes, and snippets.

View rogerlin0330's full-sized avatar
🎯
Focusing

Roger Lin rogerlin0330

🎯
Focusing
View GitHub Profile
@rogerlin0330
rogerlin0330 / install-redis.sh
Last active April 30, 2021 21:27 — forked from FUT/install-redis.sh
Install Redis on EC2
1. Install Linux updates, followed by GCC and Make
sudo yum update
sudo yum install gcc make
sudo yum install tcl
2. Download, Untar and Make Redis 6.2.2 (check here http://redis.io/download)
cd /tmp
@rogerlin0330
rogerlin0330 / visualstudiocode.settings
Last active July 24, 2019 14:38
Sample settings for Visual Studio Code
{
"python.formatting.provider": "black",
"python.linting.flake8Enabled": true,
"python.linting.flake8Args": [
"--ignore=E501",
"--verbose"
],
"editor.fontSize": 13,
"editor.formatOnSave": true,
"python.jediEnabled": false,
@rogerlin0330
rogerlin0330 / visualstudiocode.plugin
Created July 24, 2019 14:25
Useful plugin list for Visual Studio Code
Beautify - HookyQR;
Dash - Budi Irawan;
Debugger for Java - Microsoft;
Docker - Microsoft;
EditorConfig for VS Code - EditorConfig;
FreeMarker - Daniel Cortes;
Java Dependency Viewer - Microsift;
Java Extension Pack - Microsoft;
Java Test Runner - Microsoft;
Kubernetes - Microsoft;
@rogerlin0330
rogerlin0330 / fan_speed.py
Last active July 21, 2019 08:15
CPU fan speed control settings for Raspberry Pi (fan_speed.py should be placed in /usr/bin, and fanctrl.service should be placed in /etc/systemd/system if the operating system is Raspbian); The dependency should be installed by pip install RPi.GPIO
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
import logging
import RPi.GPIO
import time
logging.basicConfig(
level=logging.INFO,
format=(
@rogerlin0330
rogerlin0330 / bind-br0.network
Created July 21, 2019 07:49
Network bridges sample settings based on systemd-networkd (https://wiki.archlinux.org/index.php/Systemd-networkd#Bridge_interface). All these configuration files should be placed in the /etc/systemd/network directory
[Match]
Name=eno1
[Network]
Bridge=br0
@rogerlin0330
rogerlin0330 / v2ray-config.json
Created July 21, 2019 07:41
Configuration sample file for v2ray (https://github.com/v2ray/v2ray-core) which should be located in path: /etc/v2ray and renamed to config.json according to v2ray.service (https://gist.github.com/rogerlin0330/7823c8db35c32d9bcfa646060e098702)
{
"log": {
"loglevel": "warning",
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log"
},
"inbounds": [
{
"port": 1081,
"listen": "0.0.0.0",
@rogerlin0330
rogerlin0330 / v2ray.service
Created July 21, 2019 07:34
Server service sample for v2ray (https://github.com/v2ray/v2ray-core) which should be located in path: /usr/lib/systemd/system.
[Unit]
Description=V2Ray Service
After=network.target
Wants=network.target
[Service]
# This service runs as root. You may consider to run it as another user for security concerns.
# By uncommenting the following two lines, this service will run as user v2ray/v2ray.
# More discussion at https://github.com/v2ray/v2ray-core/issues/1011
# User=v2ray
@rogerlin0330
rogerlin0330 / shadowsocks.service
Created July 21, 2019 07:28
Server service sample for shadowsocks (https://github.com/10fish/shadowsocks) which should be located in path: /usr/lib/systemd/system.
[Unit]
Description=A secure socks5 proxy, designed to protect your Internet traffic.
After=network.target
[Service]
ExecStart=/usr/bin/ssserver -c /etc/shadowsocks/config.json
ExecStartPost=/bin/sh -c 'umask 022; pgrep ssserver > /var/run/shadowsocks.pid'
[Install]
WantedBy=multi-user.target
@rogerlin0330
rogerlin0330 / frpc.service
Created July 21, 2019 07:22
Client service sample for frp (https://github.com/fatedier/frp) which should be located in path: /usr/lib/systemd/system.
[Unit]
Description=A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet
After=network.target multi-user.target
[Service]
ExecStart=/opt/frp_0.23.2_linux_amd64/frpc -c /opt/frp_0.23.2_linux_amd64/frpc.ini
ExecStartPost=/bin/sh -c 'umask 022; pgrep frpc > /var/run/frpc.pid'
StandardOutput=file:/var/log/frpc.log
StandardError=file:/var/log/frpc.log
@rogerlin0330
rogerlin0330 / jetbrains-idea.desktop
Created July 19, 2019 15:42
Sample Gnome Entry for Jetbrain Applications (/usr/share/applications/jetbrains-idea.desktop)
[Desktop Entry]
Version=2019.1.3
Type=Application
Name=IntelliJ IDEA
Icon=/opt/idea-IU-191.7479.19/bin/idea.png
Exec="/opt/idea-IU-191.7479.19/bin/idea.sh" %f
Comment=Capable and Ergonomic IDE for JVM
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-idea