Allows you to programatically modify key:value sysctl pairs on MacOS

go-sysctl-mac

Allows you to programatically modify key:value sysctl pairs on MacOS.

Tested & confirmd to work on MacOS Big Sur & newer releases.

Example:

package mypkg

import (
  "testing"
  "github.com/carterpeel/go-sysctl-mac"
)

func TestPersistent(t *testing.T) {
	t.Cleanup(func() {
		if err := sysctl.Set("net.inet.ip.forwarding", "0"); err != nil {
			t.Fatalf("error disabling IP forwarding: %v\n", err)
		}
	})

	// SetPersistent() activates the config option now, but also adds it to
	// /private/etc/sysctl.conf, so it persists over reboots.
	if err := sysctl.SetPersistent("net.inet.ip.forwarding", "1"); err != nil {
		t.Fatalf("error enabling IP forwarding: %v\n", err)
	}
}

func TestNonPersistent(t *testing.T) {
	t.Cleanup(func() {
		if err := sysctl.Set("kern.maxproc", "2048"); err != nil {
			t.Fatalf("error resetting maxprocs to default: %v\n", err)
		}
	})

	// Set() sets a config option that will not persist upon reboot.
	if err := sysctl.Set("kern.maxproc", "1000"); err != nil {
		t.Fatalf("error incrementing maxproc: %v\n", err)
	}
}
Owner
Carter Peel
Rocky Linux , HPCNG, & Golang.
Carter Peel
Similar Resources

A simple Go library to toggle on and off pac(proxy auto configuration) for Windows, MacOS and Linux

pac pac is a simple Go library to toggle on and off pac(proxy auto configuration

Dec 26, 2021

Multiplexer over TCP. Useful if target server only allows you to create limited tcp connections concurrently.

tcp-multiplexer Use it in front of target server and let your client programs connect it, if target server only allows you to create limited tcp conne

May 27, 2021

This plugin allows you to start a local server with hot reloading with Esbuild

esbuild-dev-server This plugin allows you to start a local server with hot reloading with Esbuild Installation npm npm i esbuild-dev-server -D yarn y

Nov 4, 2022

Chat app that allows you to group multiple channels into one view.

hashchat Backend service Getting Started Essential steps to get your backend service deployed A helloworld example has been shipped with the template

Dec 13, 2021

This is a tool that allows you to check minecraft names availability, this tool can do around 3000~ names a minute or more!

Checker This is a tool that allows you to check minecraft names availability, this tool can do around 3000~ names a minute or more! Tutorial To instal

Feb 13, 2022

A tool allows you to inspect in-bound and out-bound dns messages

A tool allows you to inspect in-bound and out-bound dns messages

This tool allows you to inspect in-bound and out-bound dns messages. You can use the tool to poison your own cache. Call ./dns-mitm to start the appli

Dec 11, 2021

DeepCopy a portable app that allows you to copy all forms of specified file types from your entire file system of the computer

DeepCopy a portable app that allows you to copy all forms of specified file types from your entire file system of the computer

Dec 20, 2021

Minekube Connect allows you to connect any Minecraft server

Minekube Connect allows you to connect any Minecraft server, whether online mode, public, behind your protected home network or anywhere else in the world, with our highly available, performant and low latency edge proxies network nearest to you.

Dec 27, 2022

httpx is a fast and multi-purpose HTTP toolkit allows to run multiple probers using retryablehttp library, it is designed to maintain the result reliability with increased threads.

httpx is a fast and multi-purpose HTTP toolkit allows to run multiple probers using retryablehttp library, it is designed to maintain the result reliability with increased threads.

Features • Installation • Usage • Running httpx • Notes • Join Discord httpx is a fast and multi-purpose HTTP toolkit allow to run multiple probers us

Jan 8, 2023
Capture packet request/response pairs for a port and/or IP to aid in Network protocol based Nuclei Templates creation.

network-fingerprint Capture packet request/response pairs for a port and/or IP to aid in Network protocol based Nuclei Templates creation. Resources I

Nov 15, 2022
A server that proxies requests and uses fhttp & my fork of CycleTLS to modify your clienthello and prevent your requests from being fingerprinted.

TLS-Fingerprint-API A server that proxies requests and uses my fork of CycleTLS & fhttp (fork of net/http) to prevent your requests from being fingerp

Jan 7, 2023
Pspy-modify - Automatic privilege escalation by pspy
Pspy-modify - Automatic privilege escalation by pspy

=========== UPDATE CONTENT ============== 更新内容 在Linux提权过程中,我们可以尝试高权限运行的文件我们当前用户是

Nov 18, 2022
Traefik proxy plugin to extract HTTP header value and create a new header with extracted value

Copy header value Traefik plugin Traefik plugin that copies HTTP header value with format key1=value1; key2=value2 into a new header. Motivation for t

May 26, 2022
In memory Key/Value store in go using gRPC.
In memory Key/Value store in go using gRPC.

In memory cache, using gRPC Contents About Running Server Local Docker Kubernetes Example Helm Terraform API Add Get GetByPrefix GetAllItems DeleteKey

Dec 26, 2022
A simple distributed key-value store by using hashicorp/raft

raftkv This repository holds a simple distributed key-value store by using hashicorp/raft. raftkv provides gRPC and HTTP APIs. Please take a look API

Nov 30, 2022
Test ssh login key acceptance without having the private key

ssh-key-confirmer This confirms if a SSH public key is listed as a authorized_key on a system Usage $ ssh-key-confirmer -i ./id_rsa.pub [email protected]

Dec 30, 2022
一个不限速的天翼云网盘下载器。(支持分享链接下载、支持Windows、Linux、macOS)Based Go.

189Cloud-Downloader 一个不限速的天翼云网盘下载器。(支持分享链接下载、支持Windows、Linux、macOS)Based Go. 使用说明 NAME: 189Cloud-Downloader - 一个189云盘的下载器。(支持分享链接) USAGE: 189Cl

Dec 6, 2022
WebDAV server for SSH. Similar to sshfs but does not require proprietary MacFUSE on macOS

sshwebdav: WebDAV server for SSH sshwebdav provides a WebDAV server for a remote SSH host. sshwebdav is similar to sshfs but does not require propriet

Nov 9, 2022
Native macOS networking for QEMU using vmnet.framework and socket networking.

qemu-vmnet Native macOS networking for QEMU using vmnet.framework and socket networking. Getting started TODO -netdev socket,id=net0,udp=:1234,localad

Jan 5, 2023