Skip to content

Instantly share code, notes, and snippets.

Luginbash Hiyajo luginbash

Block or report user

Report or block luginbash

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@luginbash
luginbash / docker-compose.yml
Last active Oct 10, 2019
Dockerized EFK with Fluentbit
View docker-compose.yml
version: '3.2'
services:
fluentbit:
image: fluent/fluent-bit:latest
links:
- "elasticsearch"
ports:
- "24224:24224"
@luginbash
luginbash / nsrun.sh
Last active Jan 10, 2019
create a pair of veth for use with netns
View nsrun.sh
#!/bin/bash
netns0="{$1}"
addr0="{$2}"
ip0() { ip -n $netns0 "$@"; }
n0() { ip netns exec $netns0 "$@"; }
waitiface() { bash -c "while [[ \$(< \"/sys/class/net/$1/operstate\") != up ]]; do read -t .1 -N 0 || true; done;"; }
ip netns del $netns0 2>/dev/null || true
ip link del vin-"$netns0"
@luginbash
luginbash / cloud-config.yaml
Last active Oct 11, 2019
cloud config script
View cloud-config.yaml
#cloud-config
warnings:
dsid_missing_source: off
timezone: UTC
locale: en_US.UTF-8
apt:
sources:
saltstack.list:
source: "deb http://repo.saltstack.com/py3/ubuntu/16.04/amd64/latest xenial main"
keyid: 754A1A7AE731F165D5E6D4BD0E08A149DE57BFBE
@luginbash
luginbash / CTF_INST.md
Last active Sep 21, 2019
Installation of CTF MEG Client Software
View CTF_INST.md

CTF MEG Software Installation Guide

The CTF MEG software is a collection of tools to collect/manipulate/analyse MEG data. If you know well about the history of transitioning from 32bit Linux to 64bit, then you'll be fine without this guide. In this guide there will be some nasty hacks that works around package management situations, and therefore can be potentially harmful to the extent of system secruity and stablity. Though I am adding some tips about how to keep it as safe and sound as possible as my power allows, but consider you've been warned.

Installation of CTF MEG software cna be divided into two parts, enabling 32bit executables, and force installation some out-dated and risky libraries.

Getting Started

You need i386 version libc or glibc depends on the availabity on your platform, e.g. on Ubuntu 16.04 LTS:

@luginbash
luginbash / ZZZ.passwd
Last active Nov 23, 2016
Handling SNMP traps from another server
View ZZZ.passwd
cfSecret=
cfLogin=
View flags
-O3
-std=c++14
-stdlib=libc++
-lc++abi
-Wall
-Werror
-pthreads
View .surge.conf
[General]
# warning, notify, info, verbose
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local
bypass-tun = 0.0.0.0/8, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
loglevel = notify
# 默认 IP 和端口,不修改的话系统网络 HTTP 和 HTTPS 代理设置中就是 127.0.0.1:6152
interface = 0.0.0.0
port = 6152
@luginbash
luginbash / haproxy.cfg
Created Mar 6, 2016
haproxy tls termination with client authentication
View haproxy.cfg
# Please set $SRV_TLS_CERT, $SRV_TLS_CA accordingly.
global
maxconn 2048
log /dev/log local0
log /dev/log local1 notice
tune.ssl.default-dh-param 2048
ssl-default-bind-ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256
ssl-default-bind-options no-tls-tickets
chroot /var/lib/haproxy
stats timeout 30s
@luginbash
luginbash / functions.sh
Last active May 1, 2019
Dynamic DNS endpoint IP address update script with Mikrotik router
View functions.sh
#!/bin/bash
function snmpGetIP
{
local SNMP_HOST=$1
local SNMP_COMM=$2
local SNMP_IFID=$3
snmpwalk -Os -c ${SNMP_COMM} -v 2c ${SNMP_HOST} ipAdEntIf | grep "INTEGER: ${SNMP_IFID}" | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'
}
@luginbash
luginbash / hostIp.func.rsc
Created Dec 9, 2015
Add interface IPv4 address to a global var
View hostIp.func.rsc
# Change to the name of interface that gets the dynamic IP address
:local inetinterface "pppoe-out1";
# use search & replace all on myEndpoint for multiple hosts
:global myEndpoint;
:if ([/interface get $inetinterface value-name=running]) do={
# Get the current IP on the interface
:local currentIP [/ip address get [find interface="$inetinterface" disabled=no] address];
You can’t perform that action at this time.