Skip to content

Instantly share code, notes, and snippets.

View wravoc's full-sized avatar
💜
Quadhelion Engineering ONLINE

Elias Christopher Griffin wravoc

💜
Quadhelion Engineering ONLINE
View GitHub Profile
@afresh1
afresh1 / ips_in_range
Last active December 24, 2023 01:07
A simple IPv4 calculator. Takes an IP and netmask and calculates some details about the network in ksh.
#!/bin/ksh
set -o errexit -o pipefail -o nounset -o noclobber -o noglob
set +o monitor
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
# Convert the IP to an integer so do calculations on it
dottedQuad2int() {
local IFS=.
local ip
set -A ip $* 0 0 0 0

OpenBSD logo     Rails logo     Falcon logo


Choose OpenBSD for your Unix needs. OpenBSD -- the world's simplest and most secure Unix-like OS. A safe alternatve to the frequent vulnerabilities and overengineering of Linux and related software (NGiNX & Apache (httpd-asiabsdcon2015.pdf), OpenSSL, iptables/nftables, systemd, BIND, Postfix, Docker etc.)

OpenBSD -- the cleanest kernel, the cleanest userland and the cleanest config

@daemonhorn
daemonhorn / freebsd_yubikey_authentication.md
Last active April 2, 2025 19:08
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
@gspu
gspu / etc_sysctl.conf
Created August 15, 2020 10:45 — forked from clemensg/etc_sysctl.conf
My FreeBSD /etc/sysctl.conf
# /etc/sysctl.conf
# Clemens Gruber, 2014
#
# Uncomment this to prevent users from seeing information about processes that
# are being run under another UID.
security.bsd.see_other_uids=0
## I/O
@ldong
ldong / cidr.py
Created April 5, 2018 04:17 — forked from lordkebab/cidr.py
Python script to calculate CIDR values
""" Calculate the subnet mask, its binary representation, number of host and
network bits, and the total number of hosts for a given CIDR address.
Usage: python cidr.py [cidr]
Notes: Pipe the command to jq to pretty print the JSON. Python 2 or 3 compatible.
Examples:
python cidr.py 10.0.0.0/24
python cidr.py 172.0.0.0/16 | jq
"""
from __future__ import print_function
@jgamblin
jgamblin / antiautosploit.py
Last active March 25, 2025 10:03
Blocks Shodan IPs From Scanning Your Servers.
#!/usr/bin/python3
import os
shodan = ["104.131.0.69", "104.236.198.48", "155.94.222.12","155.94.254.133", "155.94.254.143", "162.159.244.38", "185.181.102.18", "188.138.9.50", "198.20.69.74", "198.20.69.98", "198.20.70.114", "198.20.87.98", "198.20.99.130", "208.180.20.97", "209.126.110.38", "216.117.2.180", "66.240.192.138", "66.240.219.146", "66.240.236.119", "71.6.135.131", "71.6.146.185", "71.6.158.166", "71.6.165.200", "71.6.167.142", "82.221.105.6", "82.221.105.7", "85.25.103.50", "85.25.43.94", "93.120.27.62", "98.143.148.107", "98.143.148.135"]
for ip in shodan:
os.system("iptables -A INPUT -s {} -j DROP".format(ip))
@ar-android
ar-android / frebsd_laravel_install.md
Last active November 1, 2024 22:30
Setup FreeBSD Server for Laravel

Update Package

sudo freebsd-update fetch install

Install NGINX

sudo pkg install nginx
@turtlemonvh
turtlemonvh / Caddyfile
Last active June 12, 2023 17:51
Multi-host wildcard caddy example
a.myhost.com {
tls off
root /var/www/
proxy / localhost:8091
log log/access.a.log
}
b.myhost.com {
tls off
root /var/www/
@tsutsui
tsutsui / NetBSD-macppc-ofwboot-debug.txt
Created July 1, 2015 16:17
NetBSD/macppc 7.0_RC1 ofwboot debug
Open Firmware, 2.0
To continue booting the MacOS type:
BYE<return>
To continue booting from the default boot device type:
BOOT<return>
ok
0 > boot scsi/sd@3:0 -a
OF_open bootpath=
read stage 2 blocks: 0. done!
starting stage 2...
@powerman
powerman / AsciidocCheatsheet.adoc
Last active July 4, 2024 12:42
Asciidoc cheatsheet for GitHub

Asciidoc cheatsheet for GitHub