Skip to content

Instantly share code, notes, and snippets.

on letsWatchThatStinkingFolder () {
«Changes
«3/7/23; 11:55:58 AM by DW
«Created.
local (prefix = "chat-gpt-");
local (sourcefolder = "Macintosh HD:Users:davewiner:Downloads:");
local (destfolder = user.prefs.publicfolder + "chatgpt:");
fileloop (f in sourcefolder) {
local (fname = file.filefrompath (f));
if fname beginswith prefix {
@ncmiller
ncmiller / HOWTO_LinuxKernelQemu.md
Last active April 27, 2024 22:06
How to build the Linux kernel and test changes locally in qemu

This is the process I followed on my Fedora 23 host machine to build a small/minimal vanilla Linux kernel and test in Qemu (based on this blog post). This will provide a safe sandbox in which to test kernel changes, and is generally faster than developing natively on the host machine. Qemu will boot the kernel image directly in the emulated system.

Install required build tools on host machine

sudo dnf install ncurses-devel kernel-devel kernel-headers gcc gcc-c++ git qemu openssl-devel glibc-static

Prepare a working space for kernel development

@yokawasa
yokawasa / ghcr.md
Last active April 27, 2024 22:05
ghcr (GitHub Container Registry)

ghcr (GitHub Container Registry) quickstart

CLI

To push container images to ghcr, you need peronal access token (PAT) - see how to create PAT

  1. Get PAT (personal access token)

Personal Settings > Developer settings > Personal access tokens

@swiss6th
swiss6th / multi-homebridge-systemd.md
Last active April 27, 2024 22:00
Setting up multiple Homebridge instances with systemd

Setting up Multiple Homebridge Instances with systemd

This guide, adapted from oznu's Homebridge Config UI X Wiki, will show you how to set up multiple instances of Homebridge and Homebridge Config UI X using systemd on a Raspberry Pi. This guide assumes you already have a Pi set up and running a recent version of Raspbian.

Step 1: Assume root

All the steps in this guide assume you are running as the root user:

sudo su
@mattia-beta
mattia-beta / ddos.conf
Last active April 27, 2024 22:00
IPtables DDoS Protection for VPS
### 1: Drop invalid packets ###
/sbin/iptables -t mangle -A PREROUTING -m conntrack --ctstate INVALID -j DROP
### 2: Drop TCP packets that are new and are not SYN ###
/sbin/iptables -t mangle -A PREROUTING -p tcp ! --syn -m conntrack --ctstate NEW -j DROP
### 3: Drop SYN packets with suspicious MSS value ###
/sbin/iptables -t mangle -A PREROUTING -p tcp -m conntrack --ctstate NEW -m tcpmss ! --mss 536:65535 -j DROP
### 4: Block packets with bogus TCP flags ###
-- OverloadedStrings is often useful.
:set -XOverloadedStrings
-- Scoped type variables is often useful so we can specify the types
-- of variables (for example, in lambda expressions).
:set -XScopedTypeVariables
-- useful for import from specified package
:set -XPackageImports
@rafael-neri
rafael-neri / validar_cpf.php
Last active April 27, 2024 21:49
Validar CPF em PHP (Completo)
<?php
function validaCPF($cpf) {
// Extrai somente os números
$cpf = preg_replace( '/[^0-9]/is', '', $cpf );
// Verifica se foi informado todos os digitos corretamente
if (strlen($cpf) != 11) {
return false;
@ruvnet
ruvnet / lion_x_rUv.py
Created April 12, 2024 21:28
LionAGI x rUv v0,01
import os
import asyncio
import subprocess
import importlib
import sys
from dotenv import load_dotenv
from lionagi import Session
from e2b_code_interpreter import CodeInterpreter
from llama_index.core import (
VectorStoreIndex,
@lgg
lgg / remote-desktop-guide.md
Last active April 27, 2024 21:45
Install Remote Desktop on Jetson Nano

Install remote desktop / remote control for Jetson Nano

Anydesk doesn't support and doesn't work on Jetson Nano (aarch64). So you will need to install VNC, the easiest and fastest is to install the X2Go server. NoMachine, TeamViewer, AnyDesk, OpenVino, VNC, RDP, XRDP, Remote access for Jetson Nano / Xavier.

Installation

  • sudo apt update
  • sudo apt upgrade
  • sudo apt install openssh-server vim git gcc g++ net-tools
  • sudo apt-get install xubuntu-desktop (select lightdm)