Skip to content

Instantly share code, notes, and snippets.

@edacval
edacval / lxcon.md
Created June 18, 2023 12:51 — forked from alexforster/lxcon.md
LXD: accessing container's consoles
~# lxc profile device show default
# (...sic...)
console:
  path: /dev/console
  type: unix-char
tty:
  path: /dev/tty
  type: unix-char
tty0:
@edacval
edacval / 99-99-aur.hook
Created February 15, 2020 23:53 — forked from h4tr3d/99-99-aur.hook
AUR basic integrity check
# /usr/share/libalpm/hooks/99-99-aur.hook
[Trigger]
Operation = Upgrade
Type = Package
Target = *
[Action]
Description = "Check non-repo packages integrity"
Depends = auracle
When = PostTransaction
@edacval
edacval / letsencrypt_esxi.sh
Last active August 16, 2019 14:45 — forked from shr00mie/letsencrypt_esxi.sh
Let's Encrypt SSL for ESXi
#!/bin/bash
#
## -------------------------------=[ Info ]=--------------------------------- ##
#
# Generate letsencrypt cert on local server and scp to esxi target.
# Designed and tested on Ubuntu 16.04LTS.
# Assumes you have upnp control over local network. Tested with Ubiquiti USG.
#
# Dependencies:
# miniupnpc (sudo apt install miniupnpc)
@edacval
edacval / gist:4a6a615b4307159b83dda671223798f9
Created February 7, 2019 09:49 — forked from kbarber/gist:5022099
All matchers for iptables (or at least as many as I could get working from the docs)
# Generated by iptables-save v1.4.7 on Sun Feb 24 00:48:11 2013
*mangle
:PREROUTING ACCEPT [756:54757]
:INPUT ACCEPT [756:54757]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [578:527896]
:POSTROUTING ACCEPT [578:527896]
-A INPUT -s 1.1.1.2/32 -j CHECKSUM --checksum-fill
-A OUTPUT -s 1.1.1.2/32 -j CLASSIFY --set-class 0004:0056
COMMIT
@edacval
edacval / README.md
Created April 7, 2018 19:46 — forked from smoser/README.md
iscsi / ibft booting test

iscsi and iBFT test using qemu/kvm and ipxe

The general goal of this doc is to show how to use qemu, ipxe and tgt to test iscsi and iBFT.

There are loads of things that could be done to make this test environment. But for now, it just shows a simple case to show parameters necessary.

Setting up iscsi test environment

In examples here, the iscsi server is available at 192.168.1.10. The qemu host system is available at 192.168.1.11. We assume port 9999 is available to run a python simple web server.

@edacval
edacval / archzfs-alarmpi1-compile.sh
Created October 10, 2017 17:48 — forked from tsjk/archzfs-alarmpi1-compile.sh
Compilation of ARCHZFS on ALARMPI1 (V.I.P.)
#!/bin/bash
# This can be run as:
# bash -i -c "source <(curl -L 'https://gist.githubusercontent.com/tsjk/4b387dd685b9942bcc23497fd3345b99/raw')"
LTS_KERNEL_VERSION=$(wget -qO- 'https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=zfs-linux-lts' | \
grep -oP '(?<="linux-lts=)[0-9\.-]+(?=")' | head -n 1)
LTS_KERNEL_VERSION_ESCAPED=$(echo "${LTS_KERNEL_VERSION}" | sed 's@\.@\\\.@g')
LTS_KERNEL_REVISION=$(wget -qO- 'https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=zfs-linux-lts' | \
grep -oP '(?<=-)[0-9]+(?=-lts\/build)' | head -n 1)
@edacval
edacval / sed cheatsheet
Created October 7, 2017 18:59 — forked from un33k/sed cheatsheet
magic of sed -- find and replace "text" in a string or a file
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
@edacval
edacval / ansible-summary.md
Created June 20, 2017 19:44 — forked from AdamOssenford/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@edacval
edacval / zfs
Created April 10, 2017 02:38 — forked from kiela/zfs
HOWTO: Hetzner + FreeBSD 10.3 + mirrored root ZFS mountpoint optimized for 4K drives
[root@rescue ~]# kldload zfs
[root@rescue ~]# sysctl kern.geom.label.gptid.enable=0
kern.geom.label.gptid.enable: 1 -> 0
[root@rescue ~]# gpart destroy -F nvd0
nvd0 destroyed
[root@rescue ~]# gpart destroy -F nvd1
nvd1 destroyed
# Getting "gpart: arg0 'nvdN': Invalid argument" is alright as it means that there was no partition table on the disk anyway.
[root@rescue ~]# gpart create -s gpt nvd0
#!/usr/bin/env sh
# Location of executables
IPSET=/usr/sbin/ipset
IPTABLES=/sbin/iptables
# Common definitions
COMMENT="-m comment --comment"
LOG="ULOG --ulog-nlgroup 1 --ulog-prefix"
DONT_LOG=""