Skip to content

Instantly share code, notes, and snippets.

View arbal's full-sized avatar
👌
new Adaptor(this); // new Adaptor(_humans[].Behavior);

Arbal arbal

👌
new Adaptor(this); // new Adaptor(_humans[].Behavior);
  • Los Angeles, CA
  • 11:35 (UTC -07:00)
View GitHub Profile
@kkirby
kkirby / hung.m
Last active October 11, 2023 06:19
Updated NonResponding
/**
* compile using this:
* gcc -framework Carbon -framework Foundation ./hung.m -o hung
*
* Referenced from https://apple.stackexchange.com/a/424763/260619
* Original source code https://github.com/jksoegaard/NonResponding
* Original Author: jksoegaard
**/
#import <Foundation/Foundation.h>
@jfeilbach
jfeilbach / ubuntu_22.04_motd.md
Last active April 3, 2025 19:20
Make Ubuntu 22.04 less annoying. Remove ESM Ubuntu Advantage

Ubuntu 22.04 Annoyances

Here are a few collected ways I like to customize Ubuntu 22.04 servers. I used to love Ubuntu, but I hate auto updates and snaps. They also put ads and other usless ads diguised as "news" in MOTD. ESM FUD is spread throughout the OS including simple apt functions. You do not need ESM and thus Ubuntu 22.04 has become super annoying. unattended-upgrade is an automatic installation of security (and other) upgrades without user intervention. Consider the ramifications of disabling this service.

Disable unattended upgrades

The Unattended Upgrades feature is enabled by default and it runs at system boot without the user's permission. The configuration is stored in /etc/apt/apt.conf.d/20auto-upgrades

Disable: sudo dpkg-reconfigure unattended-upgrades then a TUI will come up, select "No"

This will not permantently disable the function. After an update it will be enabled. In the file /etc/apt/apt.conf.d/20auto-upgrades change these values from 1 to 0. Even doing this it will

@mbrammer
mbrammer / crop-rtsp-live-stream-and-provide-result-as-new-rtsp-live-stream.md
Last active February 4, 2025 22:38
Crop section from RTSP live stream and provide result as new RTSP live stream

Create croped RTSP live stream from existing RTSP live stream

I needed a croped section of a RTSP live stream from a UniFi Protect camera, since I am filming my yard from a shed and wanted to see a cutout of the front door from my 4K camera.
This article will show you how to enable the RTSP live stream on the UniFi Protect camera, how to setup a streaming server and how to actually execute the processing of the live stream.

Enable UniFi Protect RTSP live stream

The following screenshots are made from UniFi Protect application on version 2.7.18

  1. Go to "UniFi devices"
  2. Click on the desired camera in the camera list
@bensig
bensig / bitcoin_fast_sync_ideas.md
Created March 3, 2023 20:02
Fast Sync Bitcoin Node - 3 Options

Option 1 - Use This Bitcoin Fast Sync Command

There is no torrent which would be faster than just using the Bitcoin network "hive" - which is huge. There may be a way to sync using local or low-latency nodes nearby, but any time you specify which nodes you sync from - it introduces risk.

Very good to have a fast CPU and lots of RAM, SSD is not as important as RAM.

With this command I was able to download the entire blockchain and create all indices in almost exactly 24 hours:

bitcoind --datadir=<path-to-external-ssd> -blockfilterindex=1 -txindex=1 -coinstatsindex=1 -dbcache=16384 -daemon If you have 32GB of RAM, you can use 32768 for dbcache

@alanzchen
alanzchen / popclip-chatgpt.js
Last active February 20, 2025 14:06
PopClip Actions using ChatGPT.
// #popclip extension for ChatGPT
// name: ChatGPT Quick Actions
// icon: iconify:logos:openai-icon
// language: javascript
// module: true
// entitlements: [network]
// options: [{
// identifier: apikey, label: API Key, type: string,
// description: 'Obtain API key from https://platform.openai.com/account/api-keys'
// }]
@coltonbh
coltonbh / docker-swarm-gpu.md
Last active March 19, 2025 11:21
Docker Swarm GPU Support

GPU Support For Docker Swarm

Docker compose has nice support for GPUs, K8s has moved their cluster-wide GPU scheduler from experimental to stable status. Docker swarm has yet to support the device option used in docker compose so the mechanisms for supporting GPUs on swarm are a bit more open-ended.

Basic documentation

@flaki
flaki / docker-to-proxmox.md
Created February 7, 2023 21:36
Importing a Docker container image into Proxmox Linux Containers (LXC)

Importing a Docker container into Proxmox/LXC

Importing the container

For this we are going to be using lxc-create, which comes pre-installed on Proxmox but needs further dependencies to fetch the OCI images from Docker:

apt update && apt -y install skopeo umoci jq
@majal
majal / minterpolate
Last active February 8, 2025 20:57 — forked from sgqy/minterpolate.sh
Multi-threaded minterpolate in ffmpeg
#!/bin/bash
# Multicore minterpolate in ffmpeg
# Just slice & process & concat
# NB: The concat points between slices may be weird
# Default arguments
ff=/usr/bin/ffmpeg
fps=60
dur=00:00:10
@kesor
kesor / 1-voice-synthesis.js
Last active March 7, 2024 00:19
Making chat OpenAI use TTS
// paste this into your chrome dev console for Speech Synthesis
const originalFetch = window.fetch
const patchedFetch = (...args) => {
if (args[1].method == 'POST' && args[1].body.length > 0 && /moderations$/.test(args[0])) {
const aiResponse = JSON.parse(args[1].body)["input"].split("\n\n\n")
if (aiResponse.length > 1) {
const text = aiResponse.slice(1).join(". ").trim()
console.log(text)
@b0gdanw
b0gdanw / Disable-Ventura-Bloatware.sh
Last active April 15, 2025 03:12
Disable Ventura Bloatware
#!/bin/zsh
# Credit: Original idea and script disable.sh by pwnsdx https://gist.github.com/pwnsdx/d87b034c4c0210b988040ad2f85a68d3
# Disabling unwanted services on macOS Big Sur (11), macOS Monterey (12) and macOS Ventura (13)
# Disabling SIP is required ("csrutil disable" from Terminal in Recovery)
# Modifications are written in /private/var/db/com.apple.xpc.launchd/ disabled.plist, disabled.501.plist
# To revert, delete /private/var/db/com.apple.xpc.launchd/ disabled.plist and disabled.501.plist and reboot; sudo rm -r /private/var/db/com.apple.xpc.launchd/*
# user