Skip to content

Instantly share code, notes, and snippets.

@ecapuano
ecapuano / better_event_logging.ps1
Created March 1, 2025 17:50
A PowerShell script for installing Sysmon and enabling best-practice audit logs.
# ================================================
# Sysmon & Windows Event Log Configuration Script
# ================================================
# Check for administrative privileges
$currentUser = [Security.Principal.WindowsIdentity]::GetCurrent()
$principal = New-Object Security.Principal.WindowsPrincipal($currentUser)
if (-not $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Host "This script requires administrative privileges. Please run as an administrator." -ForegroundColor Red
exit 1
@mrjk
mrjk / cli-app-typer.py
Last active March 2, 2025 15:15
A quite complete example of python CLI Typer boilerplate [python] (Archive)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Version: 08-2024
# Migrated to: https://github.com/mrjk/python_snippets/blob/main/examples/typer/cli-app-typer.py
"""MyApp CLI interface
This CLI provides a similar experience as the git CLI, but in Python with Typer.
@maksadbek
maksadbek / nginx.conf
Created January 3, 2017 17:51
nginx configuration for HLS live video streaming
worker_processes 1;
error_log logs/error.log debug;
events {
worker_connections 1024;
}
rtmp {
server {
listen 1935;
allow play all;
@Megarmax
Megarmax / DIVI API Key
Created March 2, 2025 15:11 — forked from KaziNizamul/DIVI API Key
DIVI API Key
easyweb-italia
4764fbb159e067e22458285444e844c313f26d6d
easyweb-italia
4764fbb159e067e22458285444e844c313f26d6d
@Kinyugo
Kinyugo / install_cursor.sh
Last active March 2, 2025 15:10
Cursor AI IDE Installer and Updater Script
#!/bin/bash
installCursor() {
local CURSOR_URL="https://downloader.cursor.sh/linux/appImage/x64"
local ICON_URL="https://miro.medium.com/v2/resize:fit:700/1*YLg8VpqXaTyRHJoStnMuog.png"
local APPIMAGE_PATH="/opt/cursor.appimage"
local ICON_PATH="/opt/cursor.png"
local DESKTOP_ENTRY_PATH="/usr/share/applications/cursor.desktop"
echo "Checking for existing Cursor installation..."
@adammyhre
adammyhre / DamageNumberSpawner.cs
Created March 1, 2025 14:21
World Space UI Toolkit
using PrimeTween;
using UnityEngine;
using UnityEngine.Pool;
using UnityUtils;
public class DamageNumberSpawner : MonoBehaviour {
[SerializeField] WorldSpaceUIDocument uiDocumentPrefab;
[SerializeField] float positionRandomness = 0.2f;
IObjectPool<WorldSpaceUIDocument> uiDocumentPool;
@noelboss
noelboss / git-deployment.md
Last active March 2, 2025 15:09
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

#!/bin/bash
# Script to check enforced software update deferral settings on macOS
# Author: Karthikeyan M
# Function to retrieve values from macOS preferences
get_pref() {
osascript -l JavaScript << EOS
ObjC.import('Foundation')
ObjC.unwrap($.NSUserDefaults.alloc.initWithSuiteName('com.apple.applicationaccess').objectForKey('$1'))
EOS