Skip to content

Instantly share code, notes, and snippets.

View hydrz's full-sized avatar
🌌
Focusing

夜访萤火虫 hydrz

🌌
Focusing
View GitHub Profile
@hydrz
hydrz / alibaba_checks.xml
Created May 6, 2019 09:49
阿里巴巴Java代码规约
<?xml version="1.0" ?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<!-- 检查文件是否以一个空行结束 -->
<module name="NewlineAtEndOfFile" />
<!-- 文件长度不超过1500行 -->
<module name="FileLength">
<property name="max" value="1500" />
</module>
<!-- 每个java文件一个语法树 -->
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Maintainer:
" Amir Salihefendic — @amix3k
"
" Awesome_version:
" Get this config, nice color schemes and lots of plugins!
"
" Install the awesome version from:
"
" https://github.com/amix/vimrc
@hydrz
hydrz / kubernetes-dashboard-v1.10.1.yaml
Last active September 10, 2019 17:03
kubenetes deployments
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@hydrz
hydrz / unixbench.sh
Created September 5, 2019 04:25
unixbench.sh
#! /bin/bash
cur_dir=/tmp/unixbench
# Check System
[[ $EUID -ne 0 ]] && echo 'Error: This script must be run as root!' && exit 1
[[ -f /etc/redhat-release ]] && os='centos'
[[ ! -z "$(egrep -i debian /etc/issue)" ]] && os='debian'
[[ ! -z "$(egrep -i ubuntu /etc/issue)" ]] && os='ubuntu'
[[ "$os" == '' ]] && echo 'Error: Your system is not supported to run it!' && exit 1
@hydrz
hydrz / OpenVPN 2.0 的服务器端配置文件示例
Last active October 22, 2019 12:35
OpenVPN 2.0 的服务器端配置文件示例
#################################################
# 针对多客户端的OpenVPN 2.0 的服务器端配置文件示例
#
# 本文件用于多客户端<->单服务器端的OpenVPN服务器端配置
#
# OpenVPN也支持单机<->单机的配置(更多信息请查看网站上的示例页面)
#
# 该配置支持Windows或者Linux/BSD系统。此外,在Windows上,记得将路径加上双引号,
# 并且使用两个反斜杠,例如:"C:\\Program Files\\OpenVPN\\config\\foo.key"
#
@hydrz
hydrz / idevicerestore.sh
Created November 6, 2019 10:01 — forked from stek29/idevicerestore.sh
idevicerestore on linux (Debian-based)
sudo apt update
# sudo apt upgrade
sudo apt install -y libcurl4-openssl-dev libplist-dev libzip-dev openssl libssl-dev libusb-1.0-0-dev libreadline-dev build-essential git make automake libtool pkg-config
git clone https://github.com/libimobiledevice/libirecovery
git clone https://github.com/libimobiledevice/idevicerestore
git clone https://github.com/libimobiledevice/usbmuxd
git clone https://github.com/libimobiledevice/libimobiledevice
git clone https://github.com/libimobiledevice/libusbmuxd
git clone https://github.com/libimobiledevice/libplist
@hydrz
hydrz / zsh_terminal_proxy
Created November 11, 2019 10:52
终端走代理
# proxy list
alias proxy='export all_proxy=socks5://127.0.0.1:1080'
alias unproxy='unset all_proxy'
@hydrz
hydrz / k3s.sh
Created November 12, 2019 09:44
k3s安装脚本
#!/bin/sh
set -e
# Usage:
# curl ... | ENV_VAR=... sh -
# or
# ENV_VAR=... ./install.sh
#
# Example:
# Installing a server without traefik:
@hydrz
hydrz / app-install.sh
Created November 19, 2019 08:19
常用centos软件
#!/bin/sh
yum -y install wget openssl tar gawk grep sed \
bind-utils net-tools iproute iptables iptables-services \
git htop iftop iotop bash-completion vim
@hydrz
hydrz / 简易网关
Last active November 20, 2019 04:00
#!/bin/sh
# 开启转发
echo 'net.ipv4.ip_forward=1' >/usr/lib/sysctl.d/20-forward.conf
sysctl -p
# 指定外网 IP
# iptables -t nat -A POSTROUTING -s 192.168.0.0/16 -j SNAT --to-source 192.168.0.1
# 内网段