Skip to content

Instantly share code, notes, and snippets.

View i3h's full-sized avatar

i3h

  • Mars
View GitHub Profile
#!/bin/bash
# Bash color
echo "export LS_OPTIONS='--color=auto'" >> /root/.bashrc
echo "eval \"\`dircolors\`\"" >> /root/.bashrc
echo "alias ls='ls \$LS_OPTIONS'" >> /root/.bashrc
source /root/.bashrc
# Install packages
apt update
apt install -y vim python3-pip vnstat sysstat lsof tcptrack tcpdump \
@i3h
i3h / init_vm.sh
Last active January 2, 2022 01:34
#!/bin/bash
# Bash color
echo "export LS_OPTIONS='--color=auto'" >> /root/.bashrc
echo "eval \"\`dircolors\`\"" >> /root/.bashrc
echo "alias ls='ls \$LS_OPTIONS'" >> /root/.bashrc
source /root/.bashrc
# Install packages
apt update
apt install -y vim python3-pip vnstat sysstat lsof tcptrack tcpdump \
# $OpenBSD: sshd_config,v 1.100 2016/08/15 12:32:04 naddy Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
@i3h
i3h / .vimrc
Last active December 18, 2021 13:47
set nocompatible
autocmd BufReadPost * if line("'\"") && line("'\"") <= line("$") | exe "normal `\"" | endif
set noexpandtab
set shiftwidth=8
set tabstop=8
set bs=2 " allow backspacing over everything in insert mode set bs=2
set cursorline " highlight cursor line
"set cursorcolumn " highlight cursor column
set nu " set line number
#!/bin/bash
# Letting iptables see bridged traffic
cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
br_netfilter
EOF
cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
#!/bin/bash
# Letting iptables see bridged traffic
cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
br_netfilter
EOF
cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
@i3h
i3h / axios_fix_proxy.js
Created July 11, 2020 17:33
Fix axios proxy issue
const axios = require('axios').default;
const HttpsProxyAgent = require('https-proxy-agent');
axios.interceptors.request.use(config => {
if (config.proxy) {
if (config.url.indexOf('https') !== -1) {
let httpsAgent = new HttpsProxyAgent(config.proxy);
config.httpsAgent = httpsAgent;
config.proxy = false;
}
@i3h
i3h / for_loop_routines.go
Created June 26, 2020 18:21
Use goroutines to run a list of jobs
package main
import (
"fmt"
"runtime"
"sync"
)
func main() {
// Number of routines, can be set as number of CPUs.