Skip to content

Instantly share code, notes, and snippets.

View luginbash's full-sized avatar
😀

Luginbash luginbash

😀
View GitHub Profile
@luginbash
luginbash / Dockerfile
Created September 12, 2021 05:10
telegram-bot-api
FROM alpine:latest
WORKDIR /build
COPY . /build
RUN apk add --no-cache --virtual .build-deps \
alpine-sdk cmake gperf openssl-dev zlib-dev linux-headers \
&& mkdir build && cd build \
&& cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr/local .. \
&& cmake --build . --target install
@luginbash
luginbash / k3os-config.yaml
Created December 4, 2020 05:28
Cloud Config for K3OS
ssh_authorized_keys:
- github:luginbash
k3os:
data_sources:
- openstack
sysctl:
dns_nameservers:
- 8.8.8.8
- 1.1.1.1
#!/bin/bash
sudo ipa-server-install -U \
-n ${IPA_DOMAIN,,} \
-r ${IPA_DOMAIN^^} \
-a ${IPA_ADMIN_PASS} \
-p ${IPA_DM_PASS} \
--ca-subject="${IPA_COMMON_NAME}" \
--setup-dns \
--no-forwarders --auto-reverse --allow-zone-overlap \
--pki-config-override=/etc/ipa/override.ini \
@luginbash
luginbash / hfsToAPFS.sh
Created November 21, 2019 10:58
"Upgrade" a HFS drive to APFS
#!/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 October 10, 2019 10:10
Dockerized EFK with Fluentbit
version: '3.2'
services:
fluentbit:
image: fluent/fluent-bit:latest
links:
- "elasticsearch"
ports:
- "24224:24224"
@luginbash
luginbash / nsrun.sh
Last active January 10, 2019 07:12
create a pair of veth for use with netns
#!/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-salt-master.yaml
Last active March 23, 2024 04:10
cloud config script
#cloud-config
timezone: UTC
locale: en_US.UTF-8
apt:
preserve_sources_list: true
sources:
docker-ce.list:
source: "deb [signed-by=$KEY_FILE] https://download.docker.com/linux/debian $RELEASE stable"
keyid: "7EA0A9C3F273FCD8"
@luginbash
luginbash / CTF_INST.md
Last active September 21, 2019 11:41
Installation of CTF MEG Client Software

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 November 23, 2016 07:55
Handling SNMP traps from another server
cfSecret=
cfLogin=
@luginbash
luginbash / flags
Created May 24, 2016 02:53
gcc flags
-O3
-std=c++14
-stdlib=libc++
-lc++abi
-Wall
-Werror
-pthreads