Skip to content

Instantly share code, notes, and snippets.

View fengjijiao's full-sized avatar
🎯
Focusing

follow fengjijiao

🎯
Focusing
View GitHub Profile
https://unix.stackexchange.com/questions/125382/migrate-socat-init-script-to-systemd
For socat, I use a pure systemd approach. This is an example for a serial loopback:
[Unit]
Description=Socat Serial Loopback
#Before=my-other.service
[Service]
Type=simple
@fengjijiao
fengjijiao / stream-server.go
Created June 14, 2022 08:27 — forked from wrfly/stream-server.go
go-gin | http stream server
package main
import (
"bytes"
"fmt"
"io"
"net/http"
"time"
"github.com/gin-gonic/gin"
@fengjijiao
fengjijiao / nacos-install.sh
Last active May 22, 2022 06:15
simple to install nacos
#!/bin/bash
VERSION="2.1.0"
DOWNLOAD_URL="https://github.com/alibaba/nacos/releases/download/${VERSION}/nacos-server-${VERSION}.tar.gz"
INSTALL_DIR=/usr/local/nacos-server-${VERSION}
LINK_PATH=/usr/local/nacos
TMP_DIR=/tmp/nacos
function check_error() {
if [ $? == 1 ]; then
echo $1
@fengjijiao
fengjijiao / vtun-install.sh
Last active May 18, 2022 07:01
simply to install vtun
#!/bin/bash
RELEASE_API="https://api.github.com/repos/net-byte/vtun/releases/latest"
BIN_DST_DIR=/usr/local/bin
RESOURCE_DST_DIR=/usr/local/etc/vtun
CIDR_V4="192.168.90.0/24"
CIDR_V6="fced:9999::/64"
SIP_V4="192.168.90.1"
SIP_V6="fced:9999::1"
RUNNING_LISTENER="127.0.0.1:8002"
DEFAULT_KEY="defaultkey"
@fengjijiao
fengjijiao / elasticsearch-install.sh
Last active May 19, 2022 02:18
simple to install elasticsearch
#!/bin/bash
#elasticsearch 8.2.0
#test only centos7
ES_DOWNLOAD_URL=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.2.0-linux-x86_64.tar.gz
ES_INSTALL_DIR=/usr/local/elasticsearch
ES_TMP_DIR=/tmp/elasticsearch
REQUIRED_SOFTWARE_LIST=(wget tar sed)
#perl-Digest-SHA
function check_software() {
check_software_bool $1
@fengjijiao
fengjijiao / syncthing-install.sh
Created May 7, 2022 08:48
simpe to install syncthing
#!/bin/bash
VERSION=v1.20.1
INSTALL_DIR=/usr/local/syncthing
TMP_DIR=/tmp/syncthing
HOME_DIR=/etc/syncthing
function check_error() {
if [[ $? -ne 0 ]]; then
echo $1
exit 1
fi
@fengjijiao
fengjijiao / redis-install.sh
Last active May 5, 2022 09:38
simply to install redis
#!/bin/bash
#test only centos7
REDIS_INSTALL_DIR=/usr/local/redis
REDIS_TMP_DIR=/tmp/redis
function check_error() {
if [ $? -ne 0 ]; then
echo $1
remove
exit 1
fi
@fengjijiao
fengjijiao / mysql-install.sh
Last active May 16, 2022 13:53
simply to install mysql for centos7
#!/bin/bash
#only test for centos 7
MYSQL_SERIES=8.0
MYSQL_VERSION=8.0.29
MYSQL_DOWNLOAD_URL=https://dev.mysql.com/get/Downloads/MySQL-${MYSQL_SERIES}/mysql-${MYSQL_VERSION}-el7-x86_64.tar.gz
MYSQL_INSTALL_DIR=/usr/local/mysql
MYSQL_SOURCE_DIR="${MYSQL_INSTALL_DIR}-${MYSQL_VERSION}"
MYSQL_DATA_DIR=/var/lib/mysql
MYSQL_LOG_DIR=/var/log/mariadb
DEFAULT_ROOT_PASSWORD=123456789
@fengjijiao
fengjijiao / ipip.sh
Created May 4, 2022 02:01 — forked from perfecto25/ipip.sh
IPIP Tunnel Maker
#!/bin/bash
# this script creates an IPIP Tunnel
# tested for CENTOS 6 & 7
#----------------------------
# CONFIGURATION
#----------------------------
# name of tunnel
name='tun_test'
@fengjijiao
fengjijiao / filebrowser-install.sh
Created May 4, 2022 01:58
simply to install filebrowser
#!/bin/bash
VERSION=v2.21.1
TMP_DIR=/tmp/filebrowser
BIN_DST_DIR=/usr/local/bin
RESOURCE_DST_DIR=/usr/local/etc/filebrowser
DEFAULT_BASE_URL=/manager
DEFAULT_PORT=8003
DEFAULT_LISTEN_ADDRESS=127.0.0.1
DEFAULT_ROOT_DIR=/var/www
DEFAULT_ADMIN_USERNAME=admin