Skip to content

Instantly share code, notes, and snippets.

View UlasSAYGINIM's full-sized avatar

Ulaş SAYGIN UlasSAYGINIM

View GitHub Profile
package main
import (
"gorm.io/driver/sqlite"
"gorm.io/gorm"
)
type job1 struct {
ID int `gorm:"primaryKey"`
UniqueField1 string
@seunets
seunets / ipfw.rules
Last active December 22, 2021 18:11
FreeBSD ipfw jail configuration
# Flush all rules
ipfw -q -f flush
# Destroy ACLs
ipfw -q table all destroy
# Create SSH access ACL
ipfw -q table SSHAccess create type addr
ipfw -q table SSHAccess add 192.168.0.1 # SysAdm workstation
% sysctl dev.pcm
dev.pcm.1.bitperfect: 0
dev.pcm.1.buffersize: 65536
dev.pcm.1.rec.vchanformat: s16le:2.0
dev.pcm.1.rec.vchanrate: 48000
dev.pcm.1.rec.vchanmode: fixed
dev.pcm.1.rec.vchans: 1
dev.pcm.1.rec.autosrc: 2
dev.pcm.1.rec.32bit: 24
dev.pcm.1.%parent: hdaa0
@hiway
hiway / README.md
Last active July 25, 2024 02:14
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.

@naveenkrdy
naveenkrdy / AdobeAMDFix.md
Last active February 17, 2025 21:51
To fix adobe products crashes on AMD hackintosh

Adobe Crash Fix XLNC

Instructions

  1. Install needed adobe apps from adobe creative cloud.

  2. Open Terminal.

  3. Copy-paste the below command to your terminal and run it (enter password when asked).

@DaffyDuke
DaffyDuke / freenas_iocage_tips.md
Created January 11, 2020 22:08
Freenas, iocage, vpn and more
@dlangille
dlangille / 0 - the background
Created October 24, 2019 15:50
Try not using allow_sysvipc for jails
[Oct 24 06:55] <debdrup> dvl: an addendum to your post; you should avoid using allow_sysvipc and instead
use the sysvmsg, sysvshm, and sysvsem properties (ie. set them to new).
[Oct 24 06:56] <debdrup> with allow_sysvipc the SysV IPC is still shared with the host, whereas the new
properties isolate SysV IPC to per-jail
@strfry
strfry / README.md
Last active December 23, 2024 08:38
Deploys FreeBSD on a Hetzner cloud server

Deploys FreeBSD on a Hetzner cloud server

Prerequisites:

  • A Hetzner Cloud API Token (Pass in via APIKEY)
  • jq
  • sshpass

Usage

Replace server_id variable with your hetzner server Id
@mizhka
mizhka / dhcpd.conf
Last active March 1, 2022 12:47
Jail+vnet
# dhcpd.conf
# option definitions common to all supported networks...
option subnet-mask 255.255.255.0;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.20.0 netmask 255.255.255.0 {
range 192.168.20.2 192.168.20.40;
option domain-name-servers 192.168.20.1;
option routers 192.168.20.1;
@bign8
bign8 / README.md
Last active February 22, 2022 22:46
FreeBSD Jail Permanent Port Forwarding

FreeBSD Jail Permanent Port Forwarding

Configures jail to forward external ports to a different loopback port within a given jail.

vi /etc/ipfw.rules       # Add ipfw.rules from gist
chmod +x /etc/ipfw.rules # Enable script execution
crontab -e               # Add crontab.conf from gist