Skip to content

Instantly share code, notes, and snippets.

@mhtsai1010
mhtsai1010 / promiscuous_mode.txt
Created August 29, 2016 02:46
Enable promiscuous mode of vmware on a Linux Host
Ref: https://bbs.archlinux.org/viewtopic.php?id=65508
1/ Method 1
# First, create a new Linux group which has permission to use promiscuous mode, and add yourself to the group.
$ groupadd promiscuous
$ usermod -a -G promiscuous <your_user_id>
# Update the group ownership and access permission of /dev/vmnet*
$ chgrp promiscuous /dev/vmnet*
$ chmod g+rw /dev/vmnet*
@jfeilbach
jfeilbach / sysctl.conf.md
Last active May 3, 2025 17:32
10/40 Gb NIC Linux Kernel Performance Tuning for samba file server

TCP tuning

The most important TCP tuning areas since kernel 4.9 are:

  • packet pacing
  • dynamic TSO sizing
  • TCP small queues
  • BBR TCP congestion algorithm

Definitions

  • Gb = gigabit
@rminderhoud
rminderhoud / powershell-web-server.ps1
Last active May 3, 2025 17:24 — forked from 19WAS85/powershell-web-server.ps1
A simple web server built with powershell.
# This is a super **SIMPLE** example of how to create a very basic powershell webserver
# 2019-05-18 UPDATE — Created by me and and evalued by @jakobii and the comunity.
# Http Server
$http = [System.Net.HttpListener]::new()
# Hostname and port to listen on
$http.Prefixes.Add("http://localhost:8080/")
# Start the Http Server
@TheGreatSageEqualToHeaven
TheGreatSageEqualToHeaven / LuaVersion.lua
Created March 28, 2024 01:35
Runtime Lua version detection without _VERSION
local function luaVersion()
local f = function()
return function() end
end
if 0xffffffffffffffffffffffffffffffffffffffffffffff == 2 ^ 64 then
return "Luau"
end
if ({nil,[1] = true})[1] then
@elledienne
elledienne / zero.mdc
Last active May 3, 2025 17:21
Zero Custom Mutators MDC
# Instructions for Using Zero Custom Mutators
## Overview
Zero Custom Mutators provide a powerful mechanism for defining data write operations beyond simple CRUD. They allow you to embed arbitrary code within your write logic, running both client-side for optimistic updates and server-side for authority and complex operations.
**Key Concepts:**
- **Arbitrary Code:** Mutators are functions, enabling complex validation, permissions, calling external services (like LLMs or sending emails), calling queue, etc.
- **Client-Side Execution:** Mutators run immediately on the client for instant UI feedback.
@adisbladis
adisbladis / podman-shell.nix
Last active May 3, 2025 17:20
Use podman within a nix-shell
{ pkgs ? import <nixpkgs> {} }:
let
# To use this shell.nix on NixOS your user needs to be configured as such:
# users.extraUsers.adisbladis = {
# subUidRanges = [{ startUid = 100000; count = 65536; }];
# subGidRanges = [{ startGid = 100000; count = 65536; }];
# };
@TheGreatSageEqualToHeaven
TheGreatSageEqualToHeaven / LuauOptimizeLevel.lua
Created March 28, 2024 01:34
Getting the Luau optimize level at runtime safely
local function getOptimizeLevel()
local function dupclosure()
return function() end
end
local O0 = dupclosure() ~= dupclosure()
local function inlinefunction()
return debug.info(1, "f")
end
@t3dotgg
t3dotgg / model-prices.csv
Last active May 3, 2025 17:19
Rough list of popular AI models and the cost to use them (cost is per 1m tokens)
Name Input Output
Gemini 2.0 Flash-Lite $0.075 $0.30
Mistral 3.1 Small $0.10 $0.30
Gemini 2.0 Flash $0.10 $0.40
ChatGPT 4.1-nano $0.10 $0.40
DeepSeek v3 (old) $0.14 $0.28
ChatGPT 4o-mini $0.15 $0.60
DeepSeek v3 $0.27 $1.10
Grok 3-mini $0.30 $0.50
ChatGPT 4.1-mini $0.40 $1.60
@githubfoam
githubfoam / huawei switch cheat sheet
Last active May 3, 2025 17:14
huawei switch cheat sheet
------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------
#Enter the system view mode
<Quidway>sys
Enter system view, return user view with Ctrl+Z.
------------------------------------------------------------------------------------------------------------------------------
#Enter the system view mode