Skip to content

Instantly share code, notes, and snippets.

🌴
On vacation

Luginbash Hiyajo luginbash

🌴
On vacation
View GitHub Profile
View instIpaStp1.sh
#!/bin/bash
sudo ipa-server-install -U \
-n $( awk 'BEGIN {print tolower(ENVIRON["IPA_DOMAIN"])}' ) \
-r $( awk 'BEGIN {print toupper(ENVIRON["IPA_DOMAIN"])}' ) \
-a `pass ipa/admin` \
-p `pass ipa/dm` \
--ca-subject="${IPA_COMMON_NAME}" \
--setup-dns \
--no-forwarders --auto-reverse --allow-zone-overlap \
@luginbash
luginbash / hfsToAPFS.sh
Created Nov 21, 2019
"Upgrade" a HFS drive to APFS
View hfsToAPFS.sh
#!/bin/bash
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
VOL_NAME="Macintosh HD 10142-190404"
diskutil apfs addVolume disk3 apfs Preboot -role B
VOL_UUID=$(diskutil info disk3s1 | grep "Volume UUID"|awk '{print $(NF)}')
mkdir /Volumes/Preboot/${VOL_UUID}
diskutil mount disk1s2
SRC_UUID=$(diskutil info disk1s1 | grep "Volume UUID"|awk '{print $(NF)}')
sudo rsync -xrlptgoEvHS --progress --delete /Volumes/Preboot\ 1/${SRC_UUID}/ /Volumes/Preboot/${VOL_UUID}
@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 Dec 25, 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/18.04/amd64/latest bionic 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
You can’t perform that action at this time.