Skip to content

Instantly share code, notes, and snippets.

View tuaris's full-sized avatar

Daniel Morante tuaris

View GitHub Profile
@daemonhorn
daemonhorn / freebsd_yubikey_authentication.md
Last active March 14, 2024 01:31
Setting up yubikey/solo2 for piv, fido, and gpg on FreeBSD (Firefox, Chromium, PAM, SSH, and GnuPG)

Overview

How to configure FreeBSD and applicable applications to work with Yubikey for authentication. This serves as my work-in-progress documentation of the configuration knobs needed to make this work properly.

  • FreeBSD ssh with piv smartcard slot on Yubikey (pkcs11 via libykcs11.so)
  • FreeBSD ssh with fido support on Yubikey
  • FreeBSD Firefox/Chromium with fido + webauthn support on Yubikey
  • FreeBSD local console and gdm authentication using pam on Yubikey
  • FreeBSD official YubiKey tools

Latest Tested FreeBSD versions

  • FreeBSD 13.2 Testing (Aug 2023)
  • FreeBSD stable/13 Testing (Aug 2023) with OpenSSH_9.3p2
@yzgyyang
yzgyyang / FreeBSD_mount_img_files.md
Created June 28, 2017 20:46
FreeBSD mount img files

Determine the file system by using the file-utility.

file image.img

Use mdconfig to link the IMG image to a virtual device.

mdconfig -a -t vnode -f /path/to/image.img -u 0
@ePirat
ePirat / INSTALL.md
Last active April 7, 2023 13:43
Cross-compile libaacs for Windows (64bit)

Cross-compile libaacs for Windows (64bit)

For this guide the ubuntu:yakkety Docker image was used.

Install the cross-compile toolchain

apt-get install mingw-w64-tools gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 wget gettext bison flex
#!/bin/sh
log_name="filer"
log_prio="user.notice"
flog () {
logger -p "$log_prio" -t "$log_name" "$1"
}
boottime=$(sysctl -n kern.boottime | awk '{print $4}' | tr -dc 0-9)
@rosado
rosado / Makefile
Last active February 2, 2022 00:41
test if directory exists in a makefile
all: txtfile
TARGET_DIR = target-dir
txtfile: $(TARGET_DIR)
touch $(TARGET_DIR)/file.txt
target-dir:
test ! -d $(TARGET_DIR) && mkdir $(TARGET_DIR)
@clemensg
clemensg / etc_make.conf
Last active June 1, 2020 21:37
My FreeBSD make.conf
# /etc/make.conf
# Clemens Gruber, 2017
#
# Nearby mirror
#MASTER_SITE_OVERRIDE="ftp://ftp.at.freebsd.org/pub/FreeBSD/ports/distfiles/"
#MASTER_SITE_OVERRIDE="ftp://ftp.de.freebsd.org/pub/FreeBSD/ports/distfiles/"
# Build
MAKE_JOBS_NUMBER?=8
@bryhal
bryhal / gist:4129042
Created November 22, 2012 02:08
MYSQL: Generate Calendar Table
DROP TABLE IF EXISTS time_dimension;
CREATE TABLE time_dimension (
id INTEGER PRIMARY KEY, -- year*10000+month*100+day
db_date DATE NOT NULL,
year INTEGER NOT NULL,
month INTEGER NOT NULL, -- 1 to 12
day INTEGER NOT NULL, -- 1 to 31
quarter INTEGER NOT NULL, -- 1 to 4
week INTEGER NOT NULL, -- 1 to 52/53
day_name VARCHAR(9) NOT NULL, -- 'Monday', 'Tuesday'...
@johntyree
johntyree / getBlockLists.sh
Last active March 9, 2024 12:32
Make one large blocklist from the bluetack lists on iblocklist.com
#!/usr/bin/env sh
# Download lists, unpack and filter, write to stdout
curl -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'
@richieforeman
richieforeman / makeauthority.sh
Created July 23, 2012 21:38
Issue Your Own Self-Signed S/MIME Certs with OpenSSL
# Run this once
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
@ishworgurung
ishworgurung / kevent_srv.py
Created May 24, 2012 07:15
So, how can I use kqueue/kevent on BSD/Mac using Python?
#!/usr/bin/env python
"""
Example on using Kqueue/Kevent on BSD/Mac
using Python.
The TCP server essentially echoes back the
message it receives on the client socket.
"""
__author__ = "Ishwor Gurung <ishwor@develworx.com>"