Skip to content

Instantly share code, notes, and snippets.

View andrew-azarov's full-sized avatar
🍊
Focusing

Andrew Azarov andrew-azarov

🍊
Focusing
View GitHub Profile
#### General PFCTL Commands ####
$ pfctl -d disable # packet-filtering
$ pfctl -e enable # packet-filtering
$ pfctl -q # run quiet
$ pfctl -v -v # run even more verbose
#### Loading PF Rules ####
$ pfctl -f /etc/pf.conf # load /etc/pf.conf
$ pfctl -n -f /etc/pf.conf # parse /etc/pf.conf, but dont load it
$ pfctl -R -f /etc/pf.conf # load only the FILTER rules
$ pfctl -N -f /etc/pf.conf # load only the NAT rules
@andrew-azarov
andrew-azarov / openssh-7.6-ubuntu-16.04.sh
Created April 11, 2022 12:25 — forked from prbinu/openssh-7.6-ubuntu-16.04.sh
How to build (and install) OpenSSH 7.6 packages on Ubuntu-16.04
# on a fresh Ubuntu 16.04 host
sudo apt-get update
# copy Ubuntu source packages from http://archive.ubuntu.com/ubuntu/pool/main/o/openssh
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssh/openssh_7.6p1-4.dsc
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssh/openssh_7.6p1.orig.tar.gz
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssh/openssh_7.6p1.orig.tar.gz.asc
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssh/openssh_7.6p1-4.debian.tar.xz
@andrew-azarov
andrew-azarov / README.md
Created February 12, 2022 20:42 — forked from hiway/README.md
Creating a single process FreeBSD (12.1) Jail

How to jail a single process web server on FreeBSD 12.1

You may have found many great resources on how to set up jails on latest FreeBSD, however there is scant information on how to go about creating a barebones jail with nothing but the one process that you want to isolate.

I was curious if I could contain a statically compiled web server that I wrote while learning Rust all by itself in a jail instead of having a full userland.

Get-ChildItem "E:\*\winver\amd64\" -Recurse -Filter "*.inf" |
ForEach-Object { PNPUtil.exe -i -a $_.FullName }
@andrew-azarov
andrew-azarov / mailman.py
Last active May 1, 2016 21:29
Short and simple email function for python, easy to plug in into any scripts and run right away.
#!/usr/bin/env python
# coding=utf8
"""
Copyright (c) 2013 Azar-A Ltd., Azarov Andrew
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@andrew-azarov
andrew-azarov / rbackup.sh
Created February 13, 2016 15:32
Simple smart backup script focused on files, mysql, pgsql and ftp upload (files are from FreeBSD edition, can be redefined in the beginning)
#!/bin/sh
# Global settings
gz_b="/usr/bin/pigz" # Gzip
awk_b="/usr/bin/awk" # Awk
echo_b="/bin/echo" # Echo
tar_b="/usr/bin/tar" # Tar
xargs_b="/usr/bin/xargs" # Xargs
cat_b="/bin/cat" # Cat
find_b="/usr/bin/find" # Find
@andrew-azarov
andrew-azarov / supermicro-mass-upgrade-ipmi.py
Last active January 14, 2023 07:20
Mass upgrade script for supermicro ipmi, needs requests and requests_toolbelt
#!/usr/bin/env python
# coding=utf8
"""
Copyright (c) 2015 ServerAstra Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: